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;
122 bool is_little_endian;
123 guint64 channel_mask;
124 }MMPlayerAudioStreamDataType;
127 * Video stream callback function type.
129 * @param stream [in] Reference pointer to video frame data
130 * @param stream_size [in] Size of video frame data
131 * @param user_param [in] User defined parameter which is passed when set
132 * video stream callback
133 * @param width [in] width of video frame
134 * @param height [in] height of video frame
136 * @return This callback function have to return MM_ERROR_NONE.
138 typedef bool (*mm_player_video_stream_callback) (void *stream, void *user_param);
141 * Audio stream callback function type.
143 * @param stream [in] Reference pointer to audio frame data
144 * @param stream_size [in] Size of audio frame data
145 * @param user_param [in] User defined parameter which is passed when set
146 * audio stream callback
148 * @return This callback function have to return MM_ERROR_NONE.
150 typedef bool (*mm_player_video_capture_callback) (void *stream, int stream_size, void *user_param);
153 * Video frame render error callback function type.
155 * @param error_id [in] cause of error
156 * @param user_param [in] User defined parameter which is passed when set
157 * video frame render error callback
159 * @return This callback function have to return MM_ERROR_NONE.
161 typedef bool (*mm_player_video_frame_render_error_callback) (void *error_id, void *user_param);
164 * Audio stream callback function type.
166 * @param stream [in] Reference pointer to audio frame data
167 * @param user_param [in] User defined parameter which is passed when set
168 * audio stream callback
170 * @return This callback function have to return MM_ERROR_NONE.
172 typedef bool (*mm_player_audio_stream_callback_ex) (MMPlayerAudioStreamDataType *stream, void *user_param);
174 * This function is to set play speed for playback.
176 * @param player [in] Handle of player.
177 * @param ratio [in] Speed for playback.
179 * @return This function returns zero on success, or negative value with error
181 * @remark The current supported range is from -64x to 64x.
182 * But, the quailty is dependent on codec performance.
183 * And, the sound is muted under normal speed and more than double speed.
187 int mm_player_set_play_speed(MMHandleType player, float rate);
190 * This function set callback function for receiving video stream from player.
192 * @param player [in] Handle of player.
193 * @param callback [in] Video stream callback function.
194 * @param user_param [in] User parameter.
196 * @return This function returns zero on success, or negative value with error
199 * @see mm_player_video_stream_callback mm_player_set_audio_stream_callback
202 int mm_player_set_video_stream_callback(MMHandleType player, mm_player_video_stream_callback callback, void *user_param);
205 * This function set callback function for receiving audio stream from player.
207 * @param player [in] Handle of player.
208 * @param sync [in] sync Sync on the clock.
209 * @param callback [in] audio stream callback function.
210 * @param user_param [in] User parameter.
212 * @return This function returns zero on success, or negative value with error
215 * @see mm_player_audio_stream_callback_ex
218 int mm_player_set_audio_stream_callback_ex(MMHandleType player, bool sync, mm_player_audio_stream_callback_ex callback, void *user_param);
221 * This function set callback function for rendering error information of video render plug-in.
223 * @param player [in] Handle of player.
224 * @param callback [in] Frame render error callback function.
225 * @param user_param [in] User parameter which is passed to callback function.
227 * @return This function returns zero on success, or negative value with error code.
234 int mm_player_set_video_frame_render_error_callback(MMHandleType player, mm_player_video_frame_render_error_callback callback, void *user_param);
237 * This function is to capture video frame.
239 * @param player [in] Handle of player.
241 * @return This function returns zero on success, or negative value with error
244 * @remark Captured buffer is sent asynchronously through message callback with MM_MESSAGE_VIDEO_CAPTURED.
245 * And, application should free the captured buffer directly.
246 * @see MM_MESSAGE_VIDEO_CAPTURED
249 int mm_player_do_video_capture(MMHandleType player);
252 * This function set callback function for putting data into player.
254 * @param player [in] Handle of player.
255 * @param buf [in] data to push into player
256 * @param size [in] buffer size to push
258 * @return This function returns zero on success, or negative value with error
264 int mm_player_push_buffer(MMHandleType player, unsigned char *buf, int size);
267 * This function changes the previous videosink plugin for a new one
269 * @param player [in] Handle of player.
270 * @param display_surface_type [in] display surface type to set
271 * @param display_overlay [in] display overlay to set
273 * @return This function returns zero on success, or negative value with error
279 int mm_player_change_videosink(MMHandleType player, MMDisplaySurfaceType display_surface_type, void *display_overlay);
282 * This function is to set pcm spec.
284 * @param player [in] Handle of player.
285 * @param samplerate [in] Samplerate.
286 * @param channel [in] Channel.
288 * @return This function returns zero on success, or negative value with error
292 int mm_player_set_pcm_spec(MMHandleType player, int samplerate, int channel);
302 #endif /* __MM_PLAYER_INTERNAL_H__ */