0

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.

Zachary
  • 127
  • 1
  • 2
  • 15
  • Different android device has different color format after hardware decoding. It is complicated to separate hardware decoding and rendering. So it's a good idea that put these two steps together. Thus you need not to care about the color format. – Zachary Nov 13 '13 at 09:23

2 Answers2

0

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.

  1. Creation of MediaCodec

  2. Providing a surface to the underlying codec for buffer allocation

  3. Queueing an input buffer

  4. Retrieving an available output buffer Here the output buffer is pushed into a queue as shown here

  5. Rendering of the available output buffer after A/V sync

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..

Ganesh
  • 5,880
  • 2
  • 36
  • 54
0

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.

fadden
  • 51,356
  • 5
  • 116
  • 166