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


C++ OMX_COMPONENTTYPE::SetConfig方法代码示例

本文整理汇总了C++中OMX_COMPONENTTYPE::SetConfig方法的典型用法代码示例。如果您正苦于以下问题:C++ OMX_COMPONENTTYPE::SetConfig方法的具体用法?C++ OMX_COMPONENTTYPE::SetConfig怎么用?C++ OMX_COMPONENTTYPE::SetConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OMX_COMPONENTTYPE的用法示例。


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

示例1:

static OMX_ERRORTYPE OMX_ConfigureDynamicPFramesInH264E( OMX_HANDLETYPE hComponent,
	OMX_BUFFERHEADERTYPE * pBufferHdr,  OMX_U32 nCurrentFrameRate,  OMX_U32 nTargetFrameRate)
{
	OMX_ERRORTYPE eError = OMX_ErrorNone;
	OMX_U32 remainder = 0;
	OMX_U16 nTargetPFrames =0; /* Target Pframes to be provided to Encoder */
	OMX_U16 nCurrentPFrames = 0; /* Current pFrame Value configured to  Encoder */
	OMX_VIDEO_CONFIG_AVCINTRAPERIOD tPframeH264e;
	OMX_VIDEO_PARAM_AVCTYPE h264type;
	OMX_COMPONENTTYPE *pHandle;
	if (hComponent == NULL){
		DOMX_ERROR("Component is invalid/ not present ");
		return OMX_ErrorBadParameter;
	}
	pHandle = (OMX_COMPONENTTYPE *) hComponent;

	/* Initialise the OMX structures */
	OMX_INIT_STRUCT(tPframeH264e, OMX_VIDEO_CONFIG_AVCINTRAPERIOD);
	OMX_INIT_STRUCT(h264type,OMX_VIDEO_PARAM_AVCTYPE);

	/* Read number of B Frames if not read yet */
	if(!nBFrames){
		h264type.nPortIndex = 1;
		eError = pHandle->GetParameter(hComponent,OMX_IndexParamVideoAvc,&h264type);
		if(eError != OMX_ErrorNone) {
			DOMX_ERROR(" Error while reading component info = %d",eError);
			return eError;
		}
		nBFrames = h264type.nBFrames;
	}

	/* Read Current pFrames set in Encoder */
	tPframeH264e.nPortIndex = 1;
	eError = pHandle->GetConfig(hComponent,OMX_IndexConfigVideoAVCIntraPeriod,&tPframeH264e);
	if(eError != OMX_ErrorNone) {
		DOMX_ERROR(" Error while Getting PFrame info, Error code = %d",eError);
		return eError;
	}
	nCurrentPFrames = tPframeH264e.nPFrames;

	/* Calculate Target P Frames */
	nTargetPFrames = (nCurrentPFrames * nTargetFrameRate) /nCurrentFrameRate;
	/* Number of pFrames should be multiple of (B FRAMES + 1) */
	remainder = nTargetPFrames % (nBFrames + 1);
	nTargetPFrames = nTargetPFrames - remainder;
	if(nTargetPFrames == nCurrentPFrames){
		DOMX_INFO(" No Change in P Frames, No Update required");
		return OMX_ErrorNone;
	}

	/* Update the new PFrames to the Encoder */
	tPframeH264e.nPFrames = nTargetPFrames;
	eError = pHandle->SetConfig(hComponent,OMX_IndexConfigVideoAVCIntraPeriod,&tPframeH264e);
	if(eError != OMX_ErrorNone) {
		DOMX_ERROR(" Error while setting PFrame info, Error code = %d",eError);
	}
	return eError;
}
开发者ID:ioz9,项目名称:lewa_code_hardware,代码行数:58,代码来源:android_omx_proxy_enc.c

示例2: vcil_in_set_config

void vcil_in_set_config(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen)
{
    IL_SET_EXECUTE_T *exe = call;
    IL_RESPONSE_HEADER_T *ret = resp;
    OMX_COMPONENTTYPE *pComp  = exe->reference;

    *rlen = sizeof(IL_RESPONSE_HEADER_T);
    ret->func = IL_SET_CONFIG;
    ret->err = pComp->SetConfig(pComp, exe->index, exe->param);
}
开发者ID:cgjones,项目名称:brcm_usrlib_dag,代码行数:10,代码来源:vcilcs_in.c

示例3: FunctionIn

OMX_ERRORTYPE SEC_MFC_H264Enc_SetConfig(
    OMX_HANDLETYPE hComponent,
    OMX_INDEXTYPE nIndex,
    OMX_PTR pComponentConfigStructure)
{
    OMX_ERRORTYPE          ret = OMX_ErrorNone;
    OMX_COMPONENTTYPE     *pOMXComponent = NULL;
    SEC_OMX_BASECOMPONENT *pSECComponent = NULL;

    FunctionIn();

    if (hComponent == NULL || pComponentConfigStructure == NULL) {
        ret = OMX_ErrorBadParameter;
        goto EXIT;
    }
    pOMXComponent = (OMX_COMPONENTTYPE *)hComponent;
    ret = SEC_OMX_Check_SizeVersion(pOMXComponent, sizeof(OMX_COMPONENTTYPE));
    if (ret != OMX_ErrorNone) {
        goto EXIT;
    }
    if (pOMXComponent->pComponentPrivate == NULL) {
        ret = OMX_ErrorBadParameter;
        goto EXIT;
    }

    pSECComponent = (SEC_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
    if (pSECComponent->currentState == OMX_StateInvalid) {
        ret = OMX_ErrorInvalidState;
        goto EXIT;
    }

    switch (nIndex) {
    default:
        ret = pOMXComponent->SetConfig(hComponent, nIndex, pComponentConfigStructure);
        break;
    }

EXIT:
    FunctionOut();

    return ret;
}
开发者ID:venkatkamesh,项目名称:VideoDecoders-p350-ics,代码行数:42,代码来源:SEC_OMX_H264enc.c


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