当前位置: 首页>>代码示例>>C++>>正文


C++ OSA_ERROR函数代码示例

本文整理汇总了C++中OSA_ERROR函数的典型用法代码示例。如果您正苦于以下问题:C++ OSA_ERROR函数的具体用法?C++ OSA_ERROR怎么用?C++ OSA_ERROR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了OSA_ERROR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OSA_queCreate

int OSA_queCreate(OSA_QueHndl *hndl, Uint32 maxLen)
{
  pthread_mutexattr_t mutex_attr;
  pthread_condattr_t cond_attr;
  int status=OSA_SOK;

  hndl->curRd = hndl->curWr = 0;
  hndl->count = 0;
  hndl->len   = maxLen;
  hndl->queue = OSA_memAlloc(sizeof(Int32)*hndl->len);
  
  if(hndl->queue==NULL) {
    OSA_ERROR("OSA_queCreate() = %d \r\n", status);
    return OSA_EFAIL;
  }
 
  status |= pthread_mutexattr_init(&mutex_attr);
  status |= pthread_condattr_init(&cond_attr);  
  
  status |= pthread_mutex_init(&hndl->lock, &mutex_attr);
  status |= pthread_cond_init(&hndl->condRd, &cond_attr);    
  status |= pthread_cond_init(&hndl->condWr, &cond_attr);  

  if(status!=OSA_SOK)
    OSA_ERROR("OSA_queCreate() = %d \r\n", status);
    
  pthread_condattr_destroy(&cond_attr);
  pthread_mutexattr_destroy(&mutex_attr);
    
  return status;
}
开发者ID:119,项目名称:ipnc,代码行数:31,代码来源:osa_que.c

示例2: AVSERVER_bufGetNextTskInfo

OSA_BufInfo *AVSERVER_bufPutFull(int tskId, int streamId, int bufId)
{
  OSA_BufHndl *pBufHndl;
  OSA_TskHndl *pTskHndl;
  int status;

  status = AVSERVER_bufGetNextTskInfo(tskId, streamId, &pBufHndl, &pTskHndl);
  if(status!=OSA_SOK) {
    OSA_ERROR("AVSERVER_bufGetNextTskInfo(%d, %d)\n", tskId, streamId);
    return NULL;
  }

  status = OSA_bufPutFull(pBufHndl, bufId);
  if(status!=OSA_SOK) {
    OSA_ERROR("OSA_bufPutFull(%d, %d, %d)\n", tskId, streamId, bufId);
    return NULL;
  }

  status = OSA_tskSendMsg(pTskHndl, NULL, AVSERVER_CMD_NEW_DATA, (void*)streamId, 0);
  if(status!=OSA_SOK) {
    OSA_ERROR("OSA_tskSendMsg(AVSERVER_CMD_NEW_DATA, %d, %d)\n", tskId, streamId);
    return NULL;
  }

  return OSA_bufGetBufInfo(pBufHndl, bufId);
}
开发者ID:119,项目名称:ipnc,代码行数:26,代码来源:avServer.c

示例3: AVSERVER_init

int AVSERVER_init()
{
  int status;

  #ifdef AVSERVER_DEBUG_API
  OSA_printf(" AVSERVER API: Creating TSKs.\n");
  #endif

  status = DRV_init();
  if(status!=OSA_SOK) {
    OSA_ERROR("DRV_init()\n");
    return status;
  }

  status = ALG_sysInit();
  if(status!=OSA_SOK) {
    OSA_ERROR("ALG_sysInit()\n");
    DRV_exit();
    return status;
  }

  memset(&gAVSERVER_config, 0, sizeof(gAVSERVER_config));
  memset(&gVIDEO_ctrl, 0, sizeof(gVIDEO_ctrl));
  memset(&gAVSERVER_ctrl, 0, sizeof(gAVSERVER_ctrl));

  status |= OSA_mutexCreate(&gAVSERVER_ctrl.lockMutex);

  status |= VIDEO_captureCreate();
  //status |= VIDEO_resizeCreate();
  status |= VIDEO_streamCreate();
  status |= VIDEO_displayCreate();
  //status |= VIDEO_ldcCreate();
  //status |= VIDEO_vnfCreate();
  //status |= VIDEO_vsCreate();
  status |= VIDEO_aewbCreate();
  //status |= VIDEO_fdCreate();
  status |= VIDEO_encodeCreate();
  status |= VIDEO_swosdCreate();
  //status |= VIDEO_encryptCreate();
  status |= VIDEO_motionCreate();
  //status |= AUDIO_audioCreate();
  //status |= AUDIOPLAY_audioCreate();
  status |= AVSERVER_mainCreate();

  if(status!=OSA_SOK) {
    OSA_ERROR("AVSERVER_init()\n");
    ALG_sysExit();
    DRV_exit();
    return status;
  }

  #ifdef AVSERVER_DEBUG_API
  OSA_printf(" AVSERVER API: Creating TSKs...DONE\n");
  #endif

  return status;
}
开发者ID:JammyWei,项目名称:ipc_dm36x,代码行数:57,代码来源:avServerApi.c

