arpwal
arpwal

Reputation: 935

media codec sample implementation in android 4.1

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. 

Upvotes: 4

Views: 7350

Answers (2)

Code Rebel
Code Rebel

Reputation: 423

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

Upvotes: 1

Kimi_Jin
Kimi_Jin

Reputation: 21

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

Upvotes: 1

Related Questions