Fix issue 2194140: [Passion] Support Audience chip.
Add method to AndroidAudioInput to change audio source.
Force AndroidAudioInput audio source to AUDIO_SOURCE_CAMCORDER if a video input is present.
diff --git a/android/author/android_audio_input.cpp b/android/author/android_audio_input.cpp
index f7539cc..81e121e 100644
--- a/android/author/android_audio_input.cpp
+++ b/android/author/android_audio_input.cpp
@@ -695,6 +695,14 @@
}
////////////////////////////////////////////////////////////////////////////
+bool AndroidAudioInput::setAudioSource(uint32 iSource)
+{
+ iAudioSource = iSource;
+ LOGV("AndroidAudioInput::setAudioSource() iAudioSource %d set", iAudioSource);
+ return true;
+}
+
+////////////////////////////////////////////////////////////////////////////
// Private methods
////////////////////////////////////////////////////////////////////////////
diff --git a/android/author/android_audio_input.h b/android/author/android_audio_input.h
index a410f2a..965022e 100644
--- a/android/author/android_audio_input.h
+++ b/android/author/android_audio_input.h
@@ -298,6 +298,9 @@
/* Set the input number of channels */
bool setAudioNumChannels(int32 iNumChannels);
+ /* Sets the audio input source */
+ bool setAudioSource(uint32 iSource);
+
/* From PVMFMediaClockStateObserver and its base*/
void ClockStateUpdated();
void NotificationsInterfaceDestroyed();
diff --git a/android/author/authordriver.cpp b/android/author/authordriver.cpp
index 7aada71..13994d2 100644
--- a/android/author/authordriver.cpp
+++ b/android/author/authordriver.cpp
@@ -313,6 +313,10 @@
commandFailed(ac);
return;
}
+ // force audio source to camcorder when recording video
+ if (mVideoInputMIO != NULL) {
+ mAudioInputMIO->setAudioSource(AUDIO_SOURCE_CAMCORDER);
+ }
}
OSCL_TRY(error, mAuthor->AddDataSource(*mAudioNode, ac));
@@ -335,6 +339,10 @@
if (mCamera == 0 ||
(mCamera != 0 && cameraInput->SetCamera(mCamera) == PVMFSuccess)) {
mVideoInputMIO = cameraInput;
+ // force audio source to camcorder when recording video
+ if (mAudioInputMIO != NULL) {
+ mAudioInputMIO->setAudioSource(AUDIO_SOURCE_CAMCORDER);
+ }
break;
}
}