summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/StagefrightRecorder.cpp
diff options
context:
space:
mode:
authorMingming Yin <mingming@codeaurora.org>2015-08-19 20:32:33 -0700
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:24:49 -0600
commitb9fb5f42bc4a40f3be5a7a9b2c57bf6b604aea7e (patch)
treecf3d45b6daf6d1784a43bca2930ff4e56f4251cd /media/libmediaplayerservice/StagefrightRecorder.cpp
parent1dced8030c5dc14bee71adde448bcefd5b91af9b (diff)
downloadframeworks_av-b9fb5f42bc4a40f3be5a7a9b2c57bf6b604aea7e.zip
frameworks_av-b9fb5f42bc4a40f3be5a7a9b2c57bf6b604aea7e.tar.gz
frameworks_av-b9fb5f42bc4a40f3be5a7a9b2c57bf6b604aea7e.tar.bz2
audio: add encoding support for linear PCM format
- add encoding support for linear PCM format. Change-Id: Iecf402064d67d35d5057b814c842d79af92756d0
Diffstat (limited to 'media/libmediaplayerservice/StagefrightRecorder.cpp')
-rw-r--r--media/libmediaplayerservice/StagefrightRecorder.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp
index 817ae4d..49804c5 100644
--- a/media/libmediaplayerservice/StagefrightRecorder.cpp
+++ b/media/libmediaplayerservice/StagefrightRecorder.cpp
@@ -991,6 +991,13 @@ sp<MediaSource> StagefrightRecorder::createAudioSource() {
sp<MediaSource> audioEncoder =
MediaCodecSource::Create(mLooper, format, audioSource);
+ // If encoder could not be created (as in LPCM), then
+ // use the AudioSource directly as the MediaSource.
+ if (audioEncoder == NULL &&
+ mAudioEncoder == AUDIO_ENCODER_LPCM) {
+ ALOGD("No encoder is needed for linear PCM format");
+ audioEncoder = audioSource;
+ }
mAudioSourceNode = audioSource;
if (audioEncoder == NULL) {