am 0533aade: Merge change I313953dc into eclair-mr2

Merge commit '0533aadef6d93dec868d648402f5ec326161de57' into eclair-mr2-plus-aosp

* commit '0533aadef6d93dec868d648402f5ec326161de57':
  Support raw audio sources in MediaPlayerImpl.
This commit is contained in:
Andreas Huber
2009-11-04 10:42:53 -08:00
committed by Android Git Automerger

View File

@@ -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) {