SOUND_STREAM_TYPE_VIDEO_CALL, /**< Sound stream type for video-call */
SOUND_STREAM_TYPE_RADIO, /**< Sound stream type for radio */
SOUND_STREAM_TYPE_LOOPBACK, /**< Sound stream type for loopback */
+ SOUND_STREAM_TYPE_SOLO, /**< Sound stream type for solo */
} sound_stream_type_internal_e;
/**
typedef struct _sound_stream_info_s {
unsigned int index;
char *stream_type;
+ bool is_focus_unavailable;
pa_threaded_mainloop *pa_mainloop;
pa_context *pa_context;
stream_conf_info_s stream_conf_info;
int _convert_stream_type_for_internal(sound_stream_type_internal_e stream_type_enum, char **stream_type);
+void _set_focus_availability(sound_stream_info_s *stream_info);
+
int _convert_stream_type_to_change_reason(const char *stream_type, sound_stream_focus_change_reason_e *change_reason);
int _convert_device_type(sound_device_type_e device_type_enum, char **device_type);
Name: capi-media-sound-manager
Summary: Sound Manager library
-Version: 0.3.42
+Version: 0.3.43
Release: 0
Group: Multimedia/API
License: Apache-2.0
memset(stream_h, 0, sizeof(sound_stream_info_s));
ret = _convert_stream_type(stream_type, &stream_h->stream_type);
if (ret == MM_ERROR_NONE) {
+ _set_focus_availability(stream_h);
ret = _make_pa_connection_and_register_focus(stream_h, callback, user_data);
if (ret == MM_ERROR_NONE) {
*stream_info = (sound_stream_info_h)stream_h;
SM_INSTANCE_CHECK(stream_h);
+ if (stream_h->is_focus_unavailable)
+ return _convert_sound_manager_error_code(__func__, MM_ERROR_POLICY_INTERNAL);
+
ret = mm_sound_acquire_focus(stream_h->index, (mm_sound_focus_type_e)focus_mask, additional_info);
if (ret == MM_ERROR_NONE) {
stream_h->acquired_focus |= focus_mask;
memset(stream_h, 0, sizeof(sound_stream_info_s));
ret = _convert_stream_type_for_internal(stream_type, &stream_h->stream_type);
if (ret == MM_ERROR_NONE) {
+ _set_focus_availability(stream_h);
ret = _make_pa_connection_and_register_focus(stream_h, callback, user_data);
if (!ret) {
*stream_info = (sound_stream_info_h)stream_h;
ret = MM_ERROR_SOUND_INTERNAL;
break;
}
- LOGI("stream_type[%s]", stream_type);
+ LOGI("stream_type[%s]", *stream_type);
return ret;
}
case SOUND_STREAM_TYPE_LOOPBACK:
*stream_type = "loopback";
break;
+ case SOUND_STREAM_TYPE_SOLO:
+ *stream_type = "solo";
+ break;
default:
LOGE("could not find the stream_type[%d] in this switch case statement", stream_type_enum);
ret = MM_ERROR_SOUND_INTERNAL;
return ret;
}
+void _set_focus_availability(sound_stream_info_s *stream_info)
+{
+ if (stream_info == NULL || stream_info->stream_type == NULL) {
+ LOGE("invalid argument");
+ return;
+ }
+ if (!strncmp(stream_info->stream_type, "solo", SOUND_STREAM_TYPE_LEN)) {
+ stream_info->is_focus_unavailable = true;
+ LOGI("this stream_type[%s] does not support focus", stream_info->stream_type);
+ }
+
+ return;
+}
+
int _convert_stream_type_to_change_reason(const char *stream_type, sound_stream_focus_change_reason_e *change_reason)
{
int ret = MM_ERROR_NONE;