4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>, YeJin Cho <cho.yejin@samsung.com>,
7 * Seungbae Shin <seungbae.shin@samsung.com>, YoungHwan An <younghwan_.an@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 #ifndef __MM_WFD_SINK_MANAGER_H__
24 #define __MM_WFD_SINK_MANAGER_H__
26 /*=======================================================================================
28 ========================================================================================*/
29 #include "mm_wfd_sink_priv.h"
30 #include "mm_wfd_sink_util.h"
36 #define WFD_SINK_MANAGER_LOCK(wfd_sink) \
40 g_mutex_lock (&((wfd_sink)->manager_thread_mutex));\
44 #define WFD_SINK_MANAGER_UNLOCK(wfd_sink) \
48 g_mutex_unlock (&((wfd_sink)->manager_thread_mutex));\
52 #define WFD_SINK_MANAGER_WAIT_CMD(wfd_sink) \
54 wfd_sink_debug ("manager thread is waiting for command signal\n");\
55 wfd_sink->waiting_cmd = TRUE; \
56 g_cond_wait (&((wfd_sink)->manager_thread_cond), &((wfd_sink)->manager_thread_mutex)); \
57 wfd_sink->waiting_cmd = FALSE; \
60 #define WFD_SINK_MANAGER_SIGNAL_CMD(wfd_sink, cmd) \
62 if (wfd_sink->manager_thread_cmd != WFD_SINK_MANAGER_CMD_EXIT)\
64 wfd_sink->manager_thread_cmd |= cmd;\
65 if (wfd_sink->waiting_cmd)\
67 wfd_sink_debug ("send command signal to manager thread with %x command\n", &(wfd_sink->manager_thread_cmd));\
68 g_cond_signal (&((wfd_sink)->manager_thread_cond));\
74 * This function is to initialize manager
76 * @param[in] handle Handle of wfd_sink.
77 * @return This function returns zero on success, or negative value with errors.
82 int _mm_wfd_sink_init_manager(mm_wfd_sink_t *wfd_sink);
84 * This function is to release manager
86 * @param[in] handle Handle of wfd_sink.
87 * @return This function returns zero on success, or negative value with errors.
92 int _mm_wfd_sink_release_manager(mm_wfd_sink_t* wfd_sink);