2

I have a new task of integrating a decoder(HEVC) from FFMPEG to Android's Stagefright. To do this, i first need to created an OMX component, My next thing is to register my codec in media_codecs.xml and then the OMX component registration in OMXCore.

Is there any guide or steps to create an OMX component for a video decoder? Secondly, this decoder plays only elementary streams (.bin or .h265 files) so there is no container format here.

Can anyone provide some steps or guidelines to be followed while creating the OMX component for a video codec. Any sort of pointers will be really helpful to me.

Thanks in advance.

Ganesh
  • 5,880
  • 2
  • 36
  • 54
Zax
  • 2,870
  • 7
  • 52
  • 76

1 Answers1

2

In general, you could follow the steps pointed in this question for integrating a decoder into OMX Core.

HEVC is not yet part of the OMX IL specification. Hence, you would have to introduce a new role like video_decoder.hevc for your component while registering in media_codecs.xml. Please do check that your OMX core can support this new role.

If you are trying to play only elementary streams, you can consider modifying the stagefright command line utility to read the elementary stream data and feed the decoder.

Another option is to modify the current recordVideo utility to read a frame data and create a decoder instead of the encoder. With these, I presume you should be able to play your decoder from command line.

EDIT: If you wish to build a new OMX component, I would recommend that you could refer to the Bellagio Component Writers Guide which should give good information on how to build an OMX component. This gives a pretty comprehensive guide to build a new component. Please do ensure that you are able to identify the dependencies with the Bellagio implementation and your core implementation.

Also, you could look at other public domain OMX implementations as here: http://androidxref.com/4.4.2_r1/xref/hardware/ti/omap4xxx/domx/ http://androidxref.com/4.4.2_r1/xref/hardware/qcom/media/mm-video-v4l2/vidc/

I feel Bellagio could work as a good starting reference if you haven't build an OMX component earlier. The sources for Bellagio are available on Sourceforge.

Community
  • 1
  • 1
Ganesh
  • 5,880
  • 2
  • 36
  • 54
  • thanks for the answer. I have two queries, One is the steps given in above link is for registration of an omx component or developing an omx component? Second, I think i can use the stagefright command line utility, but integration in that way, will it play a video from the gallery? – Zax Feb 21 '14 at 04:18
  • 1
    @Zax.. The steps described is for the registration and integration of the `OMX` component. I presume you already have an `OMX` component and hence, I am not answering the same. If you want to play your video straight out of gallery, then a lot of changes would be required as your input is just an elementary stream. You will have to create a `MediaExtractor` specifically for this file which will have to be integrated and registered.. there is a lot of stuff to be done if you want to make the file playable from gallery.. – Ganesh Feb 21 '14 at 04:47
  • Thanks for the explanation. The media extractor i think i can use the hevc_parser in ffmpeg. No, i dont have an OMX component. Actually that is only the question all about "Creating an OMX component for a video decoder" Especially the one which is not yet supported. Please provide some pointers regarding this. – Zax Feb 21 '14 at 05:21
  • @Zax.. are you familiar with the `OMX` IL specification? The question has a wide range for which I would like to fine tune my answer. If required, we can even chat on `SO` to discuss. – Ganesh Feb 21 '14 at 05:34
  • OMX IL specification is a huge thing. I'm aware of only the overview of it. http://old.siggraph.org/publications/2006cn/course16/OpenMAX.pdf and somw more docs i have read – Zax Feb 21 '14 at 05:44
  • @Zax.. Please check the updated answer. I think this should help to answer your query now?? – Ganesh Feb 21 '14 at 06:21
  • 1
    thanks for the material. I'll get back to u in case i have any queries after reading the component developers guide – Zax Feb 21 '14 at 06:35