4 * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Seungbae Shin <seungbae.shin at samsung.com>, Sangchul Lee <sc11.lee at samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
24 * This file declares common data structure of multimedia framework.
29 * @brief This file declares multimedia framework session type.
31 #ifndef _MM_SESSION_H_
32 #define _MM_SESSION_H_
41 This part is describes multimedia framework session type and function
45 * This enumeration defines application's session types.
48 MM_SESSION_TYPE_MEDIA = 0,
49 MM_SESSION_TYPE_MEDIA_RECORD,
50 MM_SESSION_TYPE_ALARM,
51 MM_SESSION_TYPE_NOTIFY,
52 MM_SESSION_TYPE_EMERGENCY,
54 MM_SESSION_TYPE_VIDEOCALL,
56 MM_SESSION_TYPE_VOICE_RECOGNITION,
57 MM_SESSION_TYPE_RECORD_AUDIO,
58 MM_SESSION_TYPE_RECORD_VIDEO,
63 * This enumeration defines behavior of update.
66 MM_SESSION_UPDATE_TYPE_ADD,
67 MM_SESSION_UPDATE_TYPE_REMOVE,
68 MM_SESSION_UPDATE_TYPE_NUM
69 } session_update_type_t;
72 * This define is for session options
74 #define MM_SESSION_OPTION_PAUSE_OTHERS 0x0001
75 #define MM_SESSION_OPTION_UNINTERRUPTIBLE 0x0002
76 #define MM_SESSION_OPTION_RESUME_BY_SYSTEM_OR_MEDIA_PAUSED 0x0010
79 * This function defines application's Multimedia Session policy
81 * @param sessiontype [in] Multimedia Session type
83 * @return This function returns MM_ERROR_NONE on success, or negative value
85 * @remark Session type is unique for each application (each PID actually).
86 * if application want to change session type, Finish session first and Init again
87 * @see MMSessionType mm_session_finish
89 * @pre There should be pre-initialized session type for caller application.
90 * @post A session type of caller application will be defined process widely.
93 #include <mm_session.h>
95 static int _create(void *data)
99 // Initialize Multimedia Session Type
100 ret = mm_session_init(MM_SESSION_TYPE_MEDIA);
103 printf("Can not initialize session \n");
108 static int _terminate(void* data)
112 // Deinitialize Multimedia Session Type
113 ret = mm_session_finish();
116 printf("Can not finish session\n");
124 struct appcore_ops ops = {
126 .terminate = _terminate,
132 return appcore_efl_main(PACKAGE, ..., &ops);
137 int mm_session_init(int sessiontype);
140 * This function finish application's Multimedia Session.
143 * @return This function returns MM_ERROR_NONE on success, or negative value
145 * @remark Session type is unique for each application (each PID actually).
146 * if application want to change session type, Finish session first and Init again
147 * @see mm_session_init
148 * @pre A session type should be initialized for caller application.
149 * @post A session type for caller application will be cleared.
153 #include <mm_session.h>
155 static int _create(void *data)
159 // Initialize Multimedia Session Type
160 ret = mm_session_init(MM_SESSION_TYPE_MEDIA);
163 printf("Can not initialize session \n");
168 static int _terminate(void* data)
172 // Deinitialize Multimedia Session Type
173 ret = mm_session_finish();
176 printf("Can not finish session\n");
184 struct appcore_ops ops = {
186 .terminate = _terminate,
192 return appcore_efl_main(PACKAGE, ..., &ops);
196 int mm_session_finish(void);
199 * This function get current application's Multimedia Session type
201 * @param sessiontype [out] Current Multimedia Session type
202 * @return This function returns MM_ERROR_NONE on success, or negative value
204 * @see mm_session_init
207 int mm_session_get_current_type(int *sessiontype);
210 * This function get current application's Multimedia Session information
212 * @param session_type [out] Current Multimedia Session type
213 * @param session_options [out] Current Multimedia Session options
214 * @return This function returns MM_ERROR_NONE on success, or negative value
219 int mm_session_get_current_information(int *session_type, int *session_options);
222 * This function update application's Multimedia Session options
224 * @param update_type [in] add or remove options
225 * @param session_options [in] Multimedia Session options to be updated
226 * @return This function returns MM_ERROR_NONE on success, or negative value
231 int mm_session_update_option(session_update_type_t update_type, int options);