diff options
author | Steve Kondik <steve@cyngn.com> | 2014-11-29 11:43:23 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-10-23 12:38:46 -0500 |
commit | 9641a8e47588357baa0de8b967e809e5cdf1901f (patch) | |
tree | e4283e9a4db01403caf9b66bd554609e23c43c87 /media/libstagefright/matroska | |
parent | cda69c5bcff82e72b085970ba1ef62f41fd7d3ee (diff) | |
download | frameworks_av-9641a8e47588357baa0de8b967e809e5cdf1901f.zip frameworks_av-9641a8e47588357baa0de8b967e809e5cdf1901f.tar.gz frameworks_av-9641a8e47588357baa0de8b967e809e5cdf1901f.tar.bz2 |
stagefright: Support HEVC tracks in Matroska containers
* Pass the HVCC atom to Stagefright.
Change-Id: I7fdca25e20b9051925936a34e594808b18a3a3bd
Diffstat (limited to 'media/libstagefright/matroska')
-rw-r--r-- | media/libstagefright/matroska/MatroskaExtractor.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/media/libstagefright/matroska/MatroskaExtractor.cpp b/media/libstagefright/matroska/MatroskaExtractor.cpp index e6ed900..2143e35 100644 --- a/media/libstagefright/matroska/MatroskaExtractor.cpp +++ b/media/libstagefright/matroska/MatroskaExtractor.cpp @@ -136,6 +136,7 @@ private: enum Type { AVC, AAC, + HEVC, OTHER }; @@ -234,6 +235,18 @@ MatroskaSource::MatroskaSource( mNALSizeLen = 1 + (avcc[4] & 3); ALOGV("mNALSizeLen = %zu", mNALSizeLen); + } else if (!strcasecmp(mime, MEDIA_MIMETYPE_VIDEO_HEVC)) { + mType = HEVC; + + uint32_t type; + const void *data; + size_t size; + CHECK(meta->findData(kKeyHVCC, &type, &data, &size)); + + const uint8_t *ptr = (const uint8_t *)data; + CHECK(size >= 7); + mNALSizeLen = 1 + (ptr[14 + 7] & 3); + ALOGV("mNALSizeLen = %zu", mNALSizeLen); } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC)) { mType = AAC; } @@ -603,7 +616,7 @@ status_t MatroskaSource::read( MediaBuffer *frame = *mPendingFrames.begin(); mPendingFrames.erase(mPendingFrames.begin()); - if (mType != AVC) { + if (mType != AVC && mType != HEVC) { if (targetSampleTimeUs >= 0ll) { frame->meta_data()->setInt64( kKeyTargetTime, targetSampleTimeUs); @@ -1001,6 +1014,10 @@ void MatroskaExtractor::addTracks() { codecID); continue; } + } else if (!strcmp("V_MPEGH/ISO/HEVC", codecID)) { + meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_HEVC); + meta->setData(kKeyHVCC, 0, codecPrivate, codecPrivateSize); + } else if (!strcmp("V_VP8", codecID)) { meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_VP8); } else if (!strcmp("V_VP9", codecID)) { |