Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07b2fbfb authored by Lajos Molnar's avatar Lajos Molnar
Browse files

stagefright: get profile/level from codec-specific-data

- also fix HEVC minimum input buffer size in MP4 extractor

Bug: 28671284
Change-Id: I06d06b9fa0da753333092da16203bdd48d562b0f
parent b2379ba0
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -1566,8 +1566,9 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {


                const char *mime;
                const char *mime;
                CHECK(mLastTrack->meta->findCString(kKeyMIMEType, &mime));
                CHECK(mLastTrack->meta->findCString(kKeyMIMEType, &mime));
                if (!strcmp(mime, MEDIA_MIMETYPE_VIDEO_AVC)) {
                if (!strcmp(mime, MEDIA_MIMETYPE_VIDEO_AVC)
                    // AVC requires compression ratio of at least 2, and uses
                        || !strcmp(mime, MEDIA_MIMETYPE_VIDEO_HEVC)) {
                    // AVC & HEVC requires compression ratio of at least 2, and uses
                    // macroblocks
                    // macroblocks
                    max_size = ((width + 15) / 16) * ((height + 15) / 16) * 192;
                    max_size = ((width + 15) / 16) * ((height + 15) / 16) * 192;
                } else {
                } else {
+1 −0
Original line number Original line Diff line number Diff line
@@ -1957,6 +1957,7 @@ const uint8_t *MPEG4Writer::Track::parseParamSet(
            if (mProfileIdc != data[1] ||
            if (mProfileIdc != data[1] ||
                mProfileCompatible != data[2] ||
                mProfileCompatible != data[2] ||
                mLevelIdc != data[3]) {
                mLevelIdc != data[3]) {
                // COULD DO: set profile/level to the lowest required to support all SPSs
                ALOGE("Inconsistent profile/level found in seq parameter sets");
                ALOGE("Inconsistent profile/level found in seq parameter sets");
                return NULL;
                return NULL;
            }
            }
+437 −5

File changed.

Preview size limit exceeded, changes collapsed.