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_hdmi.h"
42 #include "include/mm_sound_mgr_session.h"
44 /******************************* HDMI Code **********************************/
49 #include <vconf-keys.h>
52 /* HDMI status value from system server */
53 static void _hdmi_status_changed_cb(keynode_t* node, void* data)
55 int hdmi_available = 0;
57 /* Get actual vconf value */
58 vconf_get_int(VCONFKEY_SYSMAN_HDMI, &hdmi_available);
60 debug_msg ("[%s] changed callback called\n", vconf_keynode_get_name(node));
61 debug_msg ("HDMI : [%s]=[%d]\n",
62 VCONFKEY_SYSMAN_HDMI, hdmi_available);
64 MMSoundMgrSessionSetDeviceAvailable (DEVICE_HDMI, hdmi_available, 0, NULL);
67 static int _register_hdmi_status(void)
69 /* set callback for vconf key change */
70 int ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_HDMI, _hdmi_status_changed_cb, NULL);
71 debug_msg ("vconf [%s] set ret = [%d]\n", VCONFKEY_SYSMAN_HDMI, ret);
75 int MMSoundMgrHdmiInit(void)
79 if (_register_hdmi_status() != 0) {
80 debug_error ("Registering hdmi status failed\n");
81 return MM_ERROR_SOUND_INTERNAL;
88 int MMSoundMgrHdmiFini(void)