OMX plug-in分析

OMX core & OMX component

Methods

•OMX core methods
The OpenMAX Specification lists the following 9 methods that belong to the OMX core. All of the methods must be present in the library
1)OMX_Init
2)OMX_Deinit
3)OMX_GetHandle
4)OMX_FreeHandle
5)OMX_ComponentNameEnum
6)OMX_GetComponentsOfRole
7)OMX_GetRolesOfComponent
8)OMX_SetupTunnel
9)OMX_GetContentPipe
•multiple OMX cores? (codecs_v2/omx/omx_mastercore/...)
1)OMX_MasterInit
2)OMX_MasterDeinit
3)OMX_MasterGetHandle
4)OMX_...FreeHandle
5)OMX_...ComponentNameEnum
6)OMX_...GetComponentsOfRole
7)OMX_...GetRolesOfComponent
8)OMX_...SetupTunnel
9)OMX_...GetContentPipe
NOTE:The implementation of the config parser API in an OMX core plugin library is optional,
however – it is strongly recommended. ( OMXConfigParser)

The OMX core library wrapper

•Method 1(Pre-built):
–The code for the OMX core wrapper interface template for this case is provided in:
•.../codecs_v2/omx/omx_core_plugins/template/src
–Modification :
•#define OMX_CORE_LIBRAY “ “lib_prebuilt_omxcore_no_wrapper.so”
–The template code needs to be copied to an appropriate place in the directory structure of vendor‘s code that will enable the creation of “lib_omxcore_plus_wrapper.so”(NOTE:it will load .so once)
•Method 2(simultaneously):
–The code for the OMX core wrapper interface for this case is provided in:
•.../codecs_v2/omx/omx_sharedlibrary/interface/src
–This code needs to be copied to an appropriate place in the directory structure of vendor's code that will enable the creation of “lib_omxcore_and_simultaneous_wrapper.so”

Dynamic loading and registration of OMX cores

•Configuration file MUST have an extension “.cfg” and needs to be placed in “/system/etc” Android device directory.
–(0xa054369c,0x22c5,0x412e,0x19,0x17,0x87,0x4c,0x1a,0x19,0xd4,0x5f), "libomx_ core_vendorXYZ.so“
NOTE: The OsclUuid provided is the unique API ID that identifies theOMX core interface and cannot be modified:

How to load Vender’s OMX .so

•/system/etc/01_qcomm_omx.cfg中UUID,”libqcom_omx.so”
•Libqcom_omx.so是封装过的,会加载libOMXcore.so,见Method 1。
•在Qc_omx_core.c中OMX_GetHandle()中
–omx_core_load_cmp_library()
•extern omx_core_cb_type core[]; //按照index动态加载,加载后component_init实例化dec或enc对象,初始化OMX接口。
–在Qc_registry_table.c中注册omx_core_cb_type core[];
•our project:
–Video部分(method 2): …vendor/qcom/opensource/omx/mm-video/…
–libOmxVdec.so 所有集成到一个so中
–libOmxVenc.so
–Audio部分(method 1):…external/opencore/codecs_v2/audio….先生成静态库,之后做封装
–libOmxMp3Dec.so
–libOmxMp3Enc.so
–libOmxAacDec.so
–libOmxAacEnc.so

•Two major components of the video decoder

–OMX core library
•Exposes the top-level interface for the application to use the video decoder and encoder
•Built as a dynamic library (.so) (for example:libomx_ core_vendorXYZ.so)
–Decoder/Encoder library
•Built as dynamic library, responsible for interfacing with kernel driver, and implements all OMX decoder component interfaces (for example:libOmxMp3Dec.so libOmxMp3Enc.so libOmxAacDec.so libOmxAacEnc.so etc.)
•Source code path
–User space
•<root>\vendor\qcom-opensource\omx\mm-video\vidc\vdec
•<root>\vendor\qcom-opensource\omx\mm-video\vidc\venc
–Kernel driver
•<root>\kernel\drivers\video\msm\vidc\1080p (for DDL / Resource Tracker / Firmware Manager)
•<root>\kernel\drivers\video\msm\vidc\common (for VCD only)
 
TIPS:
1.Video codec interface is same to Audio codec in SW side
2.HD codec interface is VIDC_IO_OUT(REG_965480, xxxx); VIDC_IO_OUT(REG_639999, xxxx); ......
Directly programmed by APPS,no DSP/Modem interface required

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值