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

Commit 1ca9e2f9 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

Merge "stagefright: update support for omap3 decoders and encoders" into cm-11.0

parents 180512e0 a575c841
Loading
Loading
Loading
Loading
+37 −0
Original line number Original line Diff line number Diff line
@@ -686,6 +686,31 @@ status_t OMXCodec::configureCodec(const sp<MetaData> &meta) {
            CODEC_LOGI(
            CODEC_LOGI(
                    "AVC profile = %u (%s), level = %u",
                    "AVC profile = %u (%s), level = %u",
                    profile, AVCProfileToString(profile), level);
                    profile, AVCProfileToString(profile), level);
#ifdef OMAP_ENHANCEMENT
            int32_t width, height;
            bool success = meta->findInt32(kKeyWidth, &width);
            success = success && meta->findInt32(kKeyHeight, &height);
            CHECK(success);
            if (!strcmp(mComponentName, "OMX.TI.720P.Decoder")
                && (profile == 0x42 /* Baseline */ && level <= 31)
                && (width * height <= 414720 /* 864x480 */)
                && (width <= 864 && height <= 864 ))
            {
                // Though this decoder can handle this profile/level,
                // we prefer to use "OMX.TI.Video.Decoder" for
                // Baseline Profile with level <=31 and sub 720p
                return ERROR_UNSUPPORTED;
            }
            if (!strcmp(mComponentName, "OMX.TI.Video.Decoder")
                && (profile != 0x42 /* Baseline */ || level > 31)) {
                // This stream exceeds the decoder's capabilities. The decoder
                // does not handle this gracefully and would clobber the heap
                // and wreak havoc instead...

                CODEC_LOGE("Profile and/or level exceed the decoder's capabilities.");
                return ERROR_UNSUPPORTED;
            }
#endif
        } else if (meta->findData(kKeyVorbisInfo, &type, &data, &size)) {
        } else if (meta->findData(kKeyVorbisInfo, &type, &data, &size)) {
            addCodecSpecificData(data, size);
            addCodecSpecificData(data, size);


@@ -718,6 +743,18 @@ status_t OMXCodec::configureCodec(const sp<MetaData> &meta) {
    if (mIsEncoder) {
    if (mIsEncoder) {
        CHECK(meta->findInt32(kKeyBitRate, &bitRate));
        CHECK(meta->findInt32(kKeyBitRate, &bitRate));
    }
    }
#ifdef OMAP_ENHANCEMENT
        if (!strcmp(mComponentName, "OMX.TI.Video.encoder")) {
            int32_t width, height;
            bool success = meta->findInt32(kKeyWidth, &width);
            success = success && meta->findInt32(kKeyHeight, &height);
            CHECK(success);
            if (width * height > 414720 /* 864x480 */) {
                // require OMX.TI.720P.Encoder
                return ERROR_UNSUPPORTED;
            }
        }
#endif
    if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_AMR_NB, mMIME)) {
    if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_AMR_NB, mMIME)) {
        setAMRFormat(false /* isWAMR */, bitRate);
        setAMRFormat(false /* isWAMR */, bitRate);
    } else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_AMR_WB, mMIME)) {
    } else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_AMR_WB, mMIME)) {