handle rotation in NuPlayer
Bug: 16653284
Change-Id: I54165041da5a13498d627eee1b3ec59ef3c923b0
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 @@
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");