*/
-#include <mm.h>
#include <pthread.h>
#include <assert.h>
#include "CAudioIODef.h"
/**
* class CAudioIO
*/
+//LCOV_EXCL_START
CAudioIO::CAudioIO() :
mpPulseAudioClient(NULL),
__mMutex(PTHREAD_MUTEX_INITIALIZER),
mStatePrev = CAudioInfo::EAudioIOState::AUDIO_IO_STATE_NONE;
mByPolicy = false;
}
+//LCOV_EXCL_STOP
CAudioIO::CAudioIO(CAudioInfo& audioInfo) :
mpPulseAudioClient(NULL),
THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO");
if (pthread_mutex_lock(&__mMutex) != 0)
- THROW_ERROR_MSG(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pthread_mutex_lock()");
+ THROW_ERROR_MSG(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pthread_mutex_lock()"); //LCOV_EXCL_LINE
#ifdef _AUDIO_IO_DEBUG_TIMING_
AUDIO_IO_LOGD(COLOR_RED "%p LOCKED" COLOR_END, &__mMutex);
THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO");
if (pthread_mutex_unlock(&__mMutex) != 0)
- THROW_ERROR_MSG(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pthread_mutex_lock()");
+ THROW_ERROR_MSG(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pthread_mutex_lock()"); //LCOV_EXCL_LINE
#ifdef _AUDIO_IO_DEBUG_TIMING_
AUDIO_IO_LOGD(COLOR_GREEN "%p UNLOCKED" COLOR_END, &__mMutex);
int ret = pthread_mutex_init(&__mMutex, NULL);
if (ret != 0)
- THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pthread_mutex_init()");
+ THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pthread_mutex_init()"); //LCOV_EXCL_LINE
ret = pthread_cond_init(&__mCond, NULL);
if (ret != 0)
- THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pthread_cond_init()");
+ THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pthread_cond_init()"); //LCOV_EXCL_LINE
__mIsInit = true;
}
bool error_occured = false;
int ret = pthread_mutex_destroy(&__mMutex);
if (ret != 0) {
- AUDIO_IO_LOGE("Failed pthread_mutex_destroy(%p) errno:%d", &__mMutex, ret);
+ AUDIO_IO_LOGE("Failed pthread_mutex_destroy(%p) errno:%d", &__mMutex, ret); //LCOV_EXCL_LINE
error_occured = true;
}
ret = pthread_mutex_destroy(&__mCondMutex);
if (ret != 0) {
+//LCOV_EXCL_START
AUDIO_IO_LOGE("Failed cond pthread_mutex_destroy(%p) errno:%d", &__mCondMutex, ret);
error_occured = true;
+//LCOV_EXCL_STOP
}
ret = pthread_cond_destroy(&__mCond);
if (ret != 0) {
+//LCOV_EXCL_START
AUDIO_IO_LOGE("Failed pthread_cond_destroy(%p) errno:%d", &__mCond, ret);
error_occured = true;
+//LCOV_EXCL_STOP
}
if (error_occured)
THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_NOT_SUPPORTED_TYPE, "Input stream is not supported");
if ((errorCode = sound_manager_get_type_from_stream_information(stream_info, &type)) != SOUND_MANAGER_ERROR_NONE)
- THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Parameter stream_info->stream_type is invalid [ret:%d]", errorCode);
+ THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Parameter stream_info->stream_type is invalid [ret:%d]", errorCode); //LCOV_EXCL_LINE
if (mDirection == CAudioInfo::EAudioDirection::AUDIO_DIRECTION_IN)
getAudioInfo().convertInputStreamType2AudioType(type, &audioType);
else
getAudioInfo().setAudioType(audioType);
if ((errorCode = sound_manager_get_index_from_stream_information(stream_info, &index)) != SOUND_MANAGER_ERROR_NONE)
- THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Parameter stream_info->index is invalid [ret:%d]", errorCode);
+ THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Parameter stream_info->index is invalid [ret:%d]", errorCode); //LCOV_EXCL_LINE
getAudioInfo().setAudioIndex(index);
} catch (CAudioError& e) {