summaryrefslogtreecommitdiffstats
path: root/cmds/stagefright/stagefright.cpp
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2011-05-25 15:02:50 -0700
committerJames Dong <jdong@google.com>2011-05-26 11:31:16 -0700
commit515e855eae78aa495da58356486aaa666cb57fd1 (patch)
tree904870c8a34af1239be1118e10f0da1d9540261d /cmds/stagefright/stagefright.cpp
parent8d91237333c60c4a6839358109265e8847df23f3 (diff)
downloadframeworks_av-515e855eae78aa495da58356486aaa666cb57fd1.zip
frameworks_av-515e855eae78aa495da58356486aaa666cb57fd1.tar.gz
frameworks_av-515e855eae78aa495da58356486aaa666cb57fd1.tar.bz2
Extract embedded cover art (aka poster frame) in mp4 files
Change-Id: Ic9421ee27b9aa3b27df00878b887de20f25d232b
Diffstat (limited to 'cmds/stagefright/stagefright.cpp')
-rw-r--r--cmds/stagefright/stagefright.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp
index a875c3a..01262fa 100644
--- a/cmds/stagefright/stagefright.cpp
+++ b/cmds/stagefright/stagefright.cpp
@@ -695,12 +695,14 @@ int main(int argc, char **argv) {
for (int k = 0; k < argc; ++k) {
const char *filename = argv[k];
+ bool failed = true;
CHECK_EQ(retriever->setDataSource(filename), (status_t)OK);
sp<IMemory> mem =
retriever->getFrameAtTime(-1,
MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC);
if (mem != NULL) {
+ failed = false;
printf("getFrameAtTime(%s) => OK\n", filename);
VideoFrame *frame = (VideoFrame *)mem->pointer();
@@ -715,16 +717,21 @@ int main(int argc, char **argv) {
"/sdcard/out.jpg", bitmap,
SkImageEncoder::kJPEG_Type,
SkImageEncoder::kDefaultQuality));
- } else {
+ }
+
+ {
mem = retriever->extractAlbumArt();
if (mem != NULL) {
+ failed = false;
printf("extractAlbumArt(%s) => OK\n", filename);
- } else {
- printf("both getFrameAtTime and extractAlbumArt "
- "failed on file '%s'.\n", filename);
}
}
+
+ if (failed) {
+ printf("both getFrameAtTime and extractAlbumArt "
+ "failed on file '%s'.\n", filename);
+ }
}
return 0;