summaryrefslogtreecommitdiffstats
path: root/cmds/stagefright
diff options
context:
space:
mode:
authorztenghui <ztenghui@google.com>2013-03-12 15:43:56 -0700
committerztenghui <ztenghui@google.com>2013-03-15 16:16:16 -0700
commite0fb528f8e3bbab04620c8534177168b358e837b (patch)
tree620e4dc70bb9299600fdf9468507197bdca93b5f /cmds/stagefright
parentee6ad3bd4bfc8e71b3b8c96eb4ea56a592e13e65 (diff)
downloadframeworks_av-e0fb528f8e3bbab04620c8534177168b358e837b.zip
frameworks_av-e0fb528f8e3bbab04620c8534177168b358e837b.tar.gz
frameworks_av-e0fb528f8e3bbab04620c8534177168b358e837b.tar.bz2
Add the presentation rotation support
bug:7991013 Change-Id: I10cb034b432876c724baa4974efcb3d67b8a99b6
Diffstat (limited to 'cmds/stagefright')
-rw-r--r--cmds/stagefright/muxer.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/cmds/stagefright/muxer.cpp b/cmds/stagefright/muxer.cpp
index fac2acc..cca33e0 100644
--- a/cmds/stagefright/muxer.cpp
+++ b/cmds/stagefright/muxer.cpp
@@ -55,7 +55,8 @@ static int muxing(
const char *outputFileName,
bool enableTrim,
int trimStartTimeMs,
- int trimEndTimeMs) {
+ int trimEndTimeMs,
+ int rotationDegrees) {
sp<NuMediaExtractor> extractor = new NuMediaExtractor;
if (extractor->setDataSource(path) != OK) {
fprintf(stderr, "unable to instantiate extractor. %s\n", path);
@@ -141,6 +142,7 @@ static int muxing(
size_t trackIndex = -1;
sp<ABuffer> newBuffer = new ABuffer(bufferSize);
+ muxer->setOrientationHint(rotationDegrees);
muxer->start();
while (!sawInputEOS) {
@@ -210,12 +212,13 @@ int main(int argc, char **argv) {
char *outputFileName = NULL;
int trimStartTimeMs = -1;
int trimEndTimeMs = -1;
+ int rotationDegrees = 0;
// When trimStartTimeMs and trimEndTimeMs seems valid, we turn this switch
// to true.
bool enableTrim = false;
int res;
- while ((res = getopt(argc, argv, "h?avo:s:e:")) >= 0) {
+ while ((res = getopt(argc, argv, "h?avo:s:e:r:")) >= 0) {
switch (res) {
case 'a':
{
@@ -247,6 +250,12 @@ int main(int argc, char **argv) {
break;
}
+ case 'r':
+ {
+ rotationDegrees = atoi(optarg);
+ break;
+ }
+
case '?':
case 'h':
default:
@@ -288,7 +297,7 @@ int main(int argc, char **argv) {
looper->start();
int result = muxing(looper, argv[0], useAudio, useVideo, outputFileName,
- enableTrim, trimStartTimeMs, trimEndTimeMs);
+ enableTrim, trimStartTimeMs, trimEndTimeMs, rotationDegrees);
looper->stop();