示例4: ALG_jpgEncSetQvalue

int ALG_jpgEncSetQvalue(void *hndl, int qValue)
{
  ALG_JpgEncObj  *pObj = (ALG_JpgEncObj*)hndl;
  XDAS_Int32 status;

  if(pObj==NULL)
    return OSA_EFAIL;

  pObj->dynamicParams.size = sizeof(IMGENC1_DynamicParams);
  pObj->dynamicParams.numAU = XDM_DEFAULT;

  if(pObj->createPrm.dataFormat==ALG_VID_DATA_FORMAT_YUV422)
    pObj->dynamicParams.inputChromaFormat  = XDM_YUV_422ILE;
  else
    pObj->dynamicParams.inputChromaFormat  = XDM_YUV_420SP;

  if(qValue < ALG_JPG_ENC_Q_VALUE_MIN)
    qValue = ALG_JPG_ENC_Q_VALUE_MIN;
  if(qValue > ALG_JPG_ENC_Q_VALUE_MAX)
    qValue = ALG_JPG_ENC_Q_VALUE_MAX;

  pObj->dynamicParams.inputWidth      = pObj->createPrm.width;
  pObj->dynamicParams.inputHeight     = pObj->createPrm.height;
  pObj->dynamicParams.captureWidth    = (pObj->createPrm.offsetH>pObj->createPrm.width)?pObj->createPrm.offsetH:pObj->createPrm.width;
  pObj->dynamicParams.generateHeader  = XDM_ENCODE_AU;
  pObj->dynamicParams.qValue          = qValue;

  /* Set video encoder dynamic parameters */
  pObj->encStatus.size = sizeof(pObj->encStatus);
  pObj->encStatus.data.buf = NULL;

  status = IMGENC1_control(pObj->hEncode, XDM_SETPARAMS, &pObj->dynamicParams, &pObj->encStatus);

  if (status != IMGENC1_EOK) {
    OSA_ERROR("XDM_SETPARAMS failed, status=%ld\n", status);
    return OSA_EFAIL;
  }

  pObj->encStatus.data.buf = NULL;

  status = IMGENC1_control(pObj->hEncode, XDM_GETBUFINFO, &pObj->dynamicParams, &pObj->encStatus);

  if (status != IMGENC1_EOK) {
      OSA_ERROR("XDM_GETBUFINFO failed, status=%ld\n", status);
      return OSA_EFAIL;
  }

  #ifdef ALG_DEBUG
  OSA_printf(" ALG: ImgEnc: XDM_GETBUFINFO: min in bufs:%ld buf(0):%ld buf(1):%ld\n",pObj->encStatus.bufInfo.minNumInBufs,pObj->encStatus.bufInfo.minInBufSize[0], pObj->encStatus.bufInfo.minInBufSize[1]);
  #endif

  return OSA_SOK;
}
开发者ID:JammyWei,项目名称:ipc_dm36x,代码行数:53,代码来源:alg_jpgEnc.c

示例5: AVSERVER_bufGetCurTskInfo

