2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_SOUNDPOOL_INTERNAL_STREAMCBMANAGER_H__
18 #define __TIZEN_SOUNDPOOL_INTERNAL_STREAMCBMANAGER_H__
20 #include "internal/stream.h"
32 * @brief Stream Callback Manager type.
36 struct stream_cb_manager_s {
38 GAsyncQueue *isolator_callback_queue;
40 pthread_t isolator_thread;
41 pthread_mutex_t isolator_data_mutex;
42 pthread_cond_t isolator_data_cond;
43 pthread_cond_t isolator_force_run_cond;
44 gboolean isolator_state_changed;
45 gboolean isolator_loop_run;
46 gboolean isolator_force_run;
49 typedef struct stream_cb_manager_event_data_s {
50 sound_stream_t *stream;
51 sound_pool_stream_state_e state;
52 sound_pool_stream_state_e state_previous;
53 } stream_cb_manager_event_data_t;
55 sound_pool_error_e _stream_cb_manager_create(sound_pool_t *pool, stream_cb_manager_t **cbmgr);
57 sound_pool_error_e _stream_cb_manager_destroy(stream_cb_manager_t *cbmgr);
59 sound_pool_error_e _stream_cb_manager_register_event(stream_cb_manager_t *cbmgr,
60 sound_stream_t *stream);
62 sound_pool_error_e _stream_cb_manager_process_pending_events(stream_cb_manager_t *cbmgr);
64 sound_pool_error_e _stream_cb_manager_signal_completed_events(stream_cb_manager_t *cbmgr);
68 #endif /* __cplusplus */
70 #endif /* __TIZEN_SOUNDPOOL_INTERNAL_STREAMCBMANAGER_H__ */