4 * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Sangchul Lee <sc11.lee@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.
22 #ifndef __MM_SOUND_FOCUS_PRIVATE_H__
23 #define __MM_SOUND_FOCUS_PRIVATE_H__
25 #include "mm_sound_common.h"
26 #include "mm_sound_stream.h"
27 #include "mm_sound_focus.h"
29 #define FOCUS_HANDLE_MAX 512
30 #define FOCUS_HANDLE_INIT_VAL -1
32 typedef struct _FocusSource {
46 GThread *focus_cb_thread;
47 GThread *focus_watch_cb_thread;
48 GMainLoop *focus_loop;
49 mm_sound_focus_changed_cb focus_callback;
50 mm_sound_focus_changed_watch_cb watch_callback;
52 bool unset_watch_callback_requested;
60 char stream_type[MAX_STREAM_TYPE_LEN];
61 char ext_info[MM_SOUND_NAME_NUM];
65 typedef gboolean(*focus_callback_handler_t)(gpointer user_data);
66 extern focus_sound_info_t g_focus_sound_handle[FOCUS_HANDLE_MAX];
68 int focus_find_empty_index(int *handle);
69 int focus_find_index_by_handle(int handle);
70 int focus_watch_find_index_by_handle(int handle);
72 int focus_init_context(int index, bool is_for_watching);
73 void focus_deinit_context(int index, bool is_for_watching);
74 void focus_init_callback(int index, bool is_for_watching);
75 void focus_deinit_callback(int index, bool is_for_watching);
77 #endif /* __MM_SOUND_FOCUS_PRIVATE_H__ */