How to register a OMX core for adding a new decoder

白昼怎懂夜的黑 提交于 2019-12-01 10:47:59

If your don't plan to have your own OMX Core, then you can consider adding your codec to the SoftOMXComponent plugin itself as described below.

Note: This answer assumes that you have the ability to recompile a portion of AOSP code and can replace the rebuilt libraries on your platform.

Step 1: Registration of OMX Component

In SoftOMXComponent source file as shown here, add your component name as shown below

{ "OMX.sam.custom.h264.decoder", "sam_h264dec", "video_decoder.avc" }

Here "OMX.sam.custom.h264.decoder" represents your component name, "sam_h264dec" represents the suffix of the name of the library stored in the file system (more below) and "video_decoder.avc" represents the role of your decoder, which in this example is a H.264 video decoder.

Step 2: Generation of library

Your OMX component should be built as a dynamically loadable library whose name would be "libstagefright_soft_sam_h264dec.so" and should be placed at /system/lib of your file system.

Step 3: Creation of the component

The Stagefright framework code will look for a symbol named createSoftOMXComponent to create the component. Hence, your codec library mentioned in Step 2 should support this function.

With these steps and assuming your codec is OMX compatible with Android extensions, you should be able to integrate your decoder.

Tip 1: If you wish that your component is always selected, please ensure that your component name as described in Step 1 is registered at the very top of kComponents array in the shown reference.

Tip 2: If you wish to know more on the topic of generation of the dynamically loadable library, you could refer to the GSM Decoder code as shown here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!