4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>, YeJin Cho <cho.yejin@samsung.com>, YoungHwan An <younghwan_.an@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.
22 #ifndef __MM_PLAYER_INTERNAL_H__
23 #define __MM_PLAYER_INTERNAL_H__
32 @addtogroup PLAYER-INTERNAL
41 <td>DEFAULT VALUE</td>
44 <td>"display_roi_x"</td>
50 <td>"display_roi_y"</td>
56 <td>"display_roi_width"</td>
62 <td>"display_roi_height"</td>
68 <td>"display_method"</td>
71 <td>MM_DISPLAY_METHOD_LETTER_BOX</td>
74 <td>"sound_volume_type"</td>
77 <td>MM_SOUND_VOLUME_TYPE_CALL</td>
80 <td>"sound_route"</td>
83 <td>MM_AUDIOROUTE_USE_EXTERNAL_SETTING</td>
86 <td>"sound_stop_when_unplugged"</td>
95 * Enumerations of video colorspace
98 MM_PLAYER_COLORSPACE_I420 = 0, /**< I420 format - planer */
99 MM_PLAYER_COLORSPACE_RGB888, /**< RGB888 pixel format */
100 MM_PLAYER_COLORSPACE_NV12_TILED, /**< Customized color format in s5pc110 */
101 }MMPlayerVideoColorspace;
105 unsigned char *data; /* capture image buffer */
106 int size; /* capture image size */
107 MMPlayerVideoColorspace fmt; /* color space type */
108 } MMPlayerVideoCapture;
111 * Buffer need data callback function type.
113 * @param size [in] size required for the buffer playback
114 * @param user_param [in] User defined parameter which is passed when set
115 * to need data callback
117 * @return This callback function have to return MM_ERROR_NONE.
119 typedef bool (*mm_player_buffer_need_data_callback) (unsigned int size, void *user_param);
122 * Buffer enough data callback function type.
124 * @param user_param [in] User defined parameter which is passed when set
125 * to enough data callback
127 * @return This callback function have to return MM_ERROR_NONE.
129 typedef bool (*mm_player_buffer_enough_data_callback) (void *user_param);
132 * Buffer seek data callback function type.
134 * @param offset [in] offset for the buffer playback
135 * @param user_param [in] User defined parameter which is passed when set
136 * to seek data callback
138 * @return This callback function have to return MM_ERROR_NONE.
140 typedef bool (*mm_player_buffer_seek_data_callback) (unsigned long long offset, void *user_param);
143 * Video stream callback function type.
145 * @param stream [in] Reference pointer to video frame data
146 * @param stream_size [in] Size of video frame data
147 * @param user_param [in] User defined parameter which is passed when set
148 * video stream callback
149 * @param width [in] width of video frame
150 * @param height [in] height of video frame
152 * @return This callback function have to return MM_ERROR_NONE.
154 typedef bool (*mm_player_video_stream_callback) (void *stream, int stream_size, void *user_param, int width, int height);
157 * Audio stream callback function type.
159 * @param stream [in] Reference pointer to audio frame data
160 * @param stream_size [in] Size of audio frame data
161 * @param user_param [in] User defined parameter which is passed when set
162 * audio stream callback
164 * @return This callback function have to return MM_ERROR_NONE.
166 typedef bool (*mm_player_video_capture_callback) (void *stream, int stream_size, void *user_param);
169 * This function is to set play speed for playback.
171 * @param player [in] Handle of player.
172 * @param ratio [in] Speed for playback.
174 * @return This function returns zero on success, or negative value with error
176 * @remark The current supported range is from -64x to 64x.
177 * But, the quailty is dependent on codec performance.
178 * And, the sound is muted under normal speed and more than double speed.
182 int mm_player_set_play_speed(MMHandleType player, float rate);
185 * This function set callback function for receiving video stream from player.
187 * @param player [in] Handle of player.
188 * @param callback [in] Video stream callback function.
189 * @param user_param [in] User parameter.
191 * @return This function returns zero on success, or negative value with error
194 * @see mm_player_video_stream_callback mm_player_set_audio_stream_callback
197 int mm_player_set_video_stream_callback(MMHandleType player, mm_player_video_stream_callback callback, void *user_param);
200 * This function set callback function for receiving audio stream from player.
202 * @param player [in] Handle of player.
203 * @param callback [in] Audio buffer callback function.
204 * @param user_param [in] User parameter.
206 * @return This function returns zero on success, or negative value with error
208 * @remark It can be used for audio playback only.
209 * @see mm_player_audio_stream_callback
212 int mm_player_set_audio_buffer_callback(MMHandleType player, mm_player_audio_stream_callback callback, void *user_param);
215 * This function is to capture video frame.
217 * @param player [in] Handle of player.
219 * @return This function returns zero on success, or negative value with error
222 * @remark Captured buffer is sent asynchronously through message callback with MM_MESSAGE_VIDEO_CAPTURED.
223 * And, application should free the captured buffer directly.
224 * @see MM_MESSAGE_VIDEO_CAPTURED
227 int mm_player_do_video_capture(MMHandleType player);
230 * This function set callback function for receiving need data message from player.
232 * @param player [in] Handle of player.
233 * @param callback [in] Need data callback function.
234 * @param user_param [in] User parameter.
236 * @return This function returns zero on success, or negative value with error
239 * @see mm_player_set_buffer_enough_data_callback
242 int mm_player_set_buffer_need_data_callback(MMHandleType player, mm_player_buffer_need_data_callback callback , void *user_param);
245 * This function set callback function for receiving enough data message from player.
247 * @param player [in] Handle of player.
248 * @param callback [in] Enough data callback function.
249 * @param user_param [in] User parameter.
251 * @return This function returns zero on success, or negative value with error
254 * @see mm_player_set_buffer_need_data_callback
257 int mm_player_set_buffer_enough_data_callback(MMHandleType player, mm_player_buffer_enough_data_callback callback, void *user_param);
260 * This function set callback function for receiving seek data message from player.
262 * @param player [in] Handle of player.
263 * @param callback [in] Seek data callback function.
264 * @param user_param [in] User parameter.
266 * @return This function returns zero on success, or negative value with error
272 int mm_player_set_buffer_seek_data_callback(MMHandleType player, mm_player_buffer_seek_data_callback callback, void *user_param);
275 * This function set callback function for putting data into player.
277 * @param player [in] Handle of player.
278 * @param buf [in] data to push into player
279 * @param size [in] buffer size to push
281 * @return This function returns zero on success, or negative value with error
287 int mm_player_push_buffer(MMHandleType player, unsigned char *buf, int size);
298 #endif /* __MM_PLAYER_INTERNAL_H__ */