Implementing an example media codec in android 4.1

I am trying to display video buffers on Android. I am using the Media Codec API released in Android 4.1 by Jelly Bean.

The sample looks something like this:

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

The configure method takes 3 more arguments besides MediaFormat. I managed to somehow determine MediaFormat, but I'm not sure about the other three parameters. (below).

  MediaSurface, MediaCrypto and Flags. 

Any news?

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

Requirements:

 1) Decode the buffers on the android device, 2) Display them on the screen. 
+4
source share
2 answers

For completeness only:

To decode -

MediaSurface is a surface for rendering a frame (or null, if not rendering)

MediaCrypto should be null if it is not encryption

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

+1
source

All Articles