summaryrefslogtreecommitdiffstats
path: root/media/libavextensions
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-12-21 05:15:04 -0500
committerSteve Kondik <steve@cyngn.com>2015-12-21 05:15:04 -0500
commitc68bcccdfec0363d440afc5b85250b8b24c1780e (patch)
tree103780938c735efaabd24c8af0bcb9e65d3ca2dc /media/libavextensions
parentab35ee6f52fb9ad55f01eaf2dc745f7f00863d67 (diff)
downloadframeworks_av-c68bcccdfec0363d440afc5b85250b8b24c1780e.zip
frameworks_av-c68bcccdfec0363d440afc5b85250b8b24c1780e.tar.gz
frameworks_av-c68bcccdfec0363d440afc5b85250b8b24c1780e.tar.bz2
stagefright: Correctly reassemble HVCC data
* Remove bogus code and replace with proper reassembly. Change-Id: I16a84eb94e5535fc2c4044875144f8007852a4d2
Diffstat (limited to 'media/libavextensions')
-rw-r--r--media/libavextensions/stagefright/AVUtils.cpp56
1 files changed, 6 insertions, 50 deletions
diff --git a/media/libavextensions/stagefright/AVUtils.cpp b/media/libavextensions/stagefright/AVUtils.cpp
index db4bc69..35ae36b 100644
--- a/media/libavextensions/stagefright/AVUtils.cpp
+++ b/media/libavextensions/stagefright/AVUtils.cpp
@@ -387,59 +387,15 @@ bool AVUtils::HEVCMuxer::reassembleHEVCCSD(const AString &mime, sp<ABuffer> csd0
if (!isVideoHEVC(mime.c_str())) {
return false;
}
- uint32_t type;
- const void *data;
- size_t size;
- if (meta->findData(kKeyHVCC, &type, &data, &size)) {
- const uint8_t *ptr = (const uint8_t *)data;
-
- CHECK(size >= 7);
- uint8_t profile = ptr[1] & 31;
- uint8_t level = ptr[12];
- ptr += 22;
- size -= 22;
-
-
- size_t numofArrays = (char)ptr[0];
- ptr += 1;
- size -= 1;
- size_t j = 0, i = 0;
-
- csd0->setRange(0, 0);
-
- for (i = 0; i < numofArrays; i++) {
- ptr += 1;
- size -= 1;
+ void *csd = NULL;
+ size_t size = 0;
- //Num of nals
- size_t numofNals = U16_AT(ptr);
-
- ptr += 2;
- size -= 2;
-
- for (j = 0; j < numofNals; j++) {
- CHECK(size >= 2);
- size_t length = U16_AT(ptr);
-
- ptr += 2;
- size -= 2;
-
- if (size < length) {
- return false;
- }
- status_t err = copyNALUToABuffer(&csd0, ptr, length);
- if (err != OK) {
- return false;
- }
-
- ptr += length;
- size -= length;
- }
- }
- csd0->meta()->setInt32("csd", true);
- csd0->meta()->setInt64("timeUs", 0);
+ if (makeHEVCCodecSpecificData(csd0->data(), csd0->size(), &csd, &size) == OK) {
+ meta->setData(kKeyHVCC, kTypeHVCC, csd, size);
+ free(csd);
return true;
}
+ ALOGE("Failed to reassemble HVCC data");
return false;
}