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

Commit 9c5aa564 authored by Emilio López's avatar Emilio López
Browse files

stagefright: allow targets to pass real dimensions to the decoder

This changeset adds TARGET_SF_NEEDS_REAL_DIMENSIONS. When set to true,
it will make stagefright pass the real video dimensions to the decoder.
When not set or set to false, it will fallback to the old behaviour,
that is, forcing dimensions to 352x288

This fixes video thumbnailing on zeppelin

Change-Id: I745356de4a0182e048b37318f556ae05c64a6f31
parent 8eb4252f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -47,4 +47,8 @@ LOCAL_C_INCLUDES := \

LOCAL_CFLAGS := -DOSCL_EXPORT_REF= -DOSCL_IMPORT_REF=

ifeq ($(TARGET_SF_NEEDS_REAL_DIMENSIONS),true))
        LOCAL_CFLAGS += -DTARGET_SF_NEEDS_REAL_DIMENSIONS
endif

include $(BUILD_STATIC_LIBRARY)
+5 −3
Original line number Diff line number Diff line
@@ -45,15 +45,17 @@ M4vH263Decoder::M4vH263Decoder(const sp<MediaSource> &source)
    mFormat = new MetaData;
    mFormat->setCString(kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_RAW);

    // CHECK(mSource->getFormat()->findInt32(kKeyWidth, &mWidth));
    // CHECK(mSource->getFormat()->findInt32(kKeyHeight, &mHeight));

#ifdef TARGET_SF_NEEDS_REAL_DIMENSIONS
    CHECK(mSource->getFormat()->findInt32(kKeyWidth, &mWidth));
    CHECK(mSource->getFormat()->findInt32(kKeyHeight, &mHeight));
#else
    // We'll ignore the dimension advertised by the source, the decoder
    // appears to require us to always start with the default dimensions
    // of 352 x 288 to operate correctly and later react to changes in
    // the dimensions as needed.
    mWidth = 352;
    mHeight = 288;
#endif

    mFormat->setInt32(kKeyWidth, mWidth);
    mFormat->setInt32(kKeyHeight, mHeight);