stagefright的codec---2
最重要的还是openmax的处理,只是看了一天,很多东西还需要再细看一下openmax 的IL层规定了一些接口,openmax分为core和instance,core加载instance,omax instance实现IL接口,提供给openmax框架调用,而omax instance就是特定平台实现自己codec的具体地方。
下面代码是qcom平台的建立自己omx具体方法的地方,omx 具体调用的就是component的方法,而具体的到底是什么方法是在omx il的api中规定好的。
void * qc_omx_create_component_wrapper(OMX_PTR obj_ptr)
{
qc_omx_component *pThis = (qc_omx_component *)obj_ptr;
OMX_COMPONENTTYPE* component = &(pThis->m_cmp);
memset(&pThis->m_cmp,0,sizeof(OMX_COMPONENTTYPE));
component->nSize = sizeof(OMX_COMPONENTTYPE);
component->nVersion.nVersion = OMX_SPEC_VERSION;
component->pApplicationPrivate = 0;
component->pComponentPrivate = obj_ptr;
component->AllocateBuffer = &qc_omx_component_allocate_buffer;
component->FreeBuffer = &qc_omx_component_free_buffer;
component->GetParameter = &qc_omx_component_get_parameter;
component->SetParameter = &qc_omx_component_set_parameter;
component->SendCommand = &qc_omx_component_send_command;
component->FillThisBuffer = &qc_omx_component_fill_this_buffer;
component->EmptyThisBuffer = &qc_omx_component_empty_this_buffer;
component->GetState = &qc_omx_component_get_state;
component->GetComponentVersion = &qc_omx_component_get_version;
component->GetConfig = &qc_omx_component_get_config;
component->SetConfig = &qc_omx_component_set_config;
component->GetExtensionIndex = &qc_omx_component_get_extension_index;
component->ComponentTunnelRequest = &qc_omx_component_tunnel_request;
component->UseBuffer = &qc_omx_component_use_buffer;
component->SetCallbacks = &qc_omx_component_set_callbacks;
component->UseEGLImage = &qc_omx_component_use_EGL_image;
component->ComponentRoleEnum = &qc_omx_component_role_enum;
component->ComponentDeInit = &qc_omx_component_deinit;
return (void *)component;
}
qcom平台会继续调用自己实现的omx方法 www.zzzyk.com
摘自 shcalm的专栏
补充:移动开发 , Android ,