CPulseAudioClient* pClient = static_cast<CPulseAudioClient*>(user_data);
assert(pClient->__mpListener);
- if (pClient->__mIsInit == false) {
- AUDIO_IO_LOGD("Occurred this listener when an out stream is on the way to create : Write dummy, length[%d]", length);
-
- char* dummy = new char[length];
- memset(dummy, 0, length);
- pa_stream_write(s, dummy, length, NULL, 0LL, PA_SEEK_RELATIVE);
- delete [] dummy;
-
- return;
- }
-
pClient->__mpListener->onStream(pClient, length);
}
}
int CPulseAudioClient::write(const void* data, size_t length) throw(CAudioError) {
- if (__mIsInit == false) {
- THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient");
- }
-
- checkRunningState();
-
if (data == NULL) {
THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_ARGUMENT, "The parameter is invalid");
}
}
void CPulseAudioClient::checkRunningState() throw(CAudioError) {
- if (__mIsInit == false) {
- THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient");
- }
-
if (__mpContext == NULL || PA_CONTEXT_IS_GOOD(pa_context_get_state(__mpContext)) == 0) {
THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_NOT_INITIALIZED, "The context[%p] is not created or not good state", __mpContext);
}
}
bool CPulseAudioClient::isInThread() throw(CAudioError) {
- if (__mIsInit == false) {
- THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient");
- }
-
int ret = pa_threaded_mainloop_in_thread(__mpMainloop);
#ifdef _AUDIO_IO_DEBUG_TIMING_
using namespace tizen_media_audio;
-static const char* STREAM_NAME_INPUT = "CAPTURE";
static const char* STREAM_NAME_INPUT_LOW_LATENCY = "LOW LATENCY CAPTURE";
+static const char* STREAM_NAME_INPUT_MID_LATENCY = "MID LATENCY CAPTURE";
static const char* STREAM_NAME_INPUT_HIGH_LATENCY = "HIGH LATENCY CAPTURE";
static const char* STREAM_NAME_INPUT_VOIP = "VOIP CAPTURE";
+static const char* STREAM_NAME_INPUT_DEFAULT = "DEFAULT CAPTURE";
-static const char* STREAM_NAME_OUTPUT = "PLAYBACK";
static const char* STREAM_NAME_OUTPUT_LOW_LATENCY = "LOW LATENCY PLAYBACK";
+static const char* STREAM_NAME_OUTPUT_MID_LATENCY = "MID LATENCY PLAYBACK";
static const char* STREAM_NAME_OUTPUT_HIGH_LATENCY = "HIGH LATENCY PLAYBACK";
static const char* STREAM_NAME_OUTPUT_VOIP = "VOIP PLAYBACK";
+static const char* STREAM_NAME_OUTPUT_DEFAULT = "DEFAULT PLAYBACK";
-static const char* STREAM_LATENCY_LOW = "low";
-static const char* STREAM_LATENCY_MID = "mid";
-static const char* STREAM_LATENCY_HIGH = "high";
-static const char* STREAM_LATENCY_VOIP = "voip";
+static const char* STREAM_LATENCY_LOW = "low";
+static const char* STREAM_LATENCY_MID = "mid";
+static const char* STREAM_LATENCY_HIGH = "high";
+static const char* STREAM_LATENCY_VOIP = "voip";
+static const char* STREAM_LATENCY_DEFAULT = "default";
CPulseStreamSpec::CPulseStreamSpec() throw(CAudioError) :
- __mLatency(EStreamLatency::STREAM_LATENCY_INPUT_MID),
+ __mLatency(EStreamLatency::STREAM_LATENCY_INPUT_DEFAULT),
__mStreamName(NULL) {
__adjustSpec();
}
// Sets stream name
switch (__mLatency) {
- case EStreamLatency::STREAM_LATENCY_OUTPUT_MID:
- __mStreamName = STREAM_NAME_OUTPUT;
+ case EStreamLatency::STREAM_LATENCY_INPUT_LOW:
+ __mStreamName = STREAM_NAME_INPUT_LOW_LATENCY;
break;
- case EStreamLatency::STREAM_LATENCY_OUTPUT_HIGH:
- __mStreamName = STREAM_NAME_OUTPUT_HIGH_LATENCY;
+ case EStreamLatency::STREAM_LATENCY_INPUT_MID:
+ __mStreamName = STREAM_NAME_INPUT_MID_LATENCY;
+ break;
+
+ case EStreamLatency::STREAM_LATENCY_INPUT_HIGH:
+ __mStreamName = STREAM_NAME_INPUT_HIGH_LATENCY;
+ break;
+
+ case EStreamLatency::STREAM_LATENCY_INPUT_VOIP:
+ __mStreamName = STREAM_NAME_INPUT_VOIP;
+ break;
+
+ case EStreamLatency::STREAM_LATENCY_INPUT_DEFAULT:
+ __mStreamName = STREAM_NAME_INPUT_DEFAULT;
break;
case EStreamLatency::STREAM_LATENCY_OUTPUT_LOW:
__mStreamName = STREAM_NAME_OUTPUT_LOW_LATENCY;
break;
- case EStreamLatency::STREAM_LATENCY_OUTPUT_VOIP:
- __mStreamName = STREAM_NAME_OUTPUT_VOIP;
+ case EStreamLatency::STREAM_LATENCY_OUTPUT_MID:
+ __mStreamName = STREAM_NAME_OUTPUT_MID_LATENCY;
break;
- case EStreamLatency::STREAM_LATENCY_INPUT_HIGH:
- __mStreamName = STREAM_NAME_INPUT_HIGH_LATENCY;
+ case EStreamLatency::STREAM_LATENCY_OUTPUT_HIGH:
+ __mStreamName = STREAM_NAME_OUTPUT_HIGH_LATENCY;
break;
- case EStreamLatency::STREAM_LATENCY_INPUT_LOW:
- __mStreamName = STREAM_NAME_INPUT_LOW_LATENCY;
+ case EStreamLatency::STREAM_LATENCY_OUTPUT_VOIP:
+ __mStreamName = STREAM_NAME_OUTPUT_VOIP;
break;
- case EStreamLatency::STREAM_LATENCY_INPUT_VOIP:
- __mStreamName = STREAM_NAME_INPUT_VOIP;
+ case EStreamLatency::STREAM_LATENCY_OUTPUT_DEFAULT:
+ __mStreamName = STREAM_NAME_OUTPUT_DEFAULT;
break;
- case EStreamLatency::STREAM_LATENCY_INPUT_MID:
default:
- __mStreamName = STREAM_NAME_INPUT;
+ AUDIO_IO_LOGW("Invalid __mLatency[%d]", __mLatency);
break;
}
}
case EStreamLatency::STREAM_LATENCY_OUTPUT_LOW:
latency = STREAM_LATENCY_LOW;
break;
+
case EStreamLatency::STREAM_LATENCY_INPUT_MID:
case EStreamLatency::STREAM_LATENCY_OUTPUT_MID:
latency = STREAM_LATENCY_MID;
break;
+
case EStreamLatency::STREAM_LATENCY_INPUT_HIGH:
case EStreamLatency::STREAM_LATENCY_OUTPUT_HIGH:
latency = STREAM_LATENCY_HIGH;
break;
+
case EStreamLatency::STREAM_LATENCY_INPUT_VOIP:
case EStreamLatency::STREAM_LATENCY_OUTPUT_VOIP:
latency = STREAM_LATENCY_VOIP;
break;
+
+ case EStreamLatency::STREAM_LATENCY_INPUT_DEFAULT:
+ case EStreamLatency::STREAM_LATENCY_OUTPUT_DEFAULT:
+ latency = STREAM_LATENCY_DEFAULT;
+ break;
+
default:
- latency = STREAM_LATENCY_MID;
+ AUDIO_IO_LOGW("Invalid __mLatency[%d]", __mLatency);
+ latency = STREAM_LATENCY_DEFAULT;
break;
}