int AVSERVER_bufGetCurTskInfo(int tskId, int streamId, OSA_BufHndl **pBufHndl)
{
  VIDEO_CaptureStream *pCaptureStream=NULL;
  VIDEO_EncodeStream  *pEncodeStream=NULL;

  *pBufHndl=NULL;

  if(streamId<0 || streamId >= AVSERVER_MAX_STREAMS) {
    OSA_ERROR("Incorrect streamId (%d)\n", streamId);
    return OSA_EFAIL;
  }

  if(tskId <= VIDEO_TSK_CAPTURE || tskId > VIDEO_TSK_STREAM) {
    OSA_ERROR("Incorrect tskId (%d)\n", tskId);
    return OSA_EFAIL;
  }

  if(tskId <= VIDEO_TSK_ENCODE) {
    pCaptureStream = &gVIDEO_ctrl.captureStream[streamId];

    if(tskId==VIDEO_TSK_LDC) {
      *pBufHndl = &pCaptureStream->bufLdcIn;
    } else
    if(tskId==VIDEO_TSK_VNF) {
      *pBufHndl = &pCaptureStream->bufVnfIn;
    } else
    if(tskId==VIDEO_TSK_RESIZE) {
      *pBufHndl = &pCaptureStream->bufResizeIn;
    } else
    if(tskId==VIDEO_TSK_ENCODE) {
      *pBufHndl = &pCaptureStream->bufEncodeIn;
    } else {
      OSA_ERROR("Incorrect tskId (%d)\n", tskId);
      return OSA_EFAIL;
    }

  } else {

    pEncodeStream  = &gVIDEO_ctrl.encodeStream[streamId];

    if(tskId==VIDEO_TSK_ENCRYPT) {
      *pBufHndl = &pEncodeStream->bufEncryptIn;
    } else
    if(tskId==VIDEO_TSK_STREAM) {
      *pBufHndl = &pEncodeStream->bufStreamIn;
    } else {
      OSA_ERROR("Incorrect tskId (%d)\n", tskId);
      return OSA_EFAIL;
    }
  }

  return OSA_SOK;
}
开发者ID:119,项目名称:ipnc,代码行数:53,代码来源:avServer.c

示例6: AdjustApertureLevel

int AdjustApertureLevel(Uint8 level)
{
#define IRIS_I2C_ADDR     (0x0898U)
    DRV_I2cHndl i2cHnd2;
    int status = OSA_EFAIL;
    Uint16 regAddr16=0;
    Uint16 regValue = 0;

    level = (level >= 100) ? 100 : level;

    Uint8 da_value = 255 * (100 - level) / 100;
    static Uint8 da_value_bak = 50;

    if (da_value == da_value_bak)
    {
        return OSA_SOK;
    }
    da_value_bak = da_value;

    memset(&i2cHnd2, 0, sizeof(i2cHnd2));
    status = DRV_i2cOpen(&i2cHnd2, IRIS_I2C_ADDR);

    if (status == OSA_SOK)
    {
        regValue = (Uint16)da_value << 4;//Please refer to the manual DAC5571
        status = DRV_i2c16Write16(&i2cHnd2, &regAddr16, &regValue, 1);

        if (status != OSA_SOK)
        {
            OSA_ERROR("AdjustApertureLevel error!\n");
        }
        else
        {
            OSA_printf("AdjustApertureLevel level= %d\n", level);
        }
    }

    DRV_i2cClose(&i2cHnd2);
    if (status != OSA_SOK)
    {
        OSA_ERROR("DRV_i2cClose() error!\n");
        return OSA_EFAIL;
    }

    OSA_waitMsecs(10);

    return OSA_SOK;
}
开发者ID:JammyWei,项目名称:ipc_dm36x,代码行数:48,代码来源:drv_imgs.c

示例7: TVP5158_softReset

int TVP5158_softReset(DRV_I2cHndl *i2cHndl)
  {
  	int status=OSA_SOK;
	Uint8 regAddr[64];
	Uint8 regVal[64];
  Uint32 k;
  Uint8 vbusStatus;  

    status = TVP5158_selectWrite(i2cHndl, 0xF);
  if(status!=OSA_SOK)
    goto error_exit;

  k=0;

  vbusStatus = 0x1;

  status = TVP5158_vbusWrite(i2cHndl, 0xB00060, vbusStatus, 1);
  if(status!=OSA_SOK)
    goto error_exit;

  vbusStatus = 0x0;

  status = TVP5158_vbusWrite(i2cHndl, 0xB00060, vbusStatus, 1);
  if(status!=OSA_SOK)
    goto error_exit;

  OSA_waitMsecs(300);
  
error_exit:
  if(status!=OSA_SOK)
    OSA_ERROR("I2C");

  return status;  
}
开发者ID:119,项目名称:ipnc,代码行数:34,代码来源:mcvip_tvp5158_i2c.c

示例8: OSA_msgqCreate

