summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHomin Lee <homin.lee@ti.com>2011-03-23 11:49:45 +0900
committerJean Johnson <jean-johnson@ti.com>2011-03-31 18:44:45 -0500
commitb0d5ced80a444d46d87c687db6ddbff51f07ff8e (patch)
tree2fc19fbae296681846807b9a373759ef6997dfee
parente70be32bb7f0ffe2fb3620f14b2b4555e320b356 (diff)
downloadbase-b0d5ced80a444d46d87c687db6ddbff51f07ff8e.tar.gz
OMAP3: added debug parameter for force video rotation
For devices that don't have sensors for detect rotation, added a property, "debug.video.force_rotation" to test encoding rotated video. Given value, 0, 90, 180 or 270 will replace original degrees which MPEG4Writer::writeCompositionMatrix received. If you want turn off this feature set negative value, like -1 to the property. Signed-off-by: Homin Lee <homin.lee@ti.com> Patch Set 3: Simple cherry-pick on current tree. No changes made. Taking approvals, verifications and build test from patch set 2. Signed-off-by: Jean Johnson <jean-johnson@ti.com> Change-Id: Iba140d2eeb594065432d4827612d485b4bbdd21a
-rwxr-xr-xmedia/libstagefright/MPEG4Writer.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index 2ea5f59e1f94..2ed6ec82cbe8 100755
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -34,6 +34,10 @@
#include <media/stagefright/Utils.h>
#include <media/mediarecorder.h>
+#if defined (OMAP_ENHANCEMENT) && defined (TARGET_OMAP3)
+#include <cutils/properties.h>
+#endif
+
#include "include/ESDS.h"
namespace android {
@@ -554,6 +558,18 @@ void MPEG4Writer::writeCompositionMatrix(int degrees) {
uint32_t b = 0;
uint32_t c = 0;
uint32_t d = 0x00010000;
+
+#if defined (OMAP_ENHANCEMENT) && defined (TARGET_OMAP3)
+ char value[PROPERTY_VALUE_MAX];
+ int newDegrees;
+ property_get("debug.video.force_rotation", value, "-1");
+ newDegrees = atoi(value);
+ if (newDegrees > 0) {
+ LOGI("Rotation changed from %d to %d", degrees, newDegrees);
+ degrees = newDegrees;
+ }
+#endif
+
switch (degrees) {
case 0:
break;