2012-08-24 42 views
4

我想在android上顯示視頻緩衝區。我正在使用Android 4.1 Jelly Bean中發佈的媒體編解碼器API。在Android 4.1媒體編解碼器示例實現

樣品是這樣的:

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

配置方法接受其他3個參數,除了MediaFormat。我已經能夠找出MediaFormat,但我不確定其他3個參數。 (下面)。

MediaSurface, MediaCrypto and Flags. 

任何導致?

另外,如果我不加密我的視頻緩衝區,應該如何處理MediaCrypto參數。

要求:

1) Decode the buffers on the android device, 
2) Display them on the screen. 
+0

看一看在提供回答我的問題的例子[這裏] [1]。 [1]:http://stackoverflow.com/questions/13418093/mime-type-of-android-camera-previewformat – gleerman

回答

1

只是爲了完整性:

爲了解碼 -

MediaSurface是呈現表面幀(如果沒有渲染,則返回null)

MediaCrypto爲空,如果是沒有加密

標誌 == 0如果要是編碼解碼或MediaCodec.CONFIGURE_FLAG_ENCODE

+0

如何獲得加密方案UUID? – Zyoo

相關問題