Do not raise() inside signal handler
[platform/core/multimedia/libmm-session.git] / mm_session_private.h
1 /*
2  * libmm-session
3  *
4  * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Seungbae Shin <seungbae.shin at samsung.com>, Sangchul Lee <sc11.lee at samsung.com>
7  *
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
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
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.
19  *
20  */
21
22 /**
23  * This file declares common data structure of multimedia framework.
24  *
25  * @file                mm_session_private.h
26  * @author
27  * @version             1.0
28  * @brief               This file declares multimedia framework session type.
29  */
30 #ifndef _MM_SESSION_PRIVATE_H_
31 #define _MM_SESSION_PRIVATE_H_
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #include <mm_session.h>
38 #include <stdbool.h>
39
40 /* This private definition is for marking that this process is using the stream info. created by sound-manager.
41  * It'll be maintained for backward compatibility regarding session feature that is deprecated since tizen 3.0. */
42 #define MM_SESSION_TYPE_REPLACED_BY_STREAM    1111
43
44 typedef enum {
45         MM_SUBSESSION_TYPE_VOICE = 0,
46         MM_SUBSESSION_TYPE_RINGTONE,
47         MM_SUBSESSION_TYPE_MEDIA,
48         MM_SUBSESSION_TYPE_INIT,
49         MM_SUBSESSION_TYPE_VR_NORMAL,
50         MM_SUBSESSION_TYPE_VR_DRIVE,
51         MM_SUBSESSION_TYPE_RECORD_STEREO,
52         MM_SUBSESSION_TYPE_RECORD_MONO,
53         MM_SUBSESSION_TYPE_NUM
54 } mm_subsession_t;
55
56 typedef enum {
57         MM_SUBSESSION_OPTION_NONE = 0,
58         MM_SUBSESSION_OPTION_NUM
59         /* NOTE : Do not exceed 15, because of using mm_subsession_option_priv_t type with it internally */
60 } mm_subsession_option_t;
61
62 typedef enum {
63         MM_SESSION_SUB_TYPE_NONE = 0,
64         MM_SESSION_SUB_TYPE_SHARE,
65         MM_SESSION_SUB_TYPE_EXCLUSIVE
66 } mm_session_sub_t;
67
68
69 /**
70  * This function delete session information to system
71  *
72  * @param       app_pid [in] Application pid (if -1, use caller process)
73  * @return      This function returns MM_ERROR_NONE on success, or negative value
74  *                      with error code.
75  * @remark      This function is only for internal implementation do not use this at application
76  * @see         _mm_session_util_write_type _mm_session_util_read_type _mm_session_util_write_information _mm_session_util_read_information
77  * @since
78  */
79 int _mm_session_util_delete_information(int app_pid);
80
81
82 /**
83  * This function write session type information to system
84  *
85  * @param       app_pid [in] Application pid (if -1, use caller process)
86  * @param       sessiontype     [in] Multimedia Session type
87  *
88  * @return      This function returns MM_ERROR_NONE on success, or negative value
89  *                      with error code.
90  * @remark      This function is only for internal implementation do not use this at application
91  *                      Session type is unique for each application.
92  *                      if application want to change session type, Finish session first and Init again
93  * @see         _mm_session_util_delete_information _mm_session_util_read_type
94  * @since
95  */
96 int _mm_session_util_write_type(int app_pid, int sessiontype);
97
98
99 /**
100  * This function read session type information from system
101  *
102  * @param       app_pid [in] Application pid (if -1, use caller process)
103  * @param       sessiontype     [out] Multimedia Session type
104  *
105  * @return      This function returns MM_ERROR_NONE on success, or negative value
106  *                      with error code.
107  * @remark      Session type is unique for each application.
108  *                      if application want to change session type, Finish session first and Init again
109  * @see         _mm_session_util_write_type _mm_session_util_delete_information
110  * @since
111  */
112 int _mm_session_util_read_type(int app_pid, int *sessiontype);
113
114
115 /**
116  * This function write session information to system
117  *
118  * @param       app_pid [in] Application pid (if -1, use caller process)
119  * @param       session_type    [in] Multimedia Session type
120  * @param       flags   [in] Multimedia Session options
121  *
122  * @return      This function returns MM_ERROR_NONE on success, or negative value
123  *                      with error code.
124  * @remark      This function is only for internal implementation do not use this at application
125  *                      Session type and Session option are unique for each application.
126  * @see         _mm_session_util_delete_information _mm_session_util_read_information
127  * @since
128  */
129 int _mm_session_util_write_information(int app_pid, int session_type, int flags);
130
131
132 /**
133  * This function read session information from system
134  *
135  * @param       app_pid [in] Application pid (if -1, use caller process)
136  * @param       sessiontype     [out] Multimedia Session type
137  * @param       flags   [out] Multimedia Session options
138  * @return      This function returns MM_ERROR_NONE on success, or negative value
139  *                      with error code.
140  * @remark      Session type is unique for each application.
141  * @see         _mm_session_util_write_information _mm_session_util_delete_information
142  * @since
143  */
144 int _mm_session_util_read_information(int app_pid, int *session_type, int *flags);
145
146 #ifdef __cplusplus
147 }
148 #endif
149
150 #endif