Add verbose option to stagefright command
Currently this prints out the format of each buffer being read from
the input during 'dump' operation.
Change-Id: I44e59b96bfb07181d03903dab30c1b65f5eb6fcd
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp
index 2c088e6..85aab57 100644
--- a/cmds/stagefright/stagefright.cpp
+++ b/cmds/stagefright/stagefright.cpp
@@ -78,6 +78,7 @@
static bool gPlaybackAudio;
static bool gWriteMP4;
static bool gDisplayHistogram;
+static bool gVerbose = false;
static bool showProgress = true;
static String8 gWriteMP4Filename;
static String8 gComponentNameOverride;
@@ -159,6 +160,11 @@
break;
}
+ if (gVerbose) {
+ MetaDataBase &meta = mbuf->meta_data();
+ fprintf(stdout, "sample format: %s\n", meta.toString().c_str());
+ }
+
CHECK_EQ(
fwrite((const uint8_t *)mbuf->data() + mbuf->range_offset(),
1,
@@ -630,6 +636,7 @@
fprintf(stderr, " -T allocate buffers from a surface texture\n");
fprintf(stderr, " -d(ump) output_filename (raw stream data to a file)\n");
fprintf(stderr, " -D(ump) output_filename (decoded PCM data to a file)\n");
+ fprintf(stderr, " -v be more verbose\n");
}
static void dumpCodecProfiles(bool queryDecoders) {
@@ -708,7 +715,7 @@
sp<ALooper> looper;
int res;
- while ((res = getopt(argc, argv, "haqn:lm:b:ptsrow:kN:xSTd:D:")) >= 0) {
+ while ((res = getopt(argc, argv, "vhaqn:lm:b:ptsrow:kN:xSTd:D:")) >= 0) {
switch (res) {
case 'a':
{
@@ -832,6 +839,12 @@
break;
}
+ case 'v':
+ {
+ gVerbose = true;
+ break;
+ }
+
case '?':
case 'h':
default: