4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Seungbae Shin <seungbae.shin@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
35 #include "include/mm_sound_mgr_common.h"
36 #include "../include/mm_sound_common.h"
41 #include "include/mm_sound_mgr_wfd.h"
42 #include "include/mm_sound_mgr_session.h"
44 /******************************* WFD Code **********************************/
49 #include <vconf-keys.h>
52 /* WFD status value */
53 static void _miracast_wfd_status_changed_cb(keynode_t* node, void* data)
55 int miracast_wfd_status = 0;
57 /* Get actual vconf value */
58 vconf_get_bool(VCONFKEY_MIRACAST_WFD_SOURCE_STATUS, &miracast_wfd_status);
59 debug_msg ("[%s] changed callback called, status=[%d]\n", vconf_keynode_get_name(node), miracast_wfd_status);
61 MMSoundMgrSessionSetDeviceAvailable (DEVICE_WFD, miracast_wfd_status, 0, NULL);
64 static int _register_wfd_status(void)
66 /* set callback for vconf key change */
67 int ret = vconf_notify_key_changed(VCONFKEY_MIRACAST_WFD_SOURCE_STATUS, _miracast_wfd_status_changed_cb, NULL);
68 debug_msg ("vconf [%s] set ret = [%d]\n", VCONFKEY_MIRACAST_WFD_SOURCE_STATUS, ret);
72 int MMSoundMgrWfdInit(void)
76 if (_register_wfd_status() != 0) {
77 debug_error ("Registering WFD status failed\n");
78 return MM_ERROR_SOUND_INTERNAL;
85 int MMSoundMgrWfdFini(void)