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

Commit 6597c00f authored by Lajos Molnar's avatar Lajos Molnar
Browse files

stagefright: add (temporary) support for automatic video frc

Use MediaFormat.setInteger("auto-frc", 1) to turn this feature on.
If supported, this feature will show up in codec.getOutputFormat().getInteger("auto-frc")
Otherwise, this key will not be present.

Bug: 17383204
Change-Id: I03549b3ede4de156e9e2d81b3883010360bb42ae
parent 18899808
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -1268,6 +1268,24 @@ status_t ACodec::configureCodec(
                static_cast<NativeWindowWrapper *>(obj.get()));
        sp<ANativeWindow> nativeWindow = windowWrapper->getNativeWindow();

        // START of temporary support for automatic FRC - THIS WILL BE REMOVED
        int32_t autoFrc;
        if (msg->findInt32("auto-frc", &autoFrc)) {
            bool enabled = autoFrc;
            OMX_CONFIG_BOOLEANTYPE config;
            InitOMXParams(&config);
            config.bEnabled = (OMX_BOOL)enabled;
            status_t temp = mOMX->setConfig(
                    mNode, (OMX_INDEXTYPE)OMX_IndexConfigAutoFramerateConversion,
                    &config, sizeof(config));
            if (temp == OK) {
                outputFormat->setInt32("auto-frc", enabled);
            } else if (enabled) {
                ALOGI("codec does not support requested auto-frc (err %d)", temp);
            }
        }
        // END of temporary support for automatic FRC

        int32_t tunneled;
        if (msg->findInt32("feature-tunneled-playback", &tunneled) &&
            tunneled != 0) {