CAudioInput/Output: Apply VoIP latency in case of VoIP audio type 30/195130/1
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 11 Dec 2018 04:35:38 +0000 (13:35 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 11 Dec 2018 04:56:32 +0000 (13:56 +0900)
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 <sc11.lee@samsung.com>
packaging/capi-media-audio-io.spec
src/cpp/CAudioInput.cpp
src/cpp/CAudioOutput.cpp

index 7c16553..1d9ecbf 100644 (file)
@@ -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
index 64d2e94..752a273 100644 (file)
@@ -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();
index f330bed..51a2fd0 100644 (file)
@@ -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();