Fixes GTS crash on Nexus 10.
When the video packets are clear, they are being combined into a full frame between MediaExtractor or DecryptCallback (where packets are never > 64k) and MediaCrypto/DecryptVideo (where we are seeing clear packets > 64k). The max block size to be passed to DecryptVideo is specified as 64K, handling of packets larger than 64K is undefined and OEM implementation-dependent. In the Nexus 10 case, it generates a SEG. fault. Solution: Add mClearSizes vector to keep track of each clear packet size for android_media_MediaExtractor_getSampleCryptoInfo() to process. In android_media_MediaExtractor_getSampleCryptoInfo(), if it does not see kKeyEncryptedSizes meta data, it will not process the clear vector that contains the actual packet sizes. Add a kKeyEncryptedSizes meta data that contains a zero length size packet to trick the JNI code to process the clear packets. related-to-bug: 9261447 Change-Id: Ib0b655a95e099856babaf649f4a95fc7f9c17d41
This commit is contained in:
@@ -42,6 +42,7 @@ public:
|
||||
virtual status_t read(MediaBuffer **buffer, const ReadOptions *options = NULL);
|
||||
|
||||
void addEncryptedSize(size_t size) { mEncryptedSizes.push_back(size); }
|
||||
void addClearSize(size_t size) { mClearSizes.push_back(size); }
|
||||
|
||||
static int sLastError;
|
||||
|
||||
@@ -103,6 +104,7 @@ private:
|
||||
sp<ClientContext> mClientContext;
|
||||
|
||||
Vector<size_t> mEncryptedSizes;
|
||||
Vector<size_t> mClearSizes;
|
||||
char mCryptoPluginKey[kCryptoBlockSize];
|
||||
|
||||
void allocBufferGroup();
|
||||
|
||||
Reference in New Issue
Block a user