diff options
author | Andreas Huber <andih@google.com> | 2010-03-10 13:33:51 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-03-10 13:33:51 -0800 |
commit | e38cd3926d445512f93958f5f1bcf90003055546 (patch) | |
tree | e5ec8419c882b50e8023af9eaafa1ce736422815 /cmds | |
parent | e182a92ae408f27f46d15de01c8a263cfe6f9246 (diff) | |
parent | edfeb1a3f5b62061cc628c6ebc38fb163e4a8151 (diff) | |
download | frameworks_base-e38cd3926d445512f93958f5f1bcf90003055546.zip frameworks_base-e38cd3926d445512f93958f5f1bcf90003055546.tar.gz frameworks_base-e38cd3926d445512f93958f5f1bcf90003055546.tar.bz2 |
Merge "Extend stagefright tool to extract either album art or video frame."
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/stagefright/stagefright.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp index 942a303..5e2c61e 100644 --- a/cmds/stagefright/stagefright.cpp +++ b/cmds/stagefright/stagefright.cpp @@ -232,7 +232,7 @@ static void usage(const char *me) { fprintf(stderr, " -m max-number-of-frames-to-decode in each pass\n"); fprintf(stderr, " -b bug to reproduce\n"); fprintf(stderr, " -p(rofiles) dump decoder profiles supported\n"); - fprintf(stderr, " -t(humbnail) extract video thumbnail\n"); + fprintf(stderr, " -t(humbnail) extract video thumbnail or album art\n"); fprintf(stderr, " -s(oftware) prefer software codec\n"); } @@ -334,12 +334,24 @@ int main(int argc, char **argv) { const char *filename = argv[k]; CHECK_EQ(retriever->setDataSource(filename), OK); - CHECK_EQ(retriever->setMode(METADATA_MODE_FRAME_CAPTURE_ONLY), OK); + CHECK_EQ(retriever->setMode( + METADATA_MODE_FRAME_CAPTURE_AND_METADATA_RETRIEVAL), + OK); sp<IMemory> mem = retriever->captureFrame(); - printf("captureFrame(%s) => %s\n", - filename, mem != NULL ? "OK" : "FAILED"); + if (mem != NULL) { + printf("captureFrame(%s) => OK\n", filename); + } else { + mem = retriever->extractAlbumArt(); + + if (mem != NULL) { + printf("extractAlbumArt(%s) => OK\n", filename); + } else { + printf("both captureFrame and extractAlbumArt " + "failed on file '%s'.\n", filename); + } + } } return 0; |