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>,
7 * Seungbae Shin <seungbae.shin@samsung.com>, YoungHwan An <younghwan_.an@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 #ifndef __MM_PLAYER_INTERNAL_H__
24 #define __MM_PLAYER_INTERNAL_H__
33 @addtogroup PLAYER-INTERNAL
42 <td>DEFAULT VALUE</td>
45 <td>"display_roi_x"</td>
51 <td>"display_roi_y"</td>
57 <td>"display_roi_width"</td>
63 <td>"display_roi_height"</td>
69 <td>"display_method"</td>
72 <td>MM_DISPLAY_METHOD_LETTER_BOX</td>
75 <td>"sound_volume_type"</td>
78 <td>MM_SOUND_VOLUME_TYPE_CALL</td>
81 <td>"sound_route"</td>
84 <td>MM_AUDIOROUTE_USE_EXTERNAL_SETTING</td>
87 <td>"sound_stop_when_unplugged"</td>
96 * Enumerations of video colorspace
99 MM_PLAYER_COLORSPACE_I420 = 0, /**< I420 format - planer */
100 MM_PLAYER_COLORSPACE_RGB888, /**< RGB888 pixel format */
101 MM_PLAYER_COLORSPACE_NV12_TILED, /**< Customized color format */
102 MM_PLAYER_COLORSPACE_NV12,
103 }MMPlayerVideoColorspace;
107 unsigned char *data; /* capture image buffer */
108 int size; /* capture image size */
109 MMPlayerVideoColorspace fmt; /* color space type */
110 unsigned int width; /* width of captured image */
111 unsigned int height; /* height of captured image */
112 unsigned int orientation; /* content orientation */
113 }MMPlayerVideoCapture;
116 * Buffer need data callback function type.
118 * @param size [in] size required for the buffer playback
119 * @param user_param [in] User defined parameter which is passed when set
120 * to need data callback
122 * @return This callback function have to return MM_ERROR_NONE.
124 typedef bool (*mm_player_buffer_need_data_callback) (unsigned int size, void *user_param);
127 * Buffer enough data callback function type.
129 * @param user_param [in] User defined parameter which is passed when set
130 * to enough data callback
132 * @return This callback function have to return MM_ERROR_NONE.
134 typedef bool (*mm_player_buffer_enough_data_callback) (void *user_param);
137 * Buffer seek data callback function type.
139 * @param offset [in] offset for the buffer playback
140 * @param user_param [in] User defined parameter which is passed when set
141 * to seek data callback
143 * @return This callback function have to return MM_ERROR_NONE.
145 typedef bool (*mm_player_buffer_seek_data_callback) (unsigned long long offset, void *user_param);
148 * Video stream callback function type.
150 * @param stream [in] Reference pointer to video frame data
151 * @param stream_size [in] Size of video frame data
152 * @param user_param [in] User defined parameter which is passed when set
153 * video stream callback
154 * @param width [in] width of video frame
155 * @param height [in] height of video frame
157 * @return This callback function have to return MM_ERROR_NONE.
159 typedef bool (*mm_player_video_stream_callback) (void *stream, void *user_param);
162 * Audio stream callback function type.
164 * @param stream [in] Reference pointer to audio frame data
165 * @param stream_size [in] Size of audio frame data
166 * @param user_param [in] User defined parameter which is passed when set
167 * audio stream callback
169 * @return This callback function have to return MM_ERROR_NONE.
171 typedef bool (*mm_player_video_capture_callback) (void *stream, int stream_size, void *user_param);
174 * Video frame render error callback function type.
176 * @param error_id [in] cause of error
177 * @param user_param [in] User defined parameter which is passed when set
178 * video frame render error callback
180 * @return This callback function have to return MM_ERROR_NONE.
182 typedef bool (*mm_player_video_frame_render_error_callback) (void *error_id, void *user_param);
185 * This function is to set play speed for playback.
187 * @param player [in] Handle of player.
188 * @param ratio [in] Speed for playback.
190 * @return This function returns zero on success, or negative value with error
192 * @remark The current supported range is from -64x to 64x.
193 * But, the quailty is dependent on codec performance.
194 * And, the sound is muted under normal speed and more than double speed.
198 int mm_player_set_play_speed(MMHandleType player, float rate);
201 * This function set callback function for receiving video stream from player.
203 * @param player [in] Handle of player.
204 * @param callback [in] Video stream callback function.
205 * @param user_param [in] User parameter.
207 * @return This function returns zero on success, or negative value with error
210 * @see mm_player_video_stream_callback mm_player_set_audio_stream_callback
213 int mm_player_set_video_stream_callback(MMHandleType player, mm_player_video_stream_callback callback, void *user_param);
216 * This function is to capture video frame.
218 * @param player [in] Handle of player.
220 * @return This function returns zero on success, or negative value with error
223 * @remark Captured buffer is sent asynchronously through message callback with MM_MESSAGE_VIDEO_CAPTURED.
224 * And, application should free the captured buffer directly.
225 * @see MM_MESSAGE_VIDEO_CAPTURED
228 int mm_player_do_video_capture(MMHandleType player);
231 * This function set callback function for receiving need data message from player.
233 * @param player [in] Handle of player.
234 * @param callback [in] Need data callback function.
235 * @param user_param [in] User parameter.
237 * @return This function returns zero on success, or negative value with error
240 * @see mm_player_set_buffer_enough_data_callback
243 int mm_player_set_buffer_need_data_callback(MMHandleType player, mm_player_buffer_need_data_callback callback , void *user_param);
246 * This function set callback function for receiving enough data message from player.
248 * @param player [in] Handle of player.
249 * @param callback [in] Enough data callback function.
250 * @param user_param [in] User parameter.
252 * @return This function returns zero on success, or negative value with error
255 * @see mm_player_set_buffer_need_data_callback
258 int mm_player_set_buffer_enough_data_callback(MMHandleType player, mm_player_buffer_enough_data_callback callback, void *user_param);
261 * This function set callback function for receiving seek data message from player.
263 * @param player [in] Handle of player.
264 * @param callback [in] Seek data callback function.
265 * @param user_param [in] User parameter.
267 * @return This function returns zero on success, or negative value with error
273 int mm_player_set_buffer_seek_data_callback(MMHandleType player, mm_player_buffer_seek_data_callback callback, void *user_param);
276 * This function set callback function for putting data into player.
278 * @param player [in] Handle of player.
279 * @param buf [in] data to push into player
280 * @param size [in] buffer size to push
282 * @return This function returns zero on success, or negative value with error
288 int mm_player_push_buffer(MMHandleType player, unsigned char *buf, int size);
291 * This function changes the previous videosink plugin for a new one
293 * @param player [in] Handle of player.
294 * @param display_surface_type [in] display surface type to set
295 * @param display_overlay [in] display overlay to set
297 * @return This function returns zero on success, or negative value with error
303 int mm_player_change_videosink(MMHandleType player, MMDisplaySurfaceType display_surface_type, void *display_overlay);
313 #endif /* __MM_PLAYER_INTERNAL_H__ */