[Android] [RFC] [PATCH] android: Allow enabling the android mediacodec decoder
Martin Storsjö
martin at martin.st
Mon Oct 8 18:08:04 CEST 2012
On Mon, 8 Oct 2012, Jean-Baptiste Kempf wrote:
> On Mon, Oct 08, 2012 at 06:51:07PM +0300, Martin Storsjö wrote :
>> This changes the hw decoding setting into a combo box, just like
>> the audio output. On devices prior to 4.1, you only have the
>> options Off and IOMX there, while you get MediaCodec as an
>> alternative on 4.1. (This is only to not confuse users, the code
>> falls back cleanly if ran on older android versions.)
>>
>> This is useful for being able to switch between the different
>> codepaths, until the MediaCodec code has received wider testing.
>> In practice, the MediaCodec API is a thin wrapper on top of IOMX,
>> so normally the decoders there will have the same quirks, more or
>> less.
>
> Why not propose a mediacodec,all option ?
We probably want to make it mediacodec,iomx,all, so for 4.1 it will pick
mediacodec and use that, for older it will use iomx. That'd be less
confusion for end users. For the case when someone needs to debug it and
needs to check if iomx works better, they can do a custom build.
For reference, since this API is a pretty thin wrapper on top of IOMX,
most of the common issues (interpreting pixel formats correctly etc) are
exactly the same as on IOMX, and that code is shared. Some codec-specific
quirk handling is separate though. The main difference is that we don't
get access to all the OMX structs and the extra details that might be
hidden within them (and we don't get to call extra OMX commands either).
Additionally, the buffer allocation/setup is totally out of our hands with
this API, so there's basically just less risk for errors (as long as the
manufacturers have tested this API - there's no CTS tests for it in the
current 4.1 versions so manufacturers can in principle break it as much as
they want without anybody noticing.)
But in principle, this should work just as well.
// Martin
More information about the Android
mailing list