int OSA_msgqCreate(OSA_MsgqHndl *hndl)
{
  pthread_mutexattr_t mutex_attr;
  pthread_condattr_t cond_attr;
  int status=OSA_SOK;
 
  status |= pthread_mutexattr_init(&mutex_attr);
  status |= pthread_condattr_init(&cond_attr);  
  
  status |= pthread_mutex_init(&hndl->lock, &mutex_attr);
  status |= pthread_cond_init(&hndl->condRd, &cond_attr);    
  status |= pthread_cond_init(&hndl->condWr, &cond_attr);  

  hndl->curRd = hndl->curWr = 0;
  hndl->count = 0;
  hndl->len   = OSA_MSGQ_LEN_MAX;

  if(status!=OSA_SOK)
    OSA_ERROR("OSA_msgqCreate() = %d \r\n", status);
    
  pthread_condattr_destroy(&cond_attr);
  pthread_mutexattr_destroy(&mutex_attr);
    
  return status;
}
开发者ID:JammyWei,项目名称:dm8168,代码行数:25,代码来源:osa_msgq.c

示例9: DRV_faceDetectOpen

int DRV_faceDetectOpen()
{
  memset(&gDRV_faceDetectObj, 0, sizeof(gDRV_faceDetectObj));
  
  gDRV_faceDetectObj.workAreaVirtAddr = OSA_cmemAlloc(DRV_FACE_DETECT_WORK_AREA_SIZE, 32);
  gDRV_faceDetectObj.workAreaPhysAddr = OSA_cmemGetPhysAddr(gDRV_faceDetectObj.workAreaVirtAddr);
    
  if(  gDRV_faceDetectObj.workAreaVirtAddr==NULL
   ||  gDRV_faceDetectObj.workAreaPhysAddr==NULL
    ) {
    OSA_ERROR("Insufficient memory\n");
    goto error_exit;
  }
  
  CSL_faceDetectIntClear(&gCSL_faceDetectHndl);  
  CSL_faceDetectIntEnable(&gCSL_faceDetectHndl, TRUE);
  
  return OSA_SOK;
  
error_exit:
  if(gDRV_faceDetectObj.workAreaVirtAddr)
    OSA_cmemFree(gDRV_faceDetectObj.workAreaVirtAddr);

  return OSA_EFAIL;  
}
开发者ID:119,项目名称:ipnc,代码行数:25,代码来源:drv_faceDetect.c

示例10: DRV_isifGetBayerPhase

int DRV_isifGetBayerPhase(int sensorMode)
{
	DRV_ImgsIsifConfig  *isifConfig;
	CSL_CcdcColPatConfig *colPat;

	isifConfig= DRV_imgsGetIsifConfig(sensorMode);
	colPat= &isifConfig->ccdcParams.colPat;

	switch(colPat->colPat0[0][0])
	{
		case CSL_CCDC_COL_PAT_Gr:
			return 0;
			break;
		case CSL_CCDC_COL_PAT_R:
			return 1;
			break;
		case CSL_CCDC_COL_PAT_Gb:
			return 2;
			break;
		case CSL_CCDC_COL_PAT_B:
			return 3;
			break;
		default:
			OSA_ERROR("Undefined Bayer format\n");
			return 0;
			break;
	}
}
开发者ID:119,项目名称:ipnc,代码行数:28,代码来源:drv_isif.c

示例11: OSA_semCreate

int OSA_semCreate(OSA_SemHndl *hndl, Uint32 maxCount, Uint32 initVal)
{
  pthread_mutexattr_t mutex_attr;
  pthread_condattr_t cond_attr;
  int status=OSA_SOK;
 
  status |= pthread_mutexattr_init(&mutex_attr);
  status |= pthread_condattr_init(&cond_attr);  
  
  status |= pthread_mutex_init(&hndl->lock, &mutex_attr);
  status |= pthread_cond_init(&hndl->cond, &cond_attr);  

  hndl->count = initVal;
  hndl->maxCount = maxCount;

  if(hndl->maxCount==0)  
    hndl->maxCount=1;
    
  if(hndl->count>hndl->maxCount)
    hndl->count = hndl->maxCount;

  if(status!=OSA_SOK)
    OSA_ERROR("OSA_semCreate() = %d \r\n", status);
    
  pthread_condattr_destroy(&cond_attr);
  pthread_mutexattr_destroy(&mutex_attr);
  
  return status;
}
开发者ID:119,项目名称:ipnc,代码行数:29,代码来源:osa_sem.c

示例12: TVP5158_setNoiseReduction

int TVP5158_setNoiseReduction(DRV_I2cHndl *i2cHndl, int enable, int channel)
{
	int status=OSA_SOK;
	Uint8 regAddr[2];
	Uint8 regVal[2];
	Uint32 k;
	Uint8 chVal=1;	

	chVal = chVal << channel;

	status = TVP5158_selectWrite(i2cHndl, chVal);

	if(status!=OSA_SOK)
    	goto error_exit;  
    
	k=0;	
	regAddr[k] = 0x5D;
	regVal[k]  = (Uint8)enable;
	k++;

  OSA_printf(" TVP5158: NoiseReduction [Ch=%d value=%x]\n", chVal, enable);

 	status = DRV_i2cWrite8(i2cHndl, regAddr, regVal, k);
 	if(status!=OSA_SOK)
   	goto error_exit;	

	OSA_waitMsecs(20); 

error_exit:
 	if(status!=OSA_SOK)
   	OSA_ERROR("I2C-NoiseReduction");	

 	return status;
}
开发者ID:119,项目名称:ipnc,代码行数:34,代码来源:mcvip_tvp5158_i2c.c

示例13: TVP5158_setStdStatus

int TVP5158_setStdStatus(DRV_I2cHndl *i2cHndl)
{
	int status;
	Uint8 regAddr[2];
	Uint8 regVal[2];
  Uint32 k;
  
  status = TVP5158_selectWrite(i2cHndl, 0xF);
  if(status!=OSA_SOK)
    goto error_exit;	
    
	k=0;
	regAddr[k] = 0xD;
	regVal[k] = 0x01;
	k++;
	    
  status = DRV_i2cWrite8(i2cHndl, regAddr, regVal, k);
  if(status!=OSA_SOK)
    goto error_exit;
    	    
error_exit:
  if(status!=OSA_SOK)
    OSA_ERROR("I2C");

  return status;    
}
开发者ID:119,项目名称:ipnc,代码行数:26,代码来源:mcvip_tvp5158_i2c.c

示例14: TVP5158_setHybridChSelect

int TVP5158_setHybridChSelect(DRV_I2cHndl *i2cHndl, int channel)
{
	int status=OSA_SOK;
	Uint8 regAddr[64];
	Uint8 regVal[64];
	Uint32 k;
	
	status = TVP5158_selectWrite(i2cHndl, 0xF);
	if(status!=OSA_SOK)
		goto error_exit;  	
		
	k=0;
	
	regAddr[k] = 0xB5;
	regVal[k]  = (Uint8)channel;
	k++;			
	
	#ifdef TVP5158_DEBUG
	OSA_printf(" TVP5158: HybridChannel [Ch=%d]\n", channel);
	#endif

	status = DRV_i2cWrite8(i2cHndl, regAddr, regVal, k);
	if(status!=OSA_SOK)
		goto error_exit;  
    
	OSA_waitMsecs(20); 

error_exit:
	if(status!=OSA_SOK)
		OSA_ERROR("I2C-HybirdChannel");

	return status;    		
}
开发者ID:119,项目名称:ipnc,代码行数:33,代码来源:mcvip_tvp5158_i2c.c

示例15: DRV_captureTestLscRun

int DRV_captureTestLscRun(int count)
{
  int status;
  int bufId;  
  OSA_BufInfo *pBufInfo;
  
  status = DRV_isifLscGetBuf(&bufId, OSA_TIMEOUT_FOREVER);
  if(status!=OSA_SOK) {
    OSA_ERROR("DRV_isifLscGetBuf()\n");
    return status;
  }
  
  pBufInfo =   DRV_isifLscGetBufInfo(bufId);  
  if(pBufInfo) {
  
    #ifdef DRV_CAPTURE_TEST_SAVE_LSC_DATA
    if(count>1) {
      static char filename[80];    
      
      if(count%(30*10)==0) {
        sprintf(filename, "LSC_%04d_%dx%d.BIN", count, gDRV_testCtrl.captureInfo.isifInfo.lscDataOffsetH, gDRV_testCtrl.captureInfo.isifInfo.lscDataHeight);
        OSA_fileWriteFile(filename, pBufInfo->virtAddr, pBufInfo->size);      
      }
    }
    #endif  
    
    if(count%(30*5)==0) {        

    }
  }
  
  DRV_isifLscPutBuf(bufId);
  
  return status;  
}
开发者ID:119,项目名称:ipnc,代码行数:35,代码来源:drv_captureTest.c


注:本文中的OSA_ERROR函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。