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 * Enumerations of video colorspace
36 MM_PLAYER_COLORSPACE_I420 = 0, /**< I420 format - planer */
37 MM_PLAYER_COLORSPACE_RGB888, /**< RGB888 pixel format */
38 MM_PLAYER_COLORSPACE_NV12_TILED, /**< Customized color format */
39 MM_PLAYER_COLORSPACE_NV12,
40 MM_PLAYER_COLORSPACE_BGRx, /**< BGRx pixel format */
41 MM_PLAYER_COLORSPACE_MAX = 0x7FFFFFFF
42 } mmplayer_video_color_space_e;
45 unsigned char *data; /* capture image buffer */
46 int size; /* capture image size */
47 mmplayer_video_color_space_e fmt; /* color space type */
48 unsigned int width; /* width of captured image */
49 unsigned int height; /* height of captured image */
50 unsigned int orientation; /* content orientation */
51 } mmplayer_video_capture_t;
59 bool is_little_endian;
61 } mmplayer_audio_decoded_data_info_t;
64 * Video stream callback function type.
66 * @param stream [in] Reference pointer to video frame data
67 * @param stream_size [in] Size of video frame data
68 * @param user_param [in] User defined parameter which is passed when set
69 * video stream callback
70 * @param width [in] width of video frame
71 * @param height [in] height of video frame
73 * @return This callback function have to return MM_ERROR_NONE.
75 typedef bool (*mm_player_video_stream_callback)(void *stream, void *user_param);
78 * Audio stream callback function type.
80 * @param stream [in] Reference pointer to audio frame data
81 * @param stream_size [in] Size of audio frame data
82 * @param user_param [in] User defined parameter which is passed when set
83 * audio stream callback
85 * @return This callback function have to return MM_ERROR_NONE.
87 typedef bool (*mm_player_video_capture_callback)(void *stream, int stream_size, void *user_param);
90 * Video frame render error callback function type.
92 * @param error_id [in] cause of error
93 * @param user_param [in] User defined parameter which is passed when set
94 * video frame render error callback
96 * @return This callback function have to return MM_ERROR_NONE.
98 typedef bool (*mm_player_video_frame_render_error_callback)(void *error_id, void *user_param);
101 * Audio stream callback function type.
103 * @param stream [in] Reference pointer to audio frame data
104 * @param user_param [in] User defined parameter which is passed when set
105 * audio stream callback
107 * @return This callback function have to return MM_ERROR_NONE.
109 typedef bool (*mm_player_audio_stream_callback)(mmplayer_audio_decoded_data_info_t *stream, void *user_param);
111 * This function is to set play speed for playback.
113 * @param player [in] Handle of player.
114 * @param ratio [in] Speed for playback.
115 * @param streaming [in] If @c true, rate value can be set even if it is streaming playback.
116 * @return This function returns zero on success, or negative value with error
118 * @remark The current supported range is from -64x to 64x.
119 * But, the quailty is dependent on codec performance.
120 * And, the sound is muted under normal speed and more than double speed.
124 int mm_player_set_play_speed(MMHandleType player, float rate, bool streaming);
127 * This function set callback function for receiving video stream from player.
129 * @param player [in] Handle of player.
130 * @param callback [in] Video stream callback function.
131 * @param user_param [in] User parameter.
133 * @return This function returns zero on success, or negative value with error
138 int mm_player_set_video_stream_callback(MMHandleType player, mm_player_video_stream_callback callback, void *user_param);
141 * This function set callback function for receiving audio stream from player.
143 * @param player [in] Handle of player.
144 * @param sync [in] sync Sync on the clock.
145 * @param callback [in] audio stream callback function.
146 * @param user_param [in] User parameter.
148 * @return This function returns zero on success, or negative value with error
151 * @see mm_player_audio_stream_callback
154 int mm_player_set_audio_stream_callback(MMHandleType player, bool sync, mm_player_audio_stream_callback callback, void *user_param);
157 * This function is to capture video frame.
159 * @param player [in] Handle of player.
161 * @return This function returns zero on success, or negative value with error
164 * @remark Captured buffer is sent asynchronously through message callback with MM_MESSAGE_VIDEO_CAPTURED.
165 * And, application should free the captured buffer directly.
166 * @see MM_MESSAGE_VIDEO_CAPTURED
169 int mm_player_do_video_capture(MMHandleType player);
172 * This function changes the previous videosink plugin for a new one
174 * @param player [in] Handle of player.
175 * @param display_surface_type [in] display surface type to set
176 * @param display_overlay [in] display overlay to set
178 * @return This function returns zero on success, or negative value with error
184 int mm_player_change_videosink(MMHandleType player, MMDisplaySurfaceType display_surface_type, void *display_overlay);
194 #endif /* __MM_PLAYER_INTERNAL_H__ */