summaryrefslogtreecommitdiffstats
path: root/libvideoeditor
diff options
context:
space:
mode:
Diffstat (limited to 'libvideoeditor')
-rwxr-xr-xlibvideoeditor/lvpp/VideoEditorAudioPlayer.cpp2
-rwxr-xr-xlibvideoeditor/lvpp/VideoEditorPlayer.cpp22
-rwxr-xr-xlibvideoeditor/lvpp/VideoEditorPlayer.h2
3 files changed, 19 insertions, 7 deletions
diff --git a/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp b/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp
index 219b849..66800ea 100755
--- a/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp
+++ b/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp
@@ -511,7 +511,7 @@ status_t VideoEditorAudioPlayer::start(bool sourceAlreadyStarted) {
if (mAudioSink.get() != NULL) {
status_t err = mAudioSink->open(
- mSampleRate, numChannels, AUDIO_FORMAT_PCM_16_BIT,
+ mSampleRate, numChannels, CHANNEL_MASK_USE_CHANNEL_ORDER, AUDIO_FORMAT_PCM_16_BIT,
DEFAULT_AUDIOSINK_BUFFERCOUNT,
&VideoEditorAudioPlayer::AudioSinkCallback, this);
if (err != OK) {
diff --git a/libvideoeditor/lvpp/VideoEditorPlayer.cpp b/libvideoeditor/lvpp/VideoEditorPlayer.cpp
index fa2834a..cb2edde 100755
--- a/libvideoeditor/lvpp/VideoEditorPlayer.cpp
+++ b/libvideoeditor/lvpp/VideoEditorPlayer.cpp
@@ -383,7 +383,8 @@ status_t VideoEditorPlayer::VeAudioOutput::getPosition(uint32_t *position) {
}
status_t VideoEditorPlayer::VeAudioOutput::open(
- uint32_t sampleRate, int channelCount, audio_format_t format, int bufferCount,
+ uint32_t sampleRate, int channelCount, audio_channel_mask_t channelMask,
+ audio_format_t format, int bufferCount,
AudioCallback cb, void *cookie) {
mCallback = cb;
@@ -413,14 +414,26 @@ status_t VideoEditorPlayer::VeAudioOutput::open(
frameCount = (sampleRate*afFrameCount*bufferCount)/afSampleRate;
+ if (channelMask == CHANNEL_MASK_USE_CHANNEL_ORDER) {
+ switch(channelCount) {
+ case 1:
+ channelMask = AUDIO_CHANNEL_OUT_MONO;
+ break;
+ case 2:
+ channelMask = AUDIO_CHANNEL_OUT_STEREO;
+ break;
+ default:
+ return NO_INIT;
+ }
+ }
+
AudioTrack *t;
if (mCallback != NULL) {
t = new AudioTrack(
mStreamType,
sampleRate,
format,
- (channelCount == 2) ?
- AUDIO_CHANNEL_OUT_STEREO : AUDIO_CHANNEL_OUT_MONO,
+ channelMask,
frameCount,
0 /* flags */,
CallbackWrapper,
@@ -430,8 +443,7 @@ status_t VideoEditorPlayer::VeAudioOutput::open(
mStreamType,
sampleRate,
format,
- (channelCount == 2) ?
- AUDIO_CHANNEL_OUT_STEREO : AUDIO_CHANNEL_OUT_MONO,
+ channelMask,
frameCount);
}
diff --git a/libvideoeditor/lvpp/VideoEditorPlayer.h b/libvideoeditor/lvpp/VideoEditorPlayer.h
index 88a2aeb..34f9bc5 100755
--- a/libvideoeditor/lvpp/VideoEditorPlayer.h
+++ b/libvideoeditor/lvpp/VideoEditorPlayer.h
@@ -49,7 +49,7 @@ class VideoEditorPlayer : public MediaPlayerInterface {
virtual int getSessionId();
virtual status_t open(
- uint32_t sampleRate, int channelCount,
+ uint32_t sampleRate, int channelCount, audio_channel_mask_t channelMask,
audio_format_t format, int bufferCount,
AudioCallback cb, void *cookie);