From: Seungbae Shin Date: Wed, 10 Jan 2018 12:58:07 +0000 (+0900) Subject: Add TV BT device when current device list query X-Git-Tag: submit/tizen/20180226.072000~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a55cb8c16e45116b55c53e5307b6d1410f103696;p=platform%2Fcore%2Fmultimedia%2Flibmm-sound.git Add TV BT device when current device list query [Version] 0.12.9 [Profile] TV [Issue Type] Bug Change-Id: I74998313adbd54ac99094a1f68f34e983723d767 --- diff --git a/mm_sound_proxy.c b/mm_sound_proxy.c index be5aec6..5ca029b 100644 --- a/mm_sound_proxy.c +++ b/mm_sound_proxy.c @@ -1,6 +1,10 @@ #include #include +#ifdef TIZEN_TV +#include +#endif + #include #include @@ -354,6 +358,41 @@ cleanup: return ret; } +#ifdef TIZEN_TV +#define _VCONF_KEY_SOUND_SPEAKER_SELECTION "file/private/sound/feature/SpeakerSelection" +#define _AUDIO_TV_OUTPUT_BT_HEADSET 5 + +static mm_sound_device_t* _get_tv_bt_device(void) +{ + int speaker_value = 0; + mm_sound_device_t* device_item = NULL; + + if (vconf_get_int(_VCONF_KEY_SOUND_SPEAKER_SELECTION, &speaker_value) == VCONF_ERROR) { + debug_error("vconf_get_int(%s) failed..", _VCONF_KEY_SOUND_SPEAKER_SELECTION); + return NULL; + } + + debug_warning("speaker selection value = %d", speaker_value); + if (speaker_value != _AUDIO_TV_OUTPUT_BT_HEADSET) + return NULL; + + device_item = g_malloc0(sizeof(mm_sound_device_t)); + if (!device_item) + return NULL; + + MMSOUND_STRNCPY(device_item->name, "BluetoothMedia", MAX_DEVICE_NAME_NUM); + MMSOUND_STRNCPY(device_item->type, "bt-a2dp", MAX_DEVICE_TYPE_STR_LEN); + device_item->id = 99; + device_item->io_direction = DEVICE_IO_DIRECTION_OUT; + device_item->state = DEVICE_STATE_ACTIVATED; + device_item->vendor_id = -1; + device_item->product_id = -1; + device_item->stream_num = -1; + + return device_item; +} +#endif /* TIZEN_TV */ + int mm_sound_proxy_get_current_connected_device_list(int device_flags, GList** device_list) { int ret = MM_ERROR_NONE; @@ -404,6 +443,17 @@ int mm_sound_proxy_get_current_connected_device_list(int device_flags, GList** d } } + +#ifdef TIZEN_TV + device_item = _get_tv_bt_device(); + if (device_item) { + *device_list = g_list_append(*device_list, device_item); + debug_msg("Added TV bt device id(%d) type(%17s) direction(%d) state(%d) name(%s) vendor-id(%04x) product-id(%04x)", + device_item->id, device_item->type, device_item->io_direction, device_item->state, + device_item->name, device_item->vendor_id, device_item->product_id); + } +#endif /* TIZEN_TV */ + cleanup: if (result) g_variant_unref(result); diff --git a/packaging/libmm-sound.spec b/packaging/libmm-sound.spec index 0afbbb6..8ddeecd 100644 --- a/packaging/libmm-sound.spec +++ b/packaging/libmm-sound.spec @@ -1,6 +1,6 @@ Name: libmm-sound Summary: MMSound Package contains client lib and sound_server binary -Version: 0.12.8 +Version: 0.12.9 Release: 0 Group: System/Libraries License: Apache-2.0