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

Commit b5746d90 authored by Andreas Huber's avatar Andreas Huber
Browse files

Properly forward rotation information from input format to output format.

The software renderer would otherwise never rotate videos as it only has access to
the decoder's output format.

Change-Id: If893c0c23d0e85a3d9d4eb94390a114af5514b1c
parent 2cf9c507
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -4077,10 +4077,10 @@ void OMXCodec::initOutputFormat(const sp<MetaData> &inputFormat) {
                         numChannels, params.nChannels);
                }

                if (sampleRate != params.nSamplingRate) {
                if (sampleRate != (int32_t)params.nSamplingRate) {
                    LOGW("Codec outputs at different sampling rate than "
                         "what the input stream contains (contains data at "
                         "%d Hz, codec outputs %d Hz)",
                         "%d Hz, codec outputs %lu Hz)",
                         sampleRate, params.nSamplingRate);
                }

@@ -4203,6 +4203,14 @@ void OMXCodec::initOutputFormat(const sp<MetaData> &inputFormat) {
            break;
        }
    }

    // If the input format contains rotation information, flag the output
    // format accordingly.

    int32_t rotationDegrees;
    if (mSource->getFormat()->findInt32(kKeyRotation, &rotationDegrees)) {
        mOutputFormat->setInt32(kKeyRotation, rotationDegrees);
    }
}

status_t OMXCodec::pause() {