WelsErrorType CWelsTaskManageBase::Init (sWelsEncCtx* pEncCtx) {
  m_pEncCtx = pEncCtx;

  m_iThreadNum = m_pEncCtx->pSvcParam->iMultipleThreadIdc;
  m_pThreadPool = WELS_NEW_OP (WelsCommon::CWelsThreadPool (this, m_iThreadNum),
                               WelsCommon::CWelsThreadPool);
  WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, NULL == m_pThreadPool)

  m_pcAllTaskList[CWelsBaseTask::WELS_ENC_TASK_ENCODING] = m_cEncodingTaskList;
  m_pcAllTaskList[CWelsBaseTask::WELS_ENC_TASK_UPDATEMBMAP] = m_cPreEncodingTaskList;

  m_iCurrentTaskNum = pEncCtx->pSvcParam->sSpatialLayers[0].sSliceArgument.uiSliceNum;
  //printf ("CWelsTaskManageBase Init m_iThreadNum %d m_iCurrentTaskNum %d pEncCtx->iMaxSliceCount %d\n", m_iThreadNum, m_iCurrentTaskNum, pEncCtx->iMaxSliceCount);
  return CreateTasks (pEncCtx, pEncCtx->iMaxSliceCount);
}
Ejemplo n.º 2
0
WelsErrorType CWelsTaskManageBase::Init (sWelsEncCtx* pEncCtx) {
  m_pEncCtx = pEncCtx;

  m_iThreadNum = m_pEncCtx->pSvcParam->iMultipleThreadIdc;
  m_pThreadPool = WELS_NEW_OP (WelsCommon::CWelsThreadPool (this, m_iThreadNum),
                               WelsCommon::CWelsThreadPool);
  WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, NULL == m_pThreadPool)

  int32_t iReturn = 0;
  for (int32_t iDid = 0; iDid < MAX_DEPENDENCY_LAYER; iDid++) {
    m_pcAllTaskList[CWelsBaseTask::WELS_ENC_TASK_ENCODING][iDid] = m_cEncodingTaskList[iDid];
    m_pcAllTaskList[CWelsBaseTask::WELS_ENC_TASK_UPDATEMBMAP][iDid] = m_cPreEncodingTaskList[iDid];
    iReturn |= CreateTasks (pEncCtx, iDid);
  }

  //printf ("CWelsTaskManageBase Init m_iThreadNum %d m_iCurrentTaskNum %d pEncCtx->iMaxSliceCount %d\n", m_iThreadNum, m_iCurrentTaskNum, pEncCtx->iMaxSliceCount);
  return iReturn;
}
Ejemplo n.º 3
0
Archivo: main.c Proyecto: hl1itj/Team2
int main() {

	PA_Init();    // Initializes PA_Lib
//	PA_InitVBL(); // Initializes a standard VBL

	PA_VBLFunctionInit(AS_SoundVBL);
	AS_Init(AS_MODE_MP3 | AS_MODE_SURROUND | AS_MODE_16CH);
	AS_SetDefaultSettings(AS_PCM_8BIT, 11025, AS_SURROUND);

	PA_LoadDefaultText(1, 0);

	StartScreen();
	CreateTasks();
	initMap(map);

	vTaskStartScheduler();		// Never returns
	while (1)
		;
	return 0;
}
Ejemplo n.º 4
0
CViewTasks::CViewTasks(wxNotebook* pNotebook, BSLHOST hHost) :
     CViewBase(pNotebook, ID_TASK_WORKVIEW, DEFAULT_TASK_FLAGS, ID_LIST_WORKVIEW, DEFAULT_LIST_FLAGS)
{
    //
    // Store host handle for future use
    //
    m_hHost = hHost;

    // Initialize List View
    CreateTasks();
    CreateHeaders();

    // Initialize Column Sorting Mechinism
    m_bSortUpdatedColumns.resize(COLUMN_STATUS + 1);

    // Restore State
    RestoreState();

    // Give time for all the controls to figure out their layout and render
    // properly.
    wxCommandEvent evt(wxEVT_VIEWTASKS_INIT);
    AddPendingEvent(evt);
}
Ejemplo n.º 5
0
WelsErrorType CWelsTaskManageOne::Init (sWelsEncCtx* pEncCtx) {
  Uninit();
  m_pEncCtx = pEncCtx;

  return CreateTasks (pEncCtx, pEncCtx->iMaxSliceCount);
}
Ejemplo n.º 6
0
void UserMain(void * pd) {
  int x;
  DWORD flag = 0;
  int cnt;

  InitializeStack();
  GetDHCPAddressIfNecessary();
  if (EthernetIP == 0) GetDHCPAddress();
  OSChangePrio(MAIN_PRIO);
  EnableAutoUpdate();

  #ifdef _DEBUG
    /* InitializeNetworkGDB_and_Wait(); */
    InitializeNetworkGDB();
  #endif

  /* note, this may not work in all cases.
  1) all systems might boot at the same time
  2) when they get to this point, they may not have an ip yet
  */
    /* init our acn stack */
    acn_port_protect_startup();
#if CONFIG_NSK
  srand(GetPreciseTime() + netx_getmyip(0));
  netx_init();
  netx_startup();
#endif

#if CONFIG_SLP
  slp_init();
  slp_open();
  slp_active_discovery_start();
#endif

#if CONFIG_RLP
  rlp_init();
#if CONFIG_SDT
  sdt_init(); /* indirectly calls sdtm_init(), rlp_init(), rlpm_init() */
  sdt_startup(true);
#endif

#if CONFIG_DMP
  /* dmp_startup(); */
#endif

#endif /* RLP */

  CreateTasks();

  x = OSChangePrio( DEBUG_TERM_PRIORITY );
  if (x) {
    PRINTF("%s","OUCH\n");
  }

  PRINTF("%s","Hello ACN World\n");

  ioctl( 0, IOCTL_CLR | IOCTL_RX_ECHO ); /* turn sdtin echo off */

  process_keys();

  /* shut things down - these require the threads to continue run... */
#if CONFIG_SDT
  sdt_shutdown();
#endif

#if CONFIG_SLP
  slp_close();
#endif

#if CONFIG_DMP
  /* dmp_shutdown() */
#endif

  /* shut down receive thread */
  OSFlagClear(&recv_flag, 1);
  PRINTF("%s","Waiting for task to recv to shut down..");
  cnt = 0;
  flag = 0;
  while (!flag) {
    cnt++;
    if (cnt == 80) {
      cnt = 0;
      PRINTF("%s","\n");
    }
    PRINTF("%s",".");
    flag = OSFlagState(&recv_flag);
  }

  /* shut down tick thread */
  OSFlagClear(&tick_flag, 1);
  PRINTF("%s","Waiting for task to tick to shut down..");
  cnt = 0;
  flag = 0;
  while (!flag) {
    cnt++;
    if (cnt == 80) {
      cnt = 0;
      PRINTF("%s","\n");
    }
    PRINTF("%s",".");
    flag = OSFlagState(&tick_flag);
  }

#if CONFIG_NSK
  netx_shutdown();
#endif
  acn_port_protect_shutdown();

  slp_stats();
  sdt_stats();
  PRINTF("%s","========================\n");

  PRINTF("%s","\nDone....\n");
  while (1) {
    OSTimeDly(20);
  }
}