Are there a constant color format for hardware decoding or each different android device has its own color format?
I want to get the raw data which result from hardware decoding and render it myself.
Thanks.
Are there a constant color format for hardware decoding or each different android device has its own color format?
I want to get the raw data which result from hardware decoding and render it myself.
Thanks.
In case of different android
devices, every vendor usually implements one of the standard color formats
or a SoC
specific format which will be well-tuned with the rest of the processing pipeline.
From JellyBean
, android
exposes a new class of objects called MediaCodec
which provides the flexibility to a developer to create an instance of a codec
as a standalone component. For your requirement, I feel MediaCodec
is a right candidate. Some useful references are captured below that could help you achieve your objective.
Providing a surface
to the underlying codec for buffer
allocation
Retrieving an available output buffer Here the output buffer is pushed into a queue as shown here
If you wish to introduce any specific processing on the output of a video decoder, you could do so between steps 4 and 5 above or handle it as part of the SurfaceTexture
/ Surface
which is given to the decoder
. Hope this helps..
Take a look at the buffer-to-buffer tests in the CTS EncodeDecodeTest source. It demonstrates how to access the various known decoder formats.
Note there are "unknown" decoder formats; in particular, a number of popular devices will decode to an unpublished tiled format (which the CTS test currently gives a free pass to).
It's usually easier (and certainly much faster) to decode to a Surface and render that.