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;
106 unsigned char *data; /* capture image buffer */
107 int size; /* capture image size */
108 MMPlayerVideoColorspace fmt; /* color space type */
109 unsigned int width; /* width of captured image */
110 unsigned int height; /* height of captured image */
111 unsigned int orientation; /* content orientation */
112 } MMPlayerVideoCapture;
120 bool is_little_endian;
121 guint64 channel_mask;
122 } MMPlayerAudioStreamDataType;
125 * Video stream callback function type.
127 * @param stream [in] Reference pointer to video frame data
128 * @param stream_size [in] Size of video frame data
129 * @param user_param [in] User defined parameter which is passed when set
130 * video stream callback
131 * @param width [in] width of video frame
132 * @param height [in] height of video frame
134 * @return This callback function have to return MM_ERROR_NONE.
136 typedef bool (*mm_player_video_stream_callback) (void *stream, void *user_param);
139 * Audio stream callback function type.
141 * @param stream [in] Reference pointer to audio frame data
142 * @param stream_size [in] Size of audio frame data
143 * @param user_param [in] User defined parameter which is passed when set
144 * audio stream callback
146 * @return This callback function have to return MM_ERROR_NONE.
148 typedef bool (*mm_player_video_capture_callback) (void *stream, int stream_size, void *user_param);
151 * Video frame render error callback function type.
153 * @param error_id [in] cause of error
154 * @param user_param [in] User defined parameter which is passed when set
155 * video frame render error callback
157 * @return This callback function have to return MM_ERROR_NONE.
159 typedef bool (*mm_player_video_frame_render_error_callback) (void *error_id, void *user_param);
162 * Audio stream callback function type.
164 * @param stream [in] Reference pointer to audio frame data
165 * @param user_param [in] User defined parameter which is passed when set
166 * audio stream callback
168 * @return This callback function have to return MM_ERROR_NONE.
170 typedef bool (*mm_player_audio_stream_callback_ex) (MMPlayerAudioStreamDataType *stream, void *user_param);
172 * This function is to set play speed for playback.
174 * @param player [in] Handle of player.
175 * @param ratio [in] Speed for playback.
176 * @param streaming [in] If @c true, rate value can be set even if it is streaming playback.
177 * @return This function returns zero on success, or negative value with error
179 * @remark The current supported range is from -64x to 64x.
180 * But, the quailty is dependent on codec performance.
181 * And, the sound is muted under normal speed and more than double speed.
185 int mm_player_set_play_speed(MMHandleType player, float rate, bool streaming);
188 * This function set callback function for receiving video stream from player.
190 * @param player [in] Handle of player.
191 * @param callback [in] Video stream callback function.
192 * @param user_param [in] User parameter.
194 * @return This function returns zero on success, or negative value with error
197 * @see mm_player_video_stream_callback mm_player_set_audio_stream_callback
200 int mm_player_set_video_stream_callback(MMHandleType player, mm_player_video_stream_callback callback, void *user_param);
203 * This function set callback function for receiving audio stream from player.
205 * @param player [in] Handle of player.
206 * @param sync [in] sync Sync on the clock.
207 * @param callback [in] audio stream callback function.
208 * @param user_param [in] User parameter.
210 * @return This function returns zero on success, or negative value with error
213 * @see mm_player_audio_stream_callback_ex
216 int mm_player_set_audio_stream_callback_ex(MMHandleType player, bool sync, mm_player_audio_stream_callback_ex callback, void *user_param);
219 * This function is to capture video frame.
221 * @param player [in] Handle of player.
223 * @return This function returns zero on success, or negative value with error
226 * @remark Captured buffer is sent asynchronously through message callback with MM_MESSAGE_VIDEO_CAPTURED.
227 * And, application should free the captured buffer directly.
228 * @see MM_MESSAGE_VIDEO_CAPTURED
231 int mm_player_do_video_capture(MMHandleType player);
234 * This function set callback function for putting data into player.
236 * @param player [in] Handle of player.
237 * @param buf [in] data to push into player
238 * @param size [in] buffer size to push
240 * @return This function returns zero on success, or negative value with error
246 int mm_player_push_buffer(MMHandleType player, unsigned char *buf, int size);
249 * This function changes the previous videosink plugin for a new one
251 * @param player [in] Handle of player.
252 * @param display_surface_type [in] display surface type to set
253 * @param display_overlay [in] display overlay to set
255 * @return This function returns zero on success, or negative value with error
261 int mm_player_change_videosink(MMHandleType player, MMDisplaySurfaceType display_surface_type, void *display_overlay);
264 * This function is to set pcm spec.
266 * @param player [in] Handle of player.
267 * @param samplerate [in] Samplerate.
268 * @param channel [in] Channel.
270 * @return This function returns zero on success, or negative value with error
274 int mm_player_set_pcm_spec(MMHandleType player, int samplerate, int channel);
284 #endif /* __MM_PLAYER_INTERNAL_H__ */