diff options
author | Andreas Huber <andih@google.com> | 2011-05-18 09:31:22 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2011-05-18 09:31:22 -0700 |
commit | b5746d9058c3e81a195f82f5345e1ffe0a26c0b2 (patch) | |
tree | 219b16daf4ad813172b23b0beffbb2bf1fd8b587 /media | |
parent | 2cf9c5073ca3342ee52673ad68763fadd2c2be79 (diff) | |
download | frameworks_av-b5746d9058c3e81a195f82f5345e1ffe0a26c0b2.zip frameworks_av-b5746d9058c3e81a195f82f5345e1ffe0a26c0b2.tar.gz frameworks_av-b5746d9058c3e81a195f82f5345e1ffe0a26c0b2.tar.bz2 |
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
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/OMXCodec.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index cd5bdfb..0f0ffd4 100644 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -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() { |