Modify stream stop API to prevent segfault
[platform/core/api/sound-pool.git] / include / internal / priority.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef __TIZEN_SOUNDPOOL_INTERNAL_PRIORITY_H_
18 #define __TIZEN_SOUNDPOOL_INTERNAL_PRIORITY_H_
19
20 #include "sound_pool_private.h"
21 #include "internal/stream.h"
22
23 #include <glib.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 /**
30  * @brief Pool Priority Manager type.
31  *
32  * @since_tizen 3.0
33  */
34 struct stream_priority_manager_s {
35         sound_pool_t *pool;
36         GList *priority_queue;
37 };
38
39 sound_pool_error_e _sound_stream_priority_create(sound_pool_t *pool,
40                 stream_priority_manager_t **mgr);
41
42 sound_pool_error_e _sound_stream_priority_destroy(
43                 stream_priority_manager_t *mgr);
44
45 sound_pool_error_e _sound_stream_priority_add_stream(
46                 stream_priority_manager_t *mgr, sound_stream_t *stream);
47
48 sound_pool_error_e _sound_stream_priority_remove_stream(
49                 stream_priority_manager_t *mgr, sound_stream_t *stream);
50
51 sound_pool_error_e _sound_stream_priority_check(stream_priority_manager_t *mgr,
52                 sound_stream_t *stream, gboolean *out);
53
54 void _sound_stream_priority_update_playback(stream_priority_manager_t *mgr);
55
56 #ifdef __cplusplus
57 }
58 #endif /* __cplusplus */
59
60 #endif /* __TIZEN_SOUNDPOOL_INTERNAL_PRIORITY_H_ */