本文整理汇总了C++中OMX_COMPONENTTYPE类的典型用法代码示例。如果您正苦于以下问题:C++ OMX_COMPONENTTYPE类的具体用法?C++ OMX_COMPONENTTYPE怎么用?C++ OMX_COMPONENTTYPE使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OMX_COMPONENTTYPE类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OMX_FreeHandle
/** @brief The OMX_FreeHandle standard function
*
* This function executes the BOSA_DestroyComponent of the component loaders
*
* @param hComponent the component handle to be freed
*
* @return The error of the BOSA_DestroyComponent function or OMX_ErrorNone
*/
OSCL_EXPORT_REF OMX_ERRORTYPE OMX_FreeHandle(OMX_HANDLETYPE hComponent)
{
OMX_ERRORTYPE err;
OMX_COMPONENTTYPE *pHandle = (OMX_COMPONENTTYPE *) hComponent;
if (pthread_mutex_lock(&mutex) != 0)
{
return OMX_ErrorUndefined;
}
err = pHandle->ComponentDeInit(pHandle);
dlclose(((ACT_OMX_COMPONENTTYPE*) pHandle)->pModule);
free(pHandle);
if (err == OMX_ErrorNone)
{
// the component has been found and destroyed
if (pthread_mutex_unlock(&mutex) != 0)
{
return OMX_ErrorUndefined;
}
return OMX_ErrorNone;
}
if (pthread_mutex_unlock(&mutex) != 0)
{
return OMX_ErrorUndefined;
}
ALOGV("Out of %s\n", __func__);
return OMX_ErrorComponentNotFound;
}
示例2: vcil_in_fill_this_buffer
void vcil_in_fill_this_buffer(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen)
{
IL_PASS_BUFFER_EXECUTE_T *exe = call;
IL_RESPONSE_HEADER_T *ret = resp;
OMX_COMPONENTTYPE *pComp = exe->reference;
OMX_BUFFERHEADERTYPE *pHeader = exe->bufferHeader.pOutputPortPrivate;
OMX_U8 *pBuffer = pHeader->pBuffer;
OMX_PTR *pAppPrivate = pHeader->pAppPrivate;
OMX_PTR *pPlatformPrivate = pHeader->pPlatformPrivate;
OMX_PTR *pInputPortPrivate = pHeader->pInputPortPrivate;
OMX_PTR *pOutputPortPrivate = pHeader->pOutputPortPrivate;
vc_assert(pHeader);
memcpy(pHeader, &exe->bufferHeader, sizeof(OMX_BUFFERHEADERTYPE));
pHeader->pBuffer = pBuffer;
pHeader->pAppPrivate = pAppPrivate;
pHeader->pPlatformPrivate = pPlatformPrivate;
pHeader->pInputPortPrivate = pInputPortPrivate;
pHeader->pOutputPortPrivate = pOutputPortPrivate;
vc_assert(is_valid_hostside_buffer(pHeader));
*rlen = sizeof(IL_RESPONSE_HEADER_T);
ret->func = IL_FILL_THIS_BUFFER;
ret->err = pComp->FillThisBuffer(pComp, pHeader);
}
示例3: SEC_OMX_ComponentUnload
OMX_ERRORTYPE SEC_OMX_ComponentUnload(SEC_OMX_COMPONENT *sec_component)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
FunctionIn();
if (!sec_component) {
ret = OMX_ErrorBadParameter;
goto EXIT;
}
pOMXComponent = sec_component->pOMXComponent;
if (pOMXComponent != NULL) {
pOMXComponent->ComponentDeInit(pOMXComponent);
SEC_OSAL_Free(pOMXComponent);
sec_component->pOMXComponent = NULL;
}
if (sec_component->libHandle != NULL) {
SEC_OSAL_dlclose(sec_component->libHandle);
sec_component->libHandle = NULL;
}
EXIT:
FunctionOut();
return ret;
}
示例4: Exynos_OMX_ComponentUnload
OMX_ERRORTYPE Exynos_OMX_ComponentUnload(EXYNOS_OMX_COMPONENT *exynos_component)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
FunctionIn();
if (!exynos_component) {
ret = OMX_ErrorBadParameter;
goto EXIT;
}
pOMXComponent = exynos_component->pOMXComponent;
if (pOMXComponent != NULL) {
pOMXComponent->ComponentDeInit(pOMXComponent);
Exynos_OSAL_Free(pOMXComponent);
exynos_component->pOMXComponent = NULL;
}
if (exynos_component->libHandle != NULL) {
Exynos_OSAL_dlclose(exynos_component->libHandle);
exynos_component->libHandle = NULL;
}
EXIT:
FunctionOut();
return ret;
}
开发者ID:Exynos-CyanogenMod,项目名称:android_hardware_samsung_slsi_openmax,代码行数:29,代码来源:Exynos_OMX_Component_Register.c
示例5: vcil_in_free_buffer
void vcil_in_free_buffer(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen)
{
IL_FREE_BUFFER_EXECUTE_T *exe = call;
IL_RESPONSE_HEADER_T *ret = resp;
OMX_COMPONENTTYPE *pComp = exe->reference;
OMX_BUFFERHEADERTYPE *pHeader;
OMX_U8 *buffer;
OMX_PARAM_PORTDEFINITIONTYPE def;
OMX_ERRORTYPE error;
def.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
def.nVersion.nVersion = OMX_VERSION;
def.nPortIndex = exe->port;
error = pComp->GetParameter(pComp, OMX_IndexParamPortDefinition, &def);
vc_assert(error == OMX_ErrorNone);
if (def.eDir == OMX_DirInput)
pHeader = exe->inputPrivate;
else
pHeader = exe->outputPrivate;
buffer = pHeader->pBuffer;
*rlen = sizeof(IL_RESPONSE_HEADER_T);
ret->func = IL_FREE_BUFFER;
ret->err = pComp->FreeBuffer(pComp, exe->port, pHeader);
if (ret->err == OMX_ErrorNone)
vcos_free(buffer);
}
示例6: OMX_ConfigureDynamicPFramesInH264E
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;
}
示例7: vcil_in_set_parameter
void vcil_in_set_parameter(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_PARAMETER;
ret->err = pComp->SetParameter(pComp, exe->index, exe->param);
}
示例8: vcil_in_get_state
void vcil_in_get_state(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen)
{
IL_EXECUTE_HEADER_T *exe = call;
IL_GET_STATE_RESPONSE_T *ret = resp;
OMX_COMPONENTTYPE *pComp = exe->reference;
*rlen = sizeof(IL_GET_STATE_RESPONSE_T);
ret->func = IL_GET_STATE;
ret->err = pComp->GetState(pComp, &ret->state);
}
示例9: vcil_in_get_component_version
void vcil_in_get_component_version(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen)
{
IL_EXECUTE_HEADER_T *exe = call;
IL_GET_VERSION_RESPONSE_T *ret = resp;
OMX_COMPONENTTYPE *pComp = exe->reference;
*rlen = sizeof(IL_GET_VERSION_RESPONSE_T);
ret->func = IL_GET_COMPONENT_VERSION;
ret->err = pComp->GetComponentVersion(pComp, ret->name, &ret->component_version, &ret->spec_version, &ret->uuid);
}
示例10: vcil_in_get_extension_index
void vcil_in_get_extension_index(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen)
{
IL_GET_EXTENSION_EXECUTE_T *exe = call;
IL_GET_EXTENSION_RESPONSE_T *ret = resp;
OMX_COMPONENTTYPE *pComp = exe->reference;
*rlen = sizeof(IL_GET_EXTENSION_RESPONSE_T);
ret->func = IL_GET_EXTENSION_INDEX;
ret->err = pComp->GetExtensionIndex(pComp, exe->name, &ret->index);
}
示例11: SEC_OMX_ComponentLoad
OMX_ERRORTYPE SEC_OMX_ComponentLoad(SEC_OMX_COMPONENT *sec_component)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_HANDLETYPE libHandle;
OMX_COMPONENTTYPE *pOMXComponent;
FunctionIn();
OMX_ERRORTYPE (*SEC_OMX_ComponentInit)(OMX_HANDLETYPE hComponent, OMX_STRING componentName);
libHandle = SEC_OSAL_dlopen((OMX_STRING)sec_component->libName, RTLD_NOW);
if (!libHandle) {
ret = OMX_ErrorInvalidComponentName;
SEC_OSAL_Log(SEC_LOG_ERROR, "OMX_ErrorInvalidComponentName, Line:%d", __LINE__);
goto EXIT;
}
SEC_OMX_ComponentInit = SEC_OSAL_dlsym(libHandle, "SEC_OMX_ComponentInit");
if (!SEC_OMX_ComponentInit) {
SEC_OSAL_dlclose(libHandle);
ret = OMX_ErrorInvalidComponent;
SEC_OSAL_Log(SEC_LOG_ERROR, "OMX_ErrorInvalidComponent, Line:%d", __LINE__);
goto EXIT;
}
pOMXComponent = (OMX_COMPONENTTYPE *)SEC_OSAL_Malloc(sizeof(OMX_COMPONENTTYPE));
INIT_SET_SIZE_VERSION(pOMXComponent, OMX_COMPONENTTYPE);
ret = (*SEC_OMX_ComponentInit)((OMX_HANDLETYPE)pOMXComponent, (OMX_STRING)sec_component->componentName);
if (ret != OMX_ErrorNone) {
SEC_OSAL_Free(pOMXComponent);
SEC_OSAL_dlclose(libHandle);
ret = OMX_ErrorInvalidComponent;
SEC_OSAL_Log(SEC_LOG_ERROR, "OMX_ErrorInvalidComponent, Line:%d", __LINE__);
goto EXIT;
} else {
if (SEC_OMX_ComponentAPICheck(pOMXComponent) != OMX_ErrorNone) {
if (NULL != pOMXComponent->ComponentDeInit)
pOMXComponent->ComponentDeInit(pOMXComponent);
SEC_OSAL_Free(pOMXComponent);
SEC_OSAL_dlclose(libHandle);
ret = OMX_ErrorInvalidComponent;
SEC_OSAL_Log(SEC_LOG_ERROR, "OMX_ErrorInvalidComponent, Line:%d", __LINE__);
goto EXIT;
}
sec_component->libHandle = libHandle;
sec_component->pOMXComponent = pOMXComponent;
ret = OMX_ErrorNone;
}
EXIT:
FunctionOut();
return ret;
}
示例12: OMX_FreeHandle
/******************************Public*Routine******************************\
* OMX_FreeHandle()
*
* Description:This method will unload the OMX component pointed by
* OMX_HANDLETYPE. It is the responsibility of the calling method to ensure that
* the Deinit method of the component has been called prior to unloading component
*
* Parameters:
* @param[in] hComponent the component to unload
*
* Returns: OMX_NOERROR Successful
*
* Note
*
\**************************************************************************/
OMX_ERRORTYPE OMX_FreeHandle(OMX_HANDLETYPE hComponent)
{
OMX_ERRORTYPE eError = OMX_ErrorUndefined;
OMX_COMPONENTTYPE *pHandle = (OMX_COMPONENTTYPE *) hComponent;
int i;
if (pthread_mutex_lock(&mutex) != 0)
{
TIMM_OSAL_Error("Core: Error in Mutex lock");
}
CORE_require(pHandle != NULL, OMX_ErrorBadParameter, NULL);
CORE_require(count > 0, OMX_ErrorUndefined,
"OMX_FreeHandle called without calling OMX_Init first");
/* Locate the component handle in the array of handles */
for (i = 0; i < COUNTOF(pModules); i++)
{
if (pComponents[i] == hComponent)
break;
}
CORE_assert(i != COUNTOF(pModules), OMX_ErrorBadParameter, NULL);
eError = pHandle->ComponentDeInit(hComponent);
if (eError != OMX_ErrorNone)
{
TIMM_OSAL_Error("Error From ComponentDeInit..");
}
/* release the component and the component handle */
dlclose(pModules[i]);
pModules[i] = NULL;
free(pComponents[i]);
pComponents[i] = NULL;
eError = OMX_ErrorNone;
EXIT:
/* The unload is now complete, so set the error code to pass and exit */
if (pthread_mutex_unlock(&mutex) != 0)
{
TIMM_OSAL_Error("Core: Error in Mutex unlock");
}
return eError;
}
示例13: load_component
OMX_ERRORTYPE load_component(HTEST *hTest, OMX_U32 idx)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *hComponent = NULL;
OMX_COMPONENTINITTYPE pInit = NULL;
OMX_STRING cError;
hTest->pLibHandle[idx] = dlopen(hTest->lib_name[idx], RTLD_NOW);
if(hTest->pLibHandle[idx] == NULL)
{
cError = dlerror();
printf("%s\n", cError);
return OMX_ErrorInvalidComponentName;
}
pInit = (OMX_COMPONENTINITTYPE)dlsym(hTest->pLibHandle[idx], hTest->itf_name[idx]);
if(pInit == NULL)
{
cError = dlerror();
printf("%s\n", cError);
return OMX_ErrorInvalidComponent;
}
hComponent = (OMX_COMPONENTTYPE*)fsl_osal_malloc_new(sizeof(OMX_COMPONENTTYPE));
if(hComponent == NULL)
{
printf("Failed to allocate memory for hComponent.\n");
return OMX_ErrorInsufficientResources;
}
OMX_INIT_STRUCT(hComponent, OMX_COMPONENTTYPE);
ret = pInit((OMX_HANDLETYPE)(hComponent));
if(ret != OMX_ErrorNone)
{
printf("Load component failed.\n");
return OMX_ErrorInvalidComponentName;
}
hComponent->SetCallbacks(hComponent, &gCallBacks, hTest);
hTest->component[idx].hComponent = hComponent;
return OMX_ErrorNone;
}
示例14: vcil_in_use_buffer
void vcil_in_use_buffer(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen)
{
IL_ADD_BUFFER_EXECUTE_T *exe = call;
IL_ADD_BUFFER_RESPONSE_T *ret = resp;
OMX_COMPONENTTYPE *pComp = exe->reference;
OMX_U8 *buffer;
OMX_BUFFERHEADERTYPE *bufferHeader;
*rlen = sizeof(IL_ADD_BUFFER_RESPONSE_T);
buffer = vcos_malloc_aligned(exe->size, 32, "vcin mapping buffer"); // 32-byte aligned
if (!buffer)
{
ret->err = OMX_ErrorInsufficientResources;
return;
}
//OMX_OSAL_Trace(OMX_OSAL_TRACE_COMPONENT, "hostcomp: use buffer(%p)\n", buffer);
ret->func = IL_USE_BUFFER;
ret->err = pComp->UseBuffer(pComp, &bufferHeader, exe->port, exe->bufferReference, exe->size, buffer);
if (ret->err == OMX_ErrorNone)
{
// we're going to pass this buffer to VC
// initialise our private field in their copy with the host buffer reference
OMX_PARAM_PORTDEFINITIONTYPE def;
OMX_ERRORTYPE error;
def.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
def.nVersion.nVersion = OMX_VERSION;
def.nPortIndex = exe->port;
error = pComp->GetParameter(pComp, OMX_IndexParamPortDefinition, &def);
vc_assert(error == OMX_ErrorNone);
ret->reference = bufferHeader;
memcpy(&ret->bufferHeader, bufferHeader, sizeof(OMX_BUFFERHEADERTYPE));
if (def.eDir == OMX_DirInput)
ret->bufferHeader.pInputPortPrivate = bufferHeader;
else
ret->bufferHeader.pOutputPortPrivate = bufferHeader;
}
else
vcos_free(buffer);
}
示例15: vcil_in_empty_this_buffer
void vcil_in_empty_this_buffer(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen)
{
IL_RESPONSE_HEADER_T *ret = resp;
OMX_COMPONENTTYPE *pComp;
OMX_BUFFERHEADERTYPE *pHeader;
pHeader = ilcs_receive_buffer(st->ilcs, call, clen, &pComp);
*rlen = sizeof(IL_RESPONSE_HEADER_T);
ret->func = IL_EMPTY_THIS_BUFFER;
if(pHeader)
{
vc_assert(is_valid_hostside_buffer(pHeader));
ret->err = pComp->EmptyThisBuffer(pComp, pHeader);
}
else
ret->err = OMX_ErrorHardware;
}