4

I am trying to display video buffers on an android. I am using the media codec API released in Android 4.1 Jelly Bean.

The sample goes like this:

 MediaCodec codec = MediaCodec.createDecoderByType(type);
 codec.configure(format, ...);

configure method accepts 3 other arguments, apart from MediaFormat. I have been able to figure out MediaFormat somehow but I am not sure about the other 3 parameters. (below).

 MediaSurface, MediaCrypto and Flags. 

Any leads?

Also, what should I do with the MediaCrypto argument, if I am not encrypting my video buffers.

Requirements:

1) Decode the buffers on the android device, 
2) Display them on the screen. 
arpwal
  • 895
  • 1
  • 9
  • 17
  • Have a look at the example provided in the answer to my question [here][1]. [1]: http://stackoverflow.com/questions/13418093/mime-type-of-android-camera-previewformat – gleerman Nov 27 '12 at 10:22

2 Answers2

1

You can see the article from here: http://dpsm.wordpress.com/2012/07/28/android-mediacodec-decoded/

Kimi_Jin
  • 21
  • 5
  • 4
    It is usually helpful to include important/useful points from the linked posting in your answer so that your answer actually has some value on its own, particularly if that link stops working. – nbrooks Sep 15 '12 at 11:19
1

Just for completeness:

To decode -

MediaSurface is the surface to render the frame to ( or null if not rendering )

MediaCrypto should be null if the is no encryption

flags == 0 if decoding or MediaCodec.CONFIGURE_FLAG_ENCODE if encoding

Code Rebel
  • 421
  • 4
  • 14