0

We have integrated some customer decoder with android multimedia framework by writing OMX component.

When we play video usually we have mime type of VIDEO like video/avc. If we have multiple decoder component of same mime type, so where we decided or how in android multimedia framework ?

Can anybody point that particular AOSP code or can explain how this happen ?

Ganesh
  • 5,880
  • 2
  • 36
  • 54
Mohan
  • 1,871
  • 21
  • 34

1 Answers1

1

There has been a related question on this topic where majority of the steps were covered in this answer.

In the parseXML function, the list is populated by going through the media_codecs.xml file and the codecs are listed in the order in which they are listed i.e. first codec in the file will be the first one in the list to be tried, when we have multiple codecs for same MIME type.

In case one wishes to ensure that their custom codec is employed, it should be enlisted as the first codec in the media_codecs.xml for easier integration.

Ganesh
  • 5,880
  • 2
  • 36
  • 54
  • Thanks I got the point , but can you please let me know is there any other way also to achieve, by making some changes in "AOSP" ? – Mohan Aug 16 '17 at 05:14
  • Sorry I didn't get your question. If your custom decoder is HW accelerated, you could use the approach above. If it's based on `SoftOMXComponent`, perhaps you could look at this question also: https://stackoverflow.com/questions/18462175/how-to-register-a-omx-core-for-adding-a-new-decoder/18564275#18564275 – Ganesh Aug 16 '17 at 16:23
  • If we have software decoder then it's priority depends on `kComponents` array and for hardware decoder it depends on media_codec.xml Is it correct ? – Mohan Aug 16 '17 at 16:54
  • One more question why we have actually `kComponents` array and also media_codec.xml file containing same information. – Mohan Aug 16 '17 at 16:57
  • `MediaCodecList` contains the list of *all* available components in the system. This includes the `SoftOMX` components which are typically the SW components. `kComponents` is required by the `SoftOMXPlugin` i.e. the `OMX` core simulation for `SW` components. From a higher layer perspective, everything is an `OMX` component, but the way the components are loaded is different for `HW` and `SW` components. Please refer to `MediaCodecList` :: `findMatchingCodecs` for more details – Ganesh Aug 16 '17 at 23:57