diff options
author | Andreas Huber <andih@google.com> | 2010-03-12 15:08:52 -0800 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-03-12 15:08:52 -0800 |
commit | 93e1fb99a0c66784b49b105ce84a23baf054ee9c (patch) | |
tree | a8e515ed08896dbd16463cb4b7ad85b3162c584c | |
parent | c116510dd22091369ab15b63fbbc176e1fb39a04 (diff) | |
download | frameworks_av-93e1fb99a0c66784b49b105ce84a23baf054ee9c.zip frameworks_av-93e1fb99a0c66784b49b105ce84a23baf054ee9c.tar.gz frameworks_av-93e1fb99a0c66784b49b105ce84a23baf054ee9c.tar.bz2 |
Fix the media metadata retriever (tests). The native constants must match those published at the java layer.
Change-Id: Ic1efed709e4d93c61913b231a8cd3ef1074f8ca0
-rw-r--r-- | include/media/MediaMetadataRetrieverInterface.h | 6 | ||||
-rw-r--r-- | include/media/mediametadataretriever.h | 4 | ||||
-rw-r--r-- | media/libstagefright/StagefrightMetadataRetriever.cpp | 18 |
3 files changed, 26 insertions, 2 deletions
diff --git a/include/media/MediaMetadataRetrieverInterface.h b/include/media/MediaMetadataRetrieverInterface.h index e228357..ff57774 100644 --- a/include/media/MediaMetadataRetrieverInterface.h +++ b/include/media/MediaMetadataRetrieverInterface.h @@ -43,6 +43,10 @@ public: class MediaMetadataRetrieverInterface : public MediaMetadataRetrieverBase { public: + MediaMetadataRetrieverInterface() + : mMode(0) { + } + virtual ~MediaMetadataRetrieverInterface() {} // @param mode The intended mode of operations: @@ -57,6 +61,8 @@ public: mode > METADATA_MODE_FRAME_CAPTURE_AND_METADATA_RETRIEVAL) { return BAD_VALUE; } + + mMode = mode; return NO_ERROR; } diff --git a/include/media/mediametadataretriever.h b/include/media/mediametadataretriever.h index 9b12410..dbbcc49 100644 --- a/include/media/mediametadataretriever.h +++ b/include/media/mediametadataretriever.h @@ -67,8 +67,8 @@ enum { // and meta data retrieval.$ enum { METADATA_MODE_NOOP = 0x00, - METADATA_MODE_FRAME_CAPTURE_ONLY = 0x01, - METADATA_MODE_METADATA_RETRIEVAL_ONLY = 0x02, + METADATA_MODE_METADATA_RETRIEVAL_ONLY = 0x01, + METADATA_MODE_FRAME_CAPTURE_ONLY = 0x02, METADATA_MODE_FRAME_CAPTURE_AND_METADATA_RETRIEVAL = 0x03 }; diff --git a/media/libstagefright/StagefrightMetadataRetriever.cpp b/media/libstagefright/StagefrightMetadataRetriever.cpp index 4679207..2968917 100644 --- a/media/libstagefright/StagefrightMetadataRetriever.cpp +++ b/media/libstagefright/StagefrightMetadataRetriever.cpp @@ -206,6 +206,12 @@ static VideoFrame *extractVideoFrameWithCodecFlags( VideoFrame *StagefrightMetadataRetriever::captureFrame() { LOGV("captureFrame"); + if (0 == (mMode & METADATA_MODE_FRAME_CAPTURE_ONLY)) { + LOGV("captureFrame disabled by mode (0x%08x)", mMode); + + return NULL; + } + if (mExtractor.get() == NULL) { LOGV("no extractor."); return NULL; @@ -256,6 +262,12 @@ VideoFrame *StagefrightMetadataRetriever::captureFrame() { MediaAlbumArt *StagefrightMetadataRetriever::extractAlbumArt() { LOGV("extractAlbumArt (extractor: %s)", mExtractor.get() != NULL ? "YES" : "NO"); + if (0 == (mMode & METADATA_MODE_METADATA_RETRIEVAL_ONLY)) { + LOGV("extractAlbumArt/metadata retrieval disabled by mode"); + + return NULL; + } + if (mExtractor == NULL) { return NULL; } @@ -274,6 +286,12 @@ MediaAlbumArt *StagefrightMetadataRetriever::extractAlbumArt() { } const char *StagefrightMetadataRetriever::extractMetadata(int keyCode) { + if (0 == (mMode & METADATA_MODE_METADATA_RETRIEVAL_ONLY)) { + LOGV("extractAlbumArt/metadata retrieval disabled by mode"); + + return NULL; + } + if (mExtractor == NULL) { return NULL; } |