summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MediaCodec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'media/libstagefright/MediaCodec.cpp')
-rw-r--r--media/libstagefright/MediaCodec.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp
index 09742a4..b444687 100644
--- a/media/libstagefright/MediaCodec.cpp
+++ b/media/libstagefright/MediaCodec.cpp
@@ -247,6 +247,7 @@ MediaCodec::MediaCodec(const sp<ALooper> &looper)
mIsVideo(false),
mVideoWidth(0),
mVideoHeight(0),
+ mRotationDegrees(0),
mDequeueInputTimeoutGeneration(0),
mDequeueInputReplyID(0),
mDequeueOutputTimeoutGeneration(0),
@@ -409,6 +410,9 @@ status_t MediaCodec::configure(
if (mIsVideo) {
format->findInt32("width", &mVideoWidth);
format->findInt32("height", &mVideoHeight);
+ if (!format->findInt32("rotation-degrees", &mRotationDegrees)) {
+ mRotationDegrees = 0;
+ }
}
msg->setMessage("format", format);
@@ -1309,7 +1313,7 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
CHECK(msg->findString("mime", &mime));
if (mime.startsWithIgnoreCase("video/")) {
- mSoftRenderer = new SoftwareRenderer(mSurface);
+ mSoftRenderer = new SoftwareRenderer(mSurface, mRotationDegrees);
}
}