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