diff options
author | Andreas Huber <andih@google.com> | 2009-09-10 14:13:30 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2009-09-10 14:43:36 -0700 |
commit | e6c409632f773e41f33188272a0072be9fcb783f (patch) | |
tree | 228c0d88ce6818974b8bab7062e9fef05f3ba250 /media/libstagefright/AMRExtractor.cpp | |
parent | d9ca6a79c6ac9cc8790aabbb42fe2ce579001528 (diff) | |
download | frameworks_base-e6c409632f773e41f33188272a0072be9fcb783f.zip frameworks_base-e6c409632f773e41f33188272a0072be9fcb783f.tar.gz frameworks_base-e6c409632f773e41f33188272a0072be9fcb783f.tar.bz2 |
Media MIME types now have corresponding constants in MediaDefs.h, new codec enumeration API.
Diffstat (limited to 'media/libstagefright/AMRExtractor.cpp')
-rw-r--r-- | media/libstagefright/AMRExtractor.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/media/libstagefright/AMRExtractor.cpp b/media/libstagefright/AMRExtractor.cpp index 4772aca..8d85ce2 100644 --- a/media/libstagefright/AMRExtractor.cpp +++ b/media/libstagefright/AMRExtractor.cpp @@ -22,6 +22,7 @@ #include <media/stagefright/DataSource.h> #include <media/stagefright/MediaBufferGroup.h> #include <media/stagefright/MediaDebug.h> +#include <media/stagefright/MediaDefs.h> #include <media/stagefright/MediaErrors.h> #include <media/stagefright/MediaSource.h> #include <media/stagefright/MetaData.h> @@ -66,7 +67,7 @@ AMRExtractor::AMRExtractor(const sp<DataSource> &source) float confidence; if (SniffAMR(mDataSource, &mimeType, &confidence)) { mInitCheck = OK; - mIsWide = (mimeType == "audio/amr-wb"); + mIsWide = (mimeType == MEDIA_MIMETYPE_AUDIO_AMR_WB); } } @@ -96,7 +97,10 @@ sp<MetaData> AMRExtractor::getTrackMetaData(size_t index) { // static sp<MetaData> AMRExtractor::makeAMRFormat(bool isWide) { sp<MetaData> meta = new MetaData; - meta->setCString(kKeyMIMEType, isWide ? "audio/amr-wb" : "audio/3gpp"); + meta->setCString( + kKeyMIMEType, isWide ? MEDIA_MIMETYPE_AUDIO_AMR_WB + : MEDIA_MIMETYPE_AUDIO_AMR_NB); + meta->setInt32(kKeyChannelCount, 1); meta->setInt32(kKeySampleRate, isWide ? 16000 : 8000); @@ -221,12 +225,12 @@ bool SniffAMR( } if (!memcmp(header, "#!AMR\n", 6)) { - *mimeType = "audio/3gpp"; + *mimeType = MEDIA_MIMETYPE_AUDIO_AMR_NB; *confidence = 0.5; return true; } else if (!memcmp(header, "#!AMR-WB\n", 9)) { - *mimeType = "audio/amr-wb"; + *mimeType = MEDIA_MIMETYPE_AUDIO_AMR_WB; *confidence = 0.5; return true; |