summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2014-07-30 17:25:06 -0700
committerChong Zhang <chz@google.com>2014-07-30 18:07:50 -0700
commite9e63bcf6c36351f1129b0bdc5e93f17f0f9f0b4 (patch)
treed48520e1b56036184891f9868fb045d20298d35f /media/libmediaplayerservice/nuplayer
parenta6d28be0be0fa813080a021bd6a5920a8cb4fbb1 (diff)
downloadframeworks_av-e9e63bcf6c36351f1129b0bdc5e93f17f0f9f0b4.zip
frameworks_av-e9e63bcf6c36351f1129b0bdc5e93f17f0f9f0b4.tar.gz
frameworks_av-e9e63bcf6c36351f1129b0bdc5e93f17f0f9f0b4.tar.bz2
handle rotation in NuPlayer
Bug: 16653284 Change-Id: I54165041da5a13498d627eee1b3ec59ef3c923b0
Diffstat (limited to 'media/libmediaplayerservice/nuplayer')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayer.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
index d144af1..adc5f33 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
@@ -860,8 +860,23 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) {
displayWidth, displayHeight);
}
- notifyListener(
- MEDIA_SET_VIDEO_SIZE, displayWidth, displayHeight);
+ int32_t rotationDegrees;
+ if (!videoInputFormat->findInt32(
+ "rotation-degrees", &rotationDegrees)) {
+ rotationDegrees = 0;
+ }
+
+ if (rotationDegrees == 90 || rotationDegrees == 270) {
+ notifyListener(
+ MEDIA_SET_VIDEO_SIZE,
+ displayHeight,
+ displayWidth);
+ } else {
+ notifyListener(
+ MEDIA_SET_VIDEO_SIZE,
+ displayWidth,
+ displayHeight);
+ }
}
} else if (what == Decoder::kWhatShutdownCompleted) {
ALOGV("%s shutdown completed", audio ? "audio" : "video");