summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2012-04-25 14:14:55 -0700
committerMarco Nelissen <marcone@google.com>2012-04-27 12:29:37 -0700
commitc434ac82b57108bd08f58612f6ac8cbc92dbd975 (patch)
treebc8485a725a892fd149e5e7e949414232368d84f /cmds
parente0c026e32277de27627b2bc24e51f333a2f1c4ee (diff)
downloadframeworks_av-c434ac82b57108bd08f58612f6ac8cbc92dbd975.zip
frameworks_av-c434ac82b57108bd08f58612f6ac8cbc92dbd975.tar.gz
frameworks_av-c434ac82b57108bd08f58612f6ac8cbc92dbd975.tar.bz2
Add option to stagefright for writing decoded PCM
b/774846 Change-Id: I8edce3e7d60b3f56b4eb1ed75ca80285c5ae3972
Diffstat (limited to 'cmds')
-rw-r--r--cmds/stagefright/stagefright.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp
index 3656fe3..7087a81 100644
--- a/cmds/stagefright/stagefright.cpp
+++ b/cmds/stagefright/stagefright.cpp
@@ -608,6 +608,7 @@ static void usage(const char *me) {
fprintf(stderr, " -S allocate buffers from a surface\n");
fprintf(stderr, " -T allocate buffers from a surface texture\n");
fprintf(stderr, " -d(ump) filename (raw stream data to a file)\n");
+ fprintf(stderr, " -D(ump) filename (decoded PCM data to a file)\n");
}
static void dumpCodecProfiles(const sp<IOMX>& omx, bool queryDecoders) {
@@ -668,6 +669,7 @@ int main(int argc, char **argv) {
bool useSurfaceAlloc = false;
bool useSurfaceTexAlloc = false;
bool dumpStream = false;
+ bool dumpPCMStream = false;
String8 dumpStreamFilename;
gNumRepetitions = 1;
gMaxNumFrames = 0;
@@ -682,7 +684,7 @@ int main(int argc, char **argv) {
sp<LiveSession> liveSession;
int res;
- while ((res = getopt(argc, argv, "han:lm:b:ptsrow:kxSTd:")) >= 0) {
+ while ((res = getopt(argc, argv, "han:lm:b:ptsrow:kxSTd:D:")) >= 0) {
switch (res) {
case 'a':
{
@@ -697,6 +699,14 @@ int main(int argc, char **argv) {
break;
}
+ case 'D':
+ {
+ dumpPCMStream = true;
+ audioOnly = true;
+ dumpStreamFilename.setTo(optarg);
+ break;
+ }
+
case 'l':
{
listComponents = true;
@@ -1103,6 +1113,20 @@ int main(int argc, char **argv) {
writeSourcesToMP4(mediaSources, syncInfoPresent);
} else if (dumpStream) {
dumpSource(mediaSource, dumpStreamFilename);
+ } else if (dumpPCMStream) {
+ OMXClient client;
+ CHECK_EQ(client.connect(), (status_t)OK);
+
+ sp<MediaSource> decSource =
+ OMXCodec::Create(
+ client.interface(),
+ mediaSource->getFormat(),
+ false,
+ mediaSource,
+ 0,
+ 0);
+
+ dumpSource(decSource, dumpStreamFilename);
} else if (seekTest) {
performSeekTest(mediaSource);
} else {