From 004c798913b4fc19d7bea2168595910ec7fb94fc Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Tue, 11 Dec 2018 13:35:38 +0900 Subject: [PATCH] CAudioInput/Output: Apply VoIP latency in case of VoIP audio type There was no implementation of setting specific latency value except default case. An audio type can be set by audio_in[out]_set_sound_stream_info() and therefore we can utilize the audio type to determine which latency type should be set. If it is set, the audio core recoginizes it and set this stream with a specific latency value. VoIP type is one of the most common usecases for audio-io API. This case is now added. [Version] 0.5.15 [Issue Type] Enhancement Change-Id: Id5fd33f79fbb2430ce35824e06c4454a0f66dff1 Signed-off-by: Sangchul Lee --- packaging/capi-media-audio-io.spec | 2 +- src/cpp/CAudioInput.cpp | 4 ++++ src/cpp/CAudioOutput.cpp | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packaging/capi-media-audio-io.spec b/packaging/capi-media-audio-io.spec index 7c16553..1d9ecbf 100644 --- a/packaging/capi-media-audio-io.spec +++ b/packaging/capi-media-audio-io.spec @@ -1,6 +1,6 @@ Name: capi-media-audio-io Summary: An Audio Input & Audio Output library in Tizen Native API -Version: 0.5.14 +Version: 0.5.15 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/cpp/CAudioInput.cpp b/src/cpp/CAudioInput.cpp index 64d2e94..752a273 100644 --- a/src/cpp/CAudioInput.cpp +++ b/src/cpp/CAudioInput.cpp @@ -136,6 +136,10 @@ void CAudioInput::prepare() { /* Init StreamSpec */ AUDIO_IO_LOGD("Set Stream Spec : CPulseStreamSpec::STREAM_LATENCY_INPUT_DEFAULT"); CPulseStreamSpec::EStreamLatency streamSpec = CPulseStreamSpec::EStreamLatency::STREAM_LATENCY_INPUT_DEFAULT; + /* Override the default value by audio type */ + if (audioType == CAudioInfo::EAudioType::AUDIO_IN_TYPE_VOIP) + streamSpec = CPulseStreamSpec::EStreamLatency::STREAM_LATENCY_INPUT_VOIP; + CPulseStreamSpec spec(streamSpec, mAudioInfo); internalLock(); diff --git a/src/cpp/CAudioOutput.cpp b/src/cpp/CAudioOutput.cpp index f330bed..51a2fd0 100644 --- a/src/cpp/CAudioOutput.cpp +++ b/src/cpp/CAudioOutput.cpp @@ -138,6 +138,10 @@ void CAudioOutput::prepare() { streamSpec = CPulseStreamSpec::EStreamLatency::STREAM_LATENCY_OUTPUT_DEFAULT_ASYNC; } #endif + /* Override the default value by audio type */ + if (audioType == CAudioInfo::EAudioType::AUDIO_OUT_TYPE_VOIP) + streamSpec = CPulseStreamSpec::EStreamLatency::STREAM_LATENCY_OUTPUT_VOIP; + CPulseStreamSpec spec(streamSpec, mAudioInfo); internalLock(); -- 2.7.4