virtual void initialize() throw(CAudioError);
virtual void finalize();
- bool isSkipSessionEvent() throw(CAudioError);
+ bool isSkipSession() throw(CAudioError);
void registerSound() throw(CAudioError);
void unregisterSound() throw(CAudioError);
Name: capi-media-audio-io
Summary: An Audio Input & Audio Output library in Tizen Native API
-Version: 0.3.62
+Version: 0.3.63
Release: 0
Group: Multimedia/API
License: Apache-2.0
if (mpPulseAudioClient != NULL && mState == CAudioInfo::EAudioIOState::AUDIO_IO_STATE_RUNNING)
THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_OPERATION, "An Operation is not permitted while started");
- bool isSkip = mpAudioSessionHandler->isSkipSessionEvent();
+ bool isSkip = mpAudioSessionHandler->isSkipSession();
if (isSkip == false && mpAudioSessionHandler->getId() >= 0)
mpAudioSessionHandler->unregisterSound();
if (mpAudioSessionHandler->getId() < 0) { // Did not registerSound()
// Check session to skip registration
- if (isForceIgnore() == false && mpAudioSessionHandler->isSkipSessionEvent() == false) {
+ if (isForceIgnore() == false && mpAudioSessionHandler->isSkipSession() == false) {
// Register ASM Listener
AUDIO_IO_LOGD("Register ASM Listener");
mpAudioSessionHandler->registerSound();
// Initialize PulseAudio Handler
mpPulseAudioClient->initialize();
- if (isForceIgnore() == false && mpAudioSessionHandler->isSkipSessionEvent() == false) {
- /* Updates ASM to PLAYING */
+ if (isForceIgnore() == false && mpAudioSessionHandler->isSkipSession() == false)
mpAudioSessionHandler->updatePlaying();
- }
internalUnlock();
}
try {
- // Do unprepare
CAudioIO::unprepare();
internalLock();
SAFE_DELETE(mpPulseAudioClient);
if (mpAudioSessionHandler->getId() >= 0) {
- /* Updates ASM to STOP */
- if (isForceIgnore() == false && mpAudioSessionHandler->isSkipSessionEvent() == false) {
+ if (isForceIgnore() == false && mpAudioSessionHandler->isSkipSession() == false)
mpAudioSessionHandler->updateStop();
- }
- bool isSkip = mpAudioSessionHandler->isSkipSessionEvent();
- if (isSkip == false) {
+ if (mpAudioSessionHandler->isSkipSession() == false)
mpAudioSessionHandler->unregisterSound();
- }
}
internalUnlock();
internalLock();
/* Updates ASM to STOP */
- if (isForceIgnore() == false && mpAudioSessionHandler->isSkipSessionEvent() == false) {
+ if (isForceIgnore() == false && mpAudioSessionHandler->isSkipSession() == false) {
mpAudioSessionHandler->updateStop();
}
try {
internalLock();
- if (isForceIgnore() == false && mpAudioSessionHandler->isSkipSessionEvent() == false) {
- /* Updates ASM to PLAYING */
+ if (isForceIgnore() == false && mpAudioSessionHandler->isSkipSession() == false)
mpAudioSessionHandler->updatePlaying();
- }
internalUnlock();
}
if (mpAudioSessionHandler->getId() < 0) { // Did not registerSound()
- if (isForceIgnore() == false) {
+ if (isForceIgnore() == false && mpAudioSessionHandler->isSkipSession() == false) {
// Register ASM Listener
AUDIO_IO_LOGD("Register ASM Listener");
mpAudioSessionHandler->registerSound();
// Initialize PulseAudio Handler
mpPulseAudioClient->initialize();
- if (isForceIgnore() == false &&
- mpAudioSessionHandler->isSkipSessionEvent() == false) {
- /* Updates ASM to PLAYING */
+ if (isForceIgnore() == false && mpAudioSessionHandler->isSkipSession() == false)
mpAudioSessionHandler->updatePlaying();
- }
internalUnlock();
SAFE_DELETE(mpPulseAudioClient);
if (mpAudioSessionHandler->getId() >= 0) {
- /* Updates ASM to STOP */
- if (isForceIgnore() == false &&
- mpAudioSessionHandler->isSkipSessionEvent() == false) {
+ if (isForceIgnore() == false && mpAudioSessionHandler->isSkipSession() == false)
mpAudioSessionHandler->updateStop();
- }
- bool isSkip = mpAudioSessionHandler->isSkipSessionEvent();
- if (isSkip == false) {
+ if (mpAudioSessionHandler->isSkipSession() == false)
mpAudioSessionHandler->unregisterSound();
- }
}
internalUnlock();
internalLock();
/* Updates ASM to STOP */
- if (isForceIgnore() == false &&
- mpAudioSessionHandler->isSkipSessionEvent() == false) {
+ if (isForceIgnore() == false && mpAudioSessionHandler->isSkipSession() == false)
mpAudioSessionHandler->updateStop();
- }
internalUnlock();
try {
internalLock();
- if (isForceIgnore() == false &&
- mpAudioSessionHandler->isSkipSessionEvent() == false) {
- /* Updates ASM to PLAYING */
+ if (isForceIgnore() == false && mpAudioSessionHandler->isSkipSession() == false)
mpAudioSessionHandler->updatePlaying();
- }
internalUnlock();
__mIsInit = false;
}
-bool CAudioSessionHandler::isSkipSessionEvent() throw(CAudioError) {
- bool ret = false;
-
- // To be regarded...
-#if 0
- /* Only Support below Event */
- if (mEvent != ASM_EVENT_CALL && mEvent != ASM_EVENT_VOIP &&
- mEvent != ASM_EVENT_VIDEOCALL && mEvent != ASM_EVENT_VOICE_RECOGNITION &&
- mEvent != ASM_EVENT_MMCAMCORDER_AUDIO && mEvent != ASM_EVENT_MMCAMCORDER_VIDEO) {
- // Check AudioType
- switch (__mAudioInfo.getAudioType()) {
- case CAudioInfo::AUDIO_IN_TYPE_MEDIA:
- case CAudioInfo::AUDIO_IN_TYPE_VOICECONTROL:
- ret = false;
- break;
-
- case CAudioInfo::AUDIO_IN_TYPE_MIRRORING:
- case CAudioInfo::AUDIO_IN_TYPE_LOOPBACK:
- ret = true;
- break;
-
- default:
- return false;
- }
-
- if (ret == true) {
- int captureCount = CAudioSessionHandler::__pcmCaptureCountGet();
- if (captureCount == 1) {/* If this is last one */
- /* Recover session information to MEDIA */
- int sessionResult = _mm_session_util_write_information(-1, MM_SESSION_TYPE_MEDIA, __mOptions);
- if (sessionResult != 0) {
- THROW_ERROR_MSG_FORMAT(CAudioError::ERROR_INTERNAL_OPERATION, "Failed _mm_session_util_write_information() ret:%d", sessionResult);
- }
- }
- }
+bool CAudioSessionHandler::isSkipSession() throw(CAudioError) {
+ if (__mMultimediaSession == MM_SESSION_TYPE_REPLACED_BY_STREAM ||
+ __mMultimediaSession == MM_SESSION_TYPE_VOIP ||
+ __mMultimediaSession == MM_SESSION_TYPE_CALL ||
+ __mMultimediaSession == MM_SESSION_TYPE_VIDEOCALL) {
+ AUDIO_IO_LOGD("__mMultimediaSession is [%d], skip session", __mMultimediaSession);
+ return true;
}
-#endif
- return ret;
+ return false;
}
void CAudioSessionHandler::__sound_pcm_focus_cb(int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e state, const char *reason_for_change, int option, const char *additional_info, void *user_data) {