In this post I use H.264as an example, but the solution can be extended to support other types of codecs MPEG-4, VC-1, VP8etc. There are 2 possible solutions to solve your problem, which I give below, each with its pros and cons, to help you make an informed decision.
Solution 1. Codec extension to support the new mode
JellyBean OMX MIME, , : OMX.ABC.XYZ OMX.ABC.XYZ.secure. . , , .. MediaExtractor . OMXCodec::Create findMatchingCodecs , , .secure .
:
, OMX.H264.DECODER.decrypt - . media_codecs.xml. , factory factory - .
, , , kKeyDecryptionRequired. Metadata.h quirk OMXCodec.h.
OMXCodec::Create, .decrypt, .secure, .
OMXCodec, Metadata, MediaExtractor libstagefright.so .
Voila!! . . .decrypt.
, , , .decrypt , decryption OMX_EmptyThisBuffer, .
: , Android, , MIME.
: , , , .decrypt. Google , / .
2: MIME
, MIME , , , .
:
MIME MediaDefs, . , MIME const char *MEDIA_MIMETYPE_VIDEO_AVC_ENCRYPT = "video/avc-encrypt";
MIME media_codecs.xml. , , .
OMXCodec::setVideoOutputFormat MIME, H.264 . , OMXCodec MIME.
MediaExtractor MIME video, . .
: ? , , , OMX_EmptyThisBuffer.
: , .
: -, . MIME Stagefright. , OMXCodec MediaExtractor. , MP4, , AVI, MKV, MIME ,
, .