media: add support for 160-byte image info in MediaCodec

Some 64-bit compilers now create 160-byte image structures.

Bug: 18513091
Change-Id: I355714affaac0fde0b03578d13ab8f373dd5aa81
This commit is contained in:
Lajos Molnar
2014-11-24 21:52:14 -08:00
parent d234dc1f20
commit cea639cf3f

View File

@@ -1788,11 +1788,11 @@ final public class MediaCodec {
mYOffset = yOffset;
mInfo = info;
// read media-info. the size of media info can be 80 or 156 depending on
// read media-info. the size of media info can be 80 or 156/160 depending on
// whether it was created on a 32- or 64-bit process. See MediaImage
if (info.remaining() == 80 || info.remaining() == 156) {
boolean sizeIsLong = info.remaining() == 156;
int type = info.getInt();
if (info.remaining() == 80 || info.remaining() == 156 || info.remaining() == 160) {
boolean sizeIsLong = info.remaining() != 80;
int type = readInt(info, info.remaining() == 160);
if (type != TYPE_YUV) {
throw new UnsupportedOperationException("unsupported type: " + type);
}