Merge "Extend stagefright tool to extract either album art or video frame."
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 @@
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 @@
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;