summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2012-05-03 11:33:01 -0700
committerAndreas Huber <andih@google.com>2012-05-03 11:47:08 -0700
commit9806555d3930be43e11106281dee354820ac1c88 (patch)
treeb5aa448cc0bfede361540f45b97c81ad398a9df4 /media/libstagefright/ACodec.cpp
parent6a3969cc3bcbfc84dbcc27aa726eb96bc03a830b (diff)
downloadframeworks_av-9806555d3930be43e11106281dee354820ac1c88.zip
frameworks_av-9806555d3930be43e11106281dee354820ac1c88.tar.gz
frameworks_av-9806555d3930be43e11106281dee354820ac1c88.tar.bz2
Respect channel mask in ACodec and NuPlayer.
Refactor conversion from MetaData into AMessage while we're at it. Change-Id: I5479129836ea4316e8de28cf1b472bf19e3ac4ab related-to-bug: 6439076
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 0de2d0a..7d99064 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -333,7 +333,11 @@ ACodec::ACodec()
mNode(NULL),
mSentFormat(false),
mIsEncoder(false),
- mShutdownInProgress(false) {
+ mShutdownInProgress(false),
+ mEncoderDelay(0),
+ mEncoderPadding(0),
+ mChannelMaskPresent(false),
+ mChannelMask(0) {
mUninitializedState = new UninitializedState(this);
mLoadedState = new LoadedState(this);
mLoadedToIdleState = new LoadedToIdleState(this);
@@ -892,10 +896,17 @@ status_t ACodec::configureCodec(
if (!msg->findInt32("encoder-delay", &mEncoderDelay)) {
mEncoderDelay = 0;
}
+
if (!msg->findInt32("encoder-padding", &mEncoderPadding)) {
mEncoderPadding = 0;
}
+ if (msg->findInt32("channel-mask", &mChannelMask)) {
+ mChannelMaskPresent = true;
+ } else {
+ mChannelMaskPresent = false;
+ }
+
int32_t maxInputSize;
if (msg->findInt32("max-input-size", &maxInputSize)) {
err = setMinBufferSize(kPortIndexInput, (size_t)maxInputSize);
@@ -2021,6 +2032,11 @@ void ACodec::sendFormatChange() {
mSkipCutBuffer = new SkipCutBuffer(mEncoderDelay * frameSize,
mEncoderPadding * frameSize);
}
+
+ if (mChannelMaskPresent) {
+ notify->setInt32("channel-mask", mChannelMask);
+ }
+
break;
}