void ignoreSession() throw(CAudioError);
+ CAudioInfo::EAudioIOState getState();
+
protected:
/* Protected Methods */
virtual void setInit(bool flag);
Name: capi-media-audio-io
Summary: An Audio Input & Audio Output library in Tizen Native API
-Version: 0.3.50
+Version: 0.3.51
Release: 0
Group: Multimedia/API
License: Apache-2.0
onStateChanged(state, false);
}
+CAudioInfo::EAudioIOState CAudioIO::getState() {
+ return mState;
+}
+
void CAudioIO::onInterrupt(CAudioSessionHandler* pHandler, int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e state, const char *reason_for_change, const char *additional_info) {
assert(pHandler);
if (buffer == NULL) {
THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Parameters are NULL buffer:%p", buffer);
}
-
+ if (CAudioIO::getState() != CAudioInfo::EAudioIOState::AUDIO_IO_STATE_RUNNING) {
+ THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_OPERATION,
+ "Can't read if not in Running state");
+ }
/* Checks synchronous flag */
if (__mIsUsedSyncRead == false) {
THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_OPERATION, "Invalid operation of read() if receive stream callback");
if (buffer == NULL) {
THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Parameters are invalid - buffer:%p, length:%zu", buffer, length);
}
+ if (CAudioIO::getState() != CAudioInfo::EAudioIOState::AUDIO_IO_STATE_RUNNING) {
+ THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_OPERATION,
+ "Can't write if not in Running state");
+ }
/* When write() is called in PulseAudio callback, bypass a pcm data to CPulseAudioClient (For Asynchronous) */
if (mpPulseAudioClient->isInThread() == true) {