3fd9555d7969f11660ea02a0949d477edc4735db
[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 typedef enum {
41         MM_SUBSESSION_TYPE_VOICE = 0,
42         MM_SUBSESSION_TYPE_RINGTONE,
43         MM_SUBSESSION_TYPE_MEDIA,
44         MM_SUBSESSION_TYPE_INIT,
45         MM_SUBSESSION_TYPE_VR_NORMAL,
46         MM_SUBSESSION_TYPE_VR_DRIVE,
47         MM_SUBSESSION_TYPE_RECORD_STEREO,
48         MM_SUBSESSION_TYPE_RECORD_MONO,
49         MM_SUBSESSION_TYPE_NUM
50 } mm_subsession_t;
51
52 typedef enum {
53         MM_SUBSESSION_OPTION_NONE = 0,
54         MM_SUBSESSION_OPTION_NUM
55         /* NOTE : Do not exceed 15, because of using mm_subsession_option_priv_t type with it internally */
56 } mm_subsession_option_t;
57
58 typedef enum {
59         MM_SESSION_SUB_TYPE_NONE = 0,
60         MM_SESSION_SUB_TYPE_SHARE,
61         MM_SESSION_SUB_TYPE_EXCLUSIVE
62 } mm_session_sub_t;
63
64
65 /**
66  * This function delete session information to system
67  *
68  * @param       app_pid [in] Application pid (if -1, use caller process)
69  * @return      This function returns MM_ERROR_NONE on success, or negative value
70  *                      with error code.
71  * @remark      This function is only for internal implementation do not use this at application
72  * @see         _mm_session_util_write_type _mm_session_util_read_type _mm_session_util_write_information _mm_session_util_read_information
73  * @since
74  */
75 int _mm_session_util_delete_information(int app_pid);
76
77
78 /**
79  * This function write session type information to system
80  *
81  * @param       app_pid [in] Application pid (if -1, use caller process)
82  * @param       sessiontype     [in] Multimedia Session type
83  *
84  * @return      This function returns MM_ERROR_NONE on success, or negative value
85  *                      with error code.
86  * @remark      This function is only for internal implementation do not use this at application
87  *                      Session type is unique for each application.
88  *                      if application want to change session type, Finish session first and Init again
89  * @see         _mm_session_util_delete_information _mm_session_util_read_type
90  * @since
91  */
92 int _mm_session_util_write_type(int app_pid, int sessiontype);
93
94
95 /**
96  * This function read session type information from system
97  *
98  * @param       app_pid [in] Application pid (if -1, use caller process)
99  * @param       sessiontype     [out] Multimedia Session type
100  *
101  * @return      This function returns MM_ERROR_NONE on success, or negative value
102  *                      with error code.
103  * @remark      Session type is unique for each application.
104  *                      if application want to change session type, Finish session first and Init again
105  * @see         _mm_session_util_write_type _mm_session_util_delete_information
106  * @since
107  */
108 int _mm_session_util_read_type(int app_pid, int *sessiontype);
109
110
111 /**
112  * This function write session information to system
113  *
114  * @param       app_pid [in] Application pid (if -1, use caller process)
115  * @param       session_type    [in] Multimedia Session type
116  * @param       flags   [in] Multimedia Session options
117  *
118  * @return      This function returns MM_ERROR_NONE on success, or negative value
119  *                      with error code.
120  * @remark      This function is only for internal implementation do not use this at application
121  *                      Session type and Session option are unique for each application.
122  * @see         _mm_session_util_delete_information _mm_session_util_read_information
123  * @since
124  */
125 int _mm_session_util_write_information(int app_pid, int session_type, int flags);
126
127
128 /**
129  * This function read session information from system
130  *
131  * @param       app_pid [in] Application pid (if -1, use caller process)
132  * @param       sessiontype     [out] Multimedia Session type
133  * @param       flags   [out] Multimedia Session options
134  * @return      This function returns MM_ERROR_NONE on success, or negative value
135  *                      with error code.
136  * @remark      Session type is unique for each application.
137  * @see         _mm_session_util_write_information _mm_session_util_delete_information
138  * @since
139  */
140 int _mm_session_util_read_information(int app_pid, int *session_type, int *flags);
141
142
143 /**
144  * This function set sub-session type
145  *
146  * @param       subsession [in] subsession type
147  * @param       option  [in] option of subsession type
148  *
149  * @return      This function returns MM_ERROR_NONE on success, or negative value
150  *                      with error code.
151  * @remark      This function is only for internal implementation do not use this at application
152  *                      Session type is unique for each application.
153  * @see         mm_session_get_subsession
154  * @since
155  */
156 int mm_session_set_subsession (mm_subsession_t subsession, mm_subsession_option_t option);
157
158 /**
159  * This function get current sub-session type
160  *
161  * @param       subsession [out] subsession type
162  *
163  * @return      This function returns MM_ERROR_NONE on success, or negative value
164  *                      with error code.
165  * @remark      This function is only for internal implementation do not use this at application
166  *                      Session type is unique for each application.
167  * @see         mm_session_set_subsession
168  * @since
169  */
170 int mm_session_get_subsession (mm_subsession_t *subsession);
171
172 /**
173  * This function set sub-event type
174  *
175  * @param       subevent [in] subevent type
176  *
177  * @return      This function returns MM_ERROR_NONE on success, or negative value
178  *                      with error code.
179  * @remark      This function is only for internal implementation do not use this at application
180  *                      Session type is unique for each application.
181  * @see         mm_session_get_subevent
182  * @since
183  */
184 int mm_session_set_subevent (mm_session_sub_t subevent);
185
186 /**
187  * This function get current sub-event type
188  *
189  * @param       subevent [out] subevent type
190  *
191  * @return      This function returns MM_ERROR_NONE on success, or negative value
192  *                      with error code.
193  * @remark      This function is only for internal implementation do not use this at application
194  *                      Session type is unique for each application.
195  * @see         mm_session_set_subsevnt
196  * @since
197  */
198 int mm_session_get_subevent (mm_session_sub_t *subevent);
199
200 #ifdef __cplusplus
201 }
202 #endif
203
204 #endif