diff options
-rw-r--r-- | include/media/mediametadataretriever.h | 1 | ||||
-rw-r--r-- | include/media/stagefright/MetaData.h | 1 | ||||
-rw-r--r-- | media/libstagefright/MP3Extractor.cpp | 1 | ||||
-rw-r--r-- | media/libstagefright/MPEG4Extractor.cpp | 11 | ||||
-rw-r--r-- | media/libstagefright/OggExtractor.cpp | 3 | ||||
-rw-r--r-- | media/libstagefright/StagefrightMediaScanner.cpp | 1 | ||||
-rw-r--r-- | media/libstagefright/StagefrightMetadataRetriever.cpp | 1 |
7 files changed, 19 insertions, 0 deletions
diff --git a/include/media/mediametadataretriever.h b/include/media/mediametadataretriever.h index dbbcc49..ddc07f6 100644 --- a/include/media/mediametadataretriever.h +++ b/include/media/mediametadataretriever.h @@ -56,6 +56,7 @@ enum { METADATA_KEY_MIMETYPE = 22, METADATA_KEY_DISC_NUMBER = 23, METADATA_KEY_ALBUMARTIST = 24, + METADATA_KEY_COMPILATION = 25, // Add more here... }; diff --git a/include/media/stagefright/MetaData.h b/include/media/stagefright/MetaData.h index a69d9af..ea2fa52 100644 --- a/include/media/stagefright/MetaData.h +++ b/include/media/stagefright/MetaData.h @@ -75,6 +75,7 @@ enum { kKeyDiscNumber = 'dnum', // cstring kKeyDate = 'date', // cstring kKeyWriter = 'writ', // cstring + kKeyCompilation = 'cpil', // cstring kKeyTimeScale = 'tmsl', // int32_t // video profile and level diff --git a/media/libstagefright/MP3Extractor.cpp b/media/libstagefright/MP3Extractor.cpp index 82c0426..b15c720 100644 --- a/media/libstagefright/MP3Extractor.cpp +++ b/media/libstagefright/MP3Extractor.cpp @@ -743,6 +743,7 @@ sp<MetaData> MP3Extractor::getMetaData() { { kKeyAuthor, "TXT", "TEXT" }, { kKeyCDTrackNumber, "TRK", "TRCK" }, { kKeyDiscNumber, "TPA", "TPOS" }, + { kKeyCompilation, "TCP", "TCMP" }, }; static const size_t kNumMapEntries = sizeof(kMap) / sizeof(kMap[0]); diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp index 03682e2..5497322 100644 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -1379,6 +1379,17 @@ status_t MPEG4Extractor::parseMetaData(off_t offset, size_t size) { metadataKey = kKeyGenre; break; } + case FOURCC('c', 'p', 'i', 'l'): + { + if (size == 9 && flags == 21) { + char tmp[16]; + sprintf(tmp, "%d", + (int)buffer[size - 1]); + + mFileMetaData->setCString(kKeyCompilation, tmp); + } + break; + } case FOURCC('t', 'r', 'k', 'n'): { if (size == 16 && flags == 0) { diff --git a/media/libstagefright/OggExtractor.cpp b/media/libstagefright/OggExtractor.cpp index 43938b2..0368fb7 100644 --- a/media/libstagefright/OggExtractor.cpp +++ b/media/libstagefright/OggExtractor.cpp @@ -660,6 +660,9 @@ void MyVorbisExtractor::parseFileMetaData() { } kMap[] = { { "TITLE", kKeyTitle }, { "ARTIST", kKeyArtist }, + { "ALBUMARTIST", kKeyAlbumArtist }, + { "ALBUM ARTIST", kKeyAlbumArtist }, + { "COMPILATION", kKeyCompilation }, { "ALBUM", kKeyAlbum }, { "COMPOSER", kKeyComposer }, { "GENRE", kKeyGenre }, diff --git a/media/libstagefright/StagefrightMediaScanner.cpp b/media/libstagefright/StagefrightMediaScanner.cpp index 8426ee7..8580cc4 100644 --- a/media/libstagefright/StagefrightMediaScanner.cpp +++ b/media/libstagefright/StagefrightMediaScanner.cpp @@ -156,6 +156,7 @@ status_t StagefrightMediaScanner::processFile( { "year", METADATA_KEY_YEAR }, { "duration", METADATA_KEY_DURATION }, { "writer", METADATA_KEY_WRITER }, + { "compilation", METADATA_KEY_COMPILATION }, }; static const size_t kNumEntries = sizeof(kKeyMap) / sizeof(kKeyMap[0]); diff --git a/media/libstagefright/StagefrightMetadataRetriever.cpp b/media/libstagefright/StagefrightMetadataRetriever.cpp index 9b2dec9..ac208cd 100644 --- a/media/libstagefright/StagefrightMetadataRetriever.cpp +++ b/media/libstagefright/StagefrightMetadataRetriever.cpp @@ -355,6 +355,7 @@ void StagefrightMetadataRetriever::parseMetaData() { { kKeyTitle, METADATA_KEY_TITLE }, { kKeyYear, METADATA_KEY_YEAR }, { kKeyWriter, METADATA_KEY_WRITER }, + { kKeyCompilation, METADATA_KEY_COMPILATION }, }; static const size_t kNumMapEntries = sizeof(kMap) / sizeof(kMap[0]); |