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 MM_PLAYER_COLORSPACE_BGRx, /**< BGRx pixel format */
104 MM_PLAYER_COLORSPACE_MAX = 0x7FFFFFFF
105 } MMPlayerVideoColorspace;
108 unsigned char *data; /* capture image buffer */
109 int size; /* capture image size */
110 MMPlayerVideoColorspace fmt; /* color space type */
111 unsigned int width; /* width of captured image */
112 unsigned int height; /* height of captured image */
113 unsigned int orientation; /* content orientation */
114 } 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.
178 * @param streaming [in] If @c true, rate value can be set even if it is streaming 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, bool streaming);
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 is to capture video frame.
223 * @param player [in] Handle of player.
225 * @return This function returns zero on success, or negative value with error
228 * @remark Captured buffer is sent asynchronously through message callback with MM_MESSAGE_VIDEO_CAPTURED.
229 * And, application should free the captured buffer directly.
230 * @see MM_MESSAGE_VIDEO_CAPTURED
233 int mm_player_do_video_capture(MMHandleType player);
236 * This function changes the previous videosink plugin for a new one
238 * @param player [in] Handle of player.
239 * @param display_surface_type [in] display surface type to set
240 * @param display_overlay [in] display overlay to set
242 * @return This function returns zero on success, or negative value with error
248 int mm_player_change_videosink(MMHandleType player, MMDisplaySurfaceType display_surface_type, void *display_overlay);
251 * This function is to set pcm spec.
253 * @param player [in] Handle of player.
254 * @param samplerate [in] Samplerate.
255 * @param channel [in] Channel.
257 * @return This function returns zero on success, or negative value with error
261 int mm_player_set_pcm_spec(MMHandleType player, int samplerate, int channel);
271 #endif /* __MM_PLAYER_INTERNAL_H__ */