summaryrefslogtreecommitdiff
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2012-03-29 11:31:12 -0700
committerAndreas Huber <andih@google.com>2012-03-29 11:31:12 -0700
commitecdd39c5af016e2fa57cbfd837aa670b706dabd3 (patch)
treeb5228c9d6afcfc625a765987c785244fc1b86e13 /media/libstagefright/ACodec.cpp
parent9d309ba6ba8a4b456ba3af35dbdf06ff0a478413 (diff)
Implementation of a raw audio "decoder".
Change-Id: Ie89f01e59dd8106883937188afbb407550f0ac92
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index db2bedad..e6e0413b 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -768,6 +768,8 @@ status_t ACodec::setComponentRole(
"video_decoder.h263", "video_encoder.h263" },
{ MEDIA_MIMETYPE_VIDEO_VPX,
"video_decoder.vpx", "video_encoder.vpx" },
+ { MEDIA_MIMETYPE_AUDIO_RAW,
+ "audio_decoder.raw", "audio_encoder.raw" },
};
static const size_t kNumMimeToRole =
@@ -873,6 +875,15 @@ status_t ACodec::configureCodec(
} else {
err = setupG711Codec(encoder, numChannels);
}
+ } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_RAW)) {
+ int32_t numChannels, sampleRate;
+ if (encoder
+ || !msg->findInt32("channel-count", &numChannels)
+ || !msg->findInt32("sample-rate", &sampleRate)) {
+ err = INVALID_OPERATION;
+ } else {
+ err = setupRawAudioFormat(kPortIndexInput, sampleRate, numChannels);
+ }
}
int32_t maxInputSize;