summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2009-11-03 16:00:22 -0800
committerAndreas Huber <andih@google.com>2009-11-03 16:00:22 -0800
commit1f9ad1d704a17533989a9274c55bd5bb9d3abcc0 (patch)
tree3ea176b69776c84e0c6250bdeeaf33bb9f91a801 /media
parent125ef261deb4efbb50cc41c60902dea48d8d4187 (diff)
downloadframeworks_av-1f9ad1d704a17533989a9274c55bd5bb9d3abcc0.zip
frameworks_av-1f9ad1d704a17533989a9274c55bd5bb9d3abcc0.tar.gz
frameworks_av-1f9ad1d704a17533989a9274c55bd5bb9d3abcc0.tar.bz2
Support raw audio sources in MediaPlayerImpl.
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/MediaPlayerImpl.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/media/libstagefright/MediaPlayerImpl.cpp b/media/libstagefright/MediaPlayerImpl.cpp
index 76f4182..4d14e4c 100644
--- a/media/libstagefright/MediaPlayerImpl.cpp
+++ b/media/libstagefright/MediaPlayerImpl.cpp
@@ -28,6 +28,7 @@
#include <media/stagefright/AudioPlayer.h>
// #include <media/stagefright/CameraSource.h>
#include <media/stagefright/MediaDebug.h>
+#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/MediaExtractor.h>
#include <media/stagefright/MediaPlayerImpl.h>
#include <media/stagefright/MetaData.h>
@@ -391,8 +392,15 @@ void MediaPlayerImpl::setAudioSource(const sp<MediaSource> &source) {
sp<MetaData> meta = source->getFormat();
- mAudioDecoder = OMXCodec::Create(
- mClient.interface(), meta, false /* createEncoder */, source);
+ const char *mime;
+ CHECK(meta->findCString(kKeyMIMEType, &mime));
+
+ if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_RAW)) {
+ mAudioDecoder = source;
+ } else {
+ mAudioDecoder = OMXCodec::Create(
+ mClient.interface(), meta, false /* createEncoder */, source);
+ }
}
void MediaPlayerImpl::setVideoSource(const sp<MediaSource> &source) {