4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: YoungHun Kim <yh8004.kim@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #ifndef __MM_TRANSCODE_H__
23 #define __MM_TRANSCODE_H__
30 typedef bool (*mm_transcode_completed_callback)(int error, void *user_parm);
31 typedef bool (*mm_transcode_progress_callback)(unsigned long current_position, unsigned long real_duration, void *user_parm);
32 typedef bool (*mm_transcode_support_type_callback)(int encoder_type, void *user_parm);
36 * Video Container Formats
40 MM_CONTAINER_3GP = 0x00,
43 } mm_containerformat_e;
49 MM_VIDEOENCODER_MPEG4 = 0x00,
52 MM_VIDEOENCODER_NO_USE,
60 MM_AUDIOENCODER_AAC = 0x00,
62 MM_AUDIOENCODER_NO_USE,
71 MM_SEEK_INACCURATE = 0x00,
79 * @remark Transcode Handle Creation
81 * @param MMHandle [in] MMHandleType pointer
83 * @return This function returns transcode processor result value
84 * if the result is 0, then handle creation succeed
85 * else if the result is -1, then handle creation failed
88 mm_transcode_create(MMHandleType* MMHandle);
95 * @remark Video Transcode Pipeline
97 * @param MMHandle [in] MMHandleType
98 * @param in_Filename [in] Input Video File pointer
99 * @param containerformat [in] Container format (3GP/MP4)
100 * @param videoencoder [in] Videoencoder (avenc_h263p/avenc_mpeg4/savsenc_mp4/savsenc_h264)
101 * @param audioencoder [in] Audioencoder (amr/aac)
103 * @return This function returns transcode processor result value
104 * if the result is 0, then you can use output_Filename pointer(char** value)
105 * else if the result is -1, then do not execute when the colopsapce converter is not supported
108 mm_transcode_prepare(MMHandleType MMHandle, const char *in_Filename, mm_containerformat_e containerformat,
109 mm_videoencoder_e videoencoder, mm_audioencoder_e audioencoder);
116 * @remark Video Transcode Pipeline
118 * @param MMHandle [in] MMHandleType
119 * @param resolution_width [in] Video Resolution Width
120 * @param resolution_height [in] Video Resolution Height
121 * @param fps_value [in] Video Framerate
122 * @param start_position [in] Start Position (msec)
123 * @param duration [in] Seek Duration (msec, If the value is 0, you transcode the original file totally)
124 * @param seek_mode [in] Seek Mode (Accurate / Inaccurate)
125 * @param out_Filename [in] Output Video File pointer
126 * @param progress_callback [in] Progress_callback
127 * @param completed_callback [in] Completed_callback
128 * @param user_param [in] User parameter which is received from user when callback function was set
131 * @return This function returns transcode processor result value
132 * if the result is 0, then you can use output_Filename pointer(char** value)
133 * else if the result is -1, then do not execute when the colopsapce converter is not supported
136 mm_transcode(MMHandleType MMHandle, unsigned int resolution_width, unsigned int resolution_height, unsigned int fps_value, unsigned long start_position, unsigned long duration,
137 mm_seek_mode_e seek_mode, const char *out_Filename, mm_transcode_progress_callback progress_callback, mm_transcode_completed_callback completed_callback, void *user_param);
144 * @remark Video Transcode Pipeline
146 * @param MMHandle [in] MMHandleType
147 * @param is_busy [in/out] If transcode is executing or not
149 * @return This function returns transcode processor result value
150 * if the result is 0, then it means that trascode is executing now
151 * else if the result is -1, then you can call mm_transcode_prepare for new input file
154 mm_transcode_is_busy(MMHandleType MMHandle, bool *is_busy);
161 * @remark Transcode Handle Cancel
163 * @param MMHandle [in] MMHandleType
165 * @return This function returns transcode processor result value
166 * if the result is 0, then handle destory succeed
167 * else if the result is -1, then handle destory failed
170 mm_transcode_cancel(MMHandleType MMHandle);
177 * @remark Transcode Handle Destory
179 * @param MMHandle [in] MMHandleType
181 * @return This function returns transcode processor result value
182 * if the result is 0, then handle destory succeed
183 * else if the result is -1, then handle destory failed
186 mm_transcode_destroy(MMHandleType MMHandle);
193 * @remark Transcode Handle Destory
195 * @param MMHandle [in] MMHandleType
196 * @param» containerformat [in/out] Container format
197 * @param» videoencoder» [in/out] Videoencoder
198 * @param» audioencoder» [in/out] Audioencoder
199 * @param» current_pos [in/out]» Current Position
200 * @param» duration [in/out] Duration
201 * @param» resolution_width» [in/out] Real Resolution Width
202 * @param» resolution_height [in/out] Real Resolution Height
204 * @return This function returns transcode processor result value
205 * if the result is 0, then transcode get attribute succeed
206 * else if the result is -1, then transcode get attribute failed
209 mm_transcode_get_attrs(MMHandleType MMHandle, mm_containerformat_e *containerformat, mm_videoencoder_e *videoencoder,
210 mm_audioencoder_e *audioencoder, unsigned long *current_pos, unsigned long *duration, unsigned int *resolution_width, unsigned int *resolution_height);
213 mm_transcode_get_supported_container_format(mm_transcode_support_type_callback type_callback, void *user_param);
216 mm_transcode_get_supported_video_encoder(mm_transcode_support_type_callback type_callback, void *user_param);
219 mm_transcode_get_supported_audio_encoder(mm_transcode_support_type_callback type_callback, void *user_param);
225 #endif /*__MM_TRANSCODE_H__*/