1 /* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef __M4VSS3GPP_EXTENDED_API_H__ 18 #define __M4VSS3GPP_EXTENDED_API_H__ 19 20 /** 21 ****************************************************************************** 22 * @file M4VSS3GPP_Extended_API.h 23 * @brief API of xVSS 24 * @note 25 ****************************************************************************** 26 */ 27 28 #ifndef M4VSS_SUPPORT_EXTENDED_FEATURES 29 #error "*** the flag M4VSS_SUPPORT_EXTENDED_FEATURES should be activated in CompilerSwitches\ 30 for VideoStudio ***" 31 #endif 32 33 /** 34 ****************************************************************************** 35 * prototype M4xVSS_getTextRgbBufferFct 36 * @brief External text to RGB buffer functions implemented by the integrator 37 * must match this prototype. 38 * @note The function is provided with the renderingData, the text buffer and 39 * its size. It must build the output RGB image plane containing the text. 40 * 41 * @param pRenderingData (IN) The data given by the user in M4xVSS_EffectSettings 42 * @param pTextBuffer (IN) Text buffer given by the user in M4xVSS_EffectSettings 43 * @param textBufferSize (IN) Text buffer size given by the user in M4xVSS_EffectSettings 44 * @param pOutputPlane (IN/OUT) Output RGB565 image 45 * @return M4NO_ERROR: No error 46 * @return M4ERR_PARAMETER: At least one parameter is M4OSA_NULL (debug only) 47 ****************************************************************************** 48 */ 49 typedef M4OSA_ERR (*M4xVSS_getTextRgbBufferFct) 50 ( 51 M4OSA_Void *pRenderingData, 52 M4OSA_Void *pTextBuffer, 53 M4OSA_UInt32 textBufferSize, 54 M4VIFI_ImagePlane **pOutputPlane 55 ); 56 57 /** 58 ****************************************************************************** 59 * struct M4xVSS_BGMSettings 60 * @brief This structure gathers all the information needed to add Background music to 3gp file 61 ****************************************************************************** 62 */ 63 typedef struct 64 { 65 M4OSA_Void *pFile; /**< Input file path */ 66 M4VIDEOEDITING_FileType FileType; /**< .3gp, .amr, .mp3 */ 67 M4OSA_UInt32 uiAddCts; /**< Time, in milliseconds, at which the added 68 audio track is inserted */ 69 M4OSA_UInt32 uiAddVolume; /**< Volume, in percentage, of the added audio track */ 70 M4OSA_UInt32 uiBeginLoop; /**< Describes in milli-second the start time 71 of the loop */ 72 M4OSA_UInt32 uiEndLoop; /**< Describes in milli-second the end time of the 73 loop (0 means no loop) */ 74 M4OSA_Bool b_DuckingNeedeed; 75 M4OSA_Int32 InDucking_threshold; /**< Threshold value at which background 76 music shall duck */ 77 M4OSA_Float lowVolume; /**< lower the background track to this factor 78 and increase the primary track to inverse of this factor */ 79 M4OSA_Bool bLoop; 80 M4OSA_UInt32 uiSamplingFrequency; 81 M4OSA_UInt32 uiNumChannels; 82 } M4xVSS_BGMSettings; 83 84 85 /** 86 ****************************************************************************** 87 * enum M4VSS3GPP_VideoEffectType 88 * @brief This enumeration defines the video effect types of the VSS3GPP 89 ****************************************************************************** 90 */ 91 typedef enum 92 { 93 M4VSS3GPP_kRGB888 = 0, /**< RGB888 data type */ 94 M4VSS3GPP_kRGB565 = 1 /**< RGB565 data type */ 95 96 } M4VSS3GPP_RGBType; 97 98 /** 99 ****************************************************************************** 100 * struct M4xVSS_EffectSettings 101 * @brief This structure defines an audio/video effect for the edition. 102 ****************************************************************************** 103 */ 104 typedef struct 105 { 106 /**< In percent of the cut clip duration */ 107 M4OSA_UInt32 uiStartPercent; 108 /**< In percent of the ((clip duration) - (effect starttime)) */ 109 M4OSA_UInt32 uiDurationPercent; 110 /**< Framing file path (GIF/PNG file), used only if VideoEffectType == framing */ 111 M4OSA_Void *pFramingFilePath; 112 /**< Framing RGB565 buffer, used only if VideoEffectType == framing */ 113 M4VIFI_ImagePlane *pFramingBuffer; 114 /**<RGB Buffer type,used only if VideoEffectType == framing */ 115 M4VSS3GPP_RGBType rgbType; 116 /**< The top-left X coordinate in the output picture where the added frame will be displayed. 117 Used only if VideoEffectType == framing || VideoEffectType == text */ 118 M4OSA_UInt32 topleft_x; 119 /**< The top-left Y coordinate in the output picture where the added frame will be displayed. 120 Used only if VideoEffectType == framing || VideoEffectType == text */ 121 M4OSA_UInt32 topleft_y; 122 /**< Does framing image is resized to output video size. 123 Used only if VideoEffectType == framing */ 124 M4OSA_Bool bResize; 125 M4VIDEOEDITING_VideoFrameSize framingScaledSize; 126 /**< Size to which the the framing file needs to be resized */ 127 /**< Text buffer. Used only if VideoEffectType == text */ 128 M4OSA_Void* pTextBuffer; 129 /**< Text buffer size. Used only if VideoEffectType == text */ 130 M4OSA_UInt32 textBufferSize; 131 /**< Pointer containing specific data used by the font engine (size, color...) */ 132 M4OSA_Void* pRenderingData; 133 /**< Text plane width. Used only if VideoEffectType == text */ 134 M4OSA_UInt32 uiTextBufferWidth; 135 /**< Text plane height. Used only if VideoEffectType == text */ 136 M4OSA_UInt32 uiTextBufferHeight; 137 /**< Processing rate of the effect added when using the Fifties effect */ 138 M4OSA_UInt32 uiFiftiesOutFrameRate; 139 /**< RGB16 input color of the effect added when using the rgb16 color effect */ 140 M4OSA_UInt16 uiRgb16InputColor; 141 142 M4OSA_UInt8 uialphaBlendingStart; /*Start percentage of Alpha blending*/ 143 M4OSA_UInt8 uialphaBlendingMiddle; /*Middle percentage of Alpha blending*/ 144 M4OSA_UInt8 uialphaBlendingEnd; /*End percentage of Alpha blending*/ 145 M4OSA_UInt8 uialphaBlendingFadeInTime; /*Duration, in percentage of 146 effect duration, of the FadeIn phase*/ 147 M4OSA_UInt8 uialphaBlendingFadeOutTime; /*Duration, in percentage of effect 148 duration, of the FadeOut phase*/ 149 M4OSA_UInt32 width; /*width of the ARGB8888 clip . 150 Used only if video effect is framming */ 151 M4OSA_UInt32 height; /*height of the ARGB8888 clip . 152 Used only if video effect is framming */ 153 } M4xVSS_EffectSettings; 154 155 /** 156 ****************************************************************************** 157 * struct M4xVSS_AlphaMagicSettings 158 * @brief This structure defines the alpha magic transition settings 159 ****************************************************************************** 160 */ 161 typedef struct 162 { 163 M4OSA_Void* pAlphaFilePath; /**< Alpha file path (JPG file) */ 164 M4OSA_Int32 blendingPercent; /**< Blending Percentage between 0 and 100 */ 165 M4OSA_Bool isreverse; /**< direct effect or reverse */ 166 /*To support ARGB8888 : get the width and height */ 167 M4OSA_UInt32 width; 168 M4OSA_UInt32 height; 169 } M4xVSS_AlphaMagicSettings; 170 171 /** 172 ****************************************************************************** 173 * enum M4xVSS_SlideTransition_Direction 174 * @brief Defines directions for the slide transition 175 ****************************************************************************** 176 */ 177 178 typedef enum { 179 M4xVSS_SlideTransition_RightOutLeftIn, 180 M4xVSS_SlideTransition_LeftOutRightIn, 181 M4xVSS_SlideTransition_TopOutBottomIn, 182 M4xVSS_SlideTransition_BottomOutTopIn 183 } M4xVSS_SlideTransition_Direction; 184 185 /** 186 ****************************************************************************** 187 * struct M4xVSS_AlphaMagicSettings 188 * @brief This structure defines the slide transition settings 189 ****************************************************************************** 190 */ 191 192 typedef struct 193 { 194 M4xVSS_SlideTransition_Direction direction; /* direction of the slide */ 195 } M4xVSS_SlideTransitionSettings; 196 197 /** 198 ****************************************************************************** 199 * struct M4xVSS_TransitionSettings 200 * @brief This structure defines additional transition settings specific to 201 * xVSS, which are appended to the VSS3GPP transition settings 202 * structure. 203 ****************************************************************************** 204 */ 205 typedef struct 206 { 207 /* Anything xVSS-specific, but common to all transitions, would go here, 208 before the union. */ 209 union { 210 /**< AlphaMagic settings, used only if VideoTransitionType == 211 M4xVSS_kVideoTransitionType_AlphaMagic */ 212 M4xVSS_AlphaMagicSettings *pAlphaMagicSettings; 213 /* only in case of slide transition. */ 214 M4xVSS_SlideTransitionSettings *pSlideTransitionSettings; 215 } transitionSpecific; 216 } M4xVSS_TransitionSettings; 217 218 219 /** 220 ****************************************************************************** 221 * enum M4xVSS_MediaRendering 222 * @brief This enum defines different media rendering using exif orientation 223 ****************************************************************************** 224 */ 225 typedef enum 226 { 227 M4xVSS_kResizing = 0, /*The picture is resized, the aspect ratio can be different 228 from the original one. All of the picture is rendered*/ 229 M4xVSS_kCropping, /*The picture is cropped, the aspect ratio is the same as 230 the original one. The picture is not rendered entirely*/ 231 M4xVSS_kBlackBorders /*Black borders are rendered in order to keep the original 232 aspect ratio. All the picture is rendered*/ 233 234 } M4xVSS_MediaRendering; 235 236 237 /** 238 ****************************************************************************** 239 * struct M4xVSS_ClipSettings 240 * @brief This structure defines an input clip for the edition. 241 * @note It also contains the settings for the cut and begin/end effects applied to the clip. 242 ****************************************************************************** 243 */ 244 typedef struct 245 { 246 M4OSA_UInt32 uiBeginCutPercent; /**< Begin cut time, in percent of clip 247 duration (only for 3GPP clip !) */ 248 M4OSA_UInt32 uiEndCutPercent; /**< End cut time, in percent of clip 249 duration (only for 3GPP clip !) */ 250 M4OSA_UInt32 uiDuration; /**< Duration of the clip, if different 251 from 0, has priority on 252 uiEndCutTime or uiEndCutPercent */ 253 M4OSA_Bool isPanZoom; /**< RC: Boolean used to know if the 254 pan and zoom mode is enabled */ 255 M4OSA_UInt16 PanZoomXa; /**< RC */ 256 M4OSA_UInt16 PanZoomTopleftXa; /**< RC */ 257 M4OSA_UInt16 PanZoomTopleftYa; /**< RC */ 258 M4OSA_UInt16 PanZoomXb; /**< RC */ 259 M4OSA_UInt16 PanZoomTopleftXb; /**< RC */ 260 M4OSA_UInt16 PanZoomTopleftYb; /**< RC */ 261 M4xVSS_MediaRendering MediaRendering; /**< FB only used with JPEG: to crop, 262 resize, or render black borders*/ 263 264 } M4xVSS_ClipSettings; 265 266 /** 267 ****************************************************************************** 268 * struct M4xVSS_EditSettings 269 * @brief This structure gathers all the information needed to define a complete 270 * edition operation 271 ****************************************************************************** 272 */ 273 typedef struct 274 { 275 /**< Output video size */ 276 M4VIDEOEDITING_VideoFrameSize outputVideoSize; 277 /**< Output video format (MPEG4 / H263) */ 278 M4VIDEOEDITING_VideoFormat outputVideoFormat; 279 /**< Output audio format (AAC, AMRNB ...) */ 280 M4VIDEOEDITING_AudioFormat outputAudioFormat; 281 /**< Output audio sampling freq (8000Hz,...) */ 282 M4VIDEOEDITING_AudioSamplingFrequency outputAudioSamplFreq; 283 /**< Maximum output file size in BYTES (if set to 0, no limit */ 284 M4OSA_UInt32 outputFileSize; 285 /**< Is output audio must be Mono ? Valid only for AAC */ 286 M4OSA_Bool bAudioMono; 287 /**< Output video bitrate*/ 288 M4OSA_UInt32 outputVideoBitrate; 289 /**< Output audio bitrate*/ 290 M4OSA_UInt32 outputAudioBitrate; 291 /**< Background music track settings */ 292 M4xVSS_BGMSettings *pBGMtrack; 293 /**< Function pointer on text rendering engine, if not used, must be set to NULL !! */ 294 M4xVSS_getTextRgbBufferFct pTextRenderingFct; 295 /** output video profile and level*/ 296 M4OSA_Int32 outputVideoProfile; 297 M4OSA_Int32 outputVideoLevel; 298 299 } M4xVSS_EditSettings; 300 301 #endif /* __M4VSS3GPP_EXTENDED_API_H__ */ 302 303