summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/Utils.cpp
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-04-10 22:41:56 -0700
committerChong Zhang <chz@google.com>2015-04-14 11:39:16 -0700
commita0d0ba51ad60a68117a0ee78e37ab78715b8a069 (patch)
tree8d7555285a426fd3b77b93fcfd550dc5c1e9f0c2 /media/libstagefright/Utils.cpp
parentdb93079daf06a94e50622d0383b9ed8e767e2f92 (diff)
downloadframeworks_av-a0d0ba51ad60a68117a0ee78e37ab78715b8a069.zip
frameworks_av-a0d0ba51ad60a68117a0ee78e37ab78715b8a069.tar.gz
frameworks_av-a0d0ba51ad60a68117a0ee78e37ab78715b8a069.tar.bz2
HLS: parse stream resolution and set maxWidth/maxHeight
bug: 20160436 Change-Id: Ic3adb84d3c65cc65f62fc509a99d09602db862a1
Diffstat (limited to 'media/libstagefright/Utils.cpp')
-rw-r--r--media/libstagefright/Utils.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/media/libstagefright/Utils.cpp b/media/libstagefright/Utils.cpp
index 8506e37..dfe8ad1 100644
--- a/media/libstagefright/Utils.cpp
+++ b/media/libstagefright/Utils.cpp
@@ -166,6 +166,16 @@ status_t convertMetaDataToMessage(
msg->setInt32("max-input-size", maxInputSize);
}
+ int32_t maxWidth;
+ if (meta->findInt32(kKeyMaxWidth, &maxWidth)) {
+ msg->setInt32("max-width", maxWidth);
+ }
+
+ int32_t maxHeight;
+ if (meta->findInt32(kKeyMaxHeight, &maxHeight)) {
+ msg->setInt32("max-height", maxHeight);
+ }
+
int32_t rotationDegrees;
if (meta->findInt32(kKeyRotation, &rotationDegrees)) {
msg->setInt32("rotation-degrees", rotationDegrees);
@@ -568,6 +578,16 @@ void convertMessageToMetaData(const sp<AMessage> &msg, sp<MetaData> &meta) {
meta->setInt32(kKeyMaxInputSize, maxInputSize);
}
+ int32_t maxWidth;
+ if (msg->findInt32("max-width", &maxWidth)) {
+ meta->setInt32(kKeyMaxWidth, maxWidth);
+ }
+
+ int32_t maxHeight;
+ if (msg->findInt32("max-height", &maxHeight)) {
+ meta->setInt32(kKeyMaxHeight, maxHeight);
+ }
+
// reassemble the csd data into its original form
sp<ABuffer> csd0;
if (msg->findBuffer("csd-0", &csd0)) {