1 // Copyright (c) 2007-2018 Fredrik Mellbin 2 // 3 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // of this software and associated documentation files (the "Software"), to deal 5 // in the Software without restriction, including without limitation the rights 6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 // copies of the Software, and to permit persons to whom the Software is 8 // furnished to do so, subject to the following conditions: 9 // 10 // The above copyright notice and this permission notice shall be included in 11 // all copies or substantial portions of the Software. 12 // 13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 // THE SOFTWARE. 20 21 #ifndef FFMS_H 22 #define FFMS_H 23 24 // Version format: major - minor - micro - bump 25 #define FFMS_VERSION ((2 << 24) | (40 << 16) | (0 << 8) | 0) 26 27 #include <stdint.h> 28 #include <stddef.h> 29 30 31 /******** 32 * The following preprocessor voodoo ensures that all API symbols are exported 33 * as intended on all supported platforms, that non-API symbols are hidden (where possible), 34 * and that the correct calling convention and extern declarations are used. 35 * The end result should be that linking to FFMS2 Just Works. 36 ********/ 37 38 // Convenience for C++ users. 39 #if defined(__cplusplus) 40 # define FFMS_EXTERN_C extern "C" 41 #else 42 # define FFMS_EXTERN_C 43 #endif 44 45 // On win32, we need to ensure we use stdcall with all compilers. 46 #if defined(_WIN32) && !defined(_WIN64) 47 # define FFMS_CC __stdcall 48 #else 49 # define FFMS_CC 50 #endif 51 52 // compiler-specific deprecation attributes 53 #ifndef FFMS_EXPORTS 54 # if defined(__GNUC__) && (__GNUC__ >= 4) 55 # define FFMS_DEPRECATED __attribute__((deprecated)) 56 # elif defined(_MSC_VER) 57 # define FFMS_DEPRECATED __declspec(deprecated) 58 # endif 59 #endif 60 61 #ifndef FFMS_DEPRECATED 62 // Define as empty if the compiler doesn't support deprecation attributes or 63 // if we're building FFMS2 itself 64 # define FFMS_DEPRECATED 65 #endif 66 67 // And now for some symbol hide-and-seek... 68 #if defined(_WIN32) && !defined(FFMS_STATIC) // MSVC 69 # if defined(FFMS_EXPORTS) // building the FFMS2 library itself, with visible API symbols 70 # define FFMS_API(ret) FFMS_EXTERN_C __declspec(dllexport) ret FFMS_CC 71 # define FFMS_DEPRECATED_API(ret) FFMS_EXTERN_C FFMS_DEPRECATED __declspec(dllexport) ret FFMS_CC 72 # else // building something that depends on FFMS2 73 # define FFMS_API(ret) FFMS_EXTERN_C __declspec(dllimport) ret FFMS_CC 74 # define FFMS_DEPRECATED_API(ret) FFMS_EXTERN_C FFMS_DEPRECATED __declspec(dllimport) ret FFMS_CC 75 # endif // defined(FFMS_EXPORTS) 76 // GCC 4 or later: export API symbols only. Some GCC 3.x versions support the visibility attribute too, 77 // but we don't really care enough about that to add compatibility defines for it. 78 #elif defined(__GNUC__) && __GNUC__ >= 4 79 # define FFMS_API(ret) FFMS_EXTERN_C __attribute__((visibility("default"))) ret FFMS_CC 80 # define FFMS_DEPRECATED_API(ret) FFMS_EXTERN_C FFMS_DEPRECATED __attribute__((visibility("default"))) ret FFMS_CC 81 #else // fallback for everything else 82 # define FFMS_API(ret) FFMS_EXTERN_C ret FFMS_CC 83 # define FFMS_DEPRECATED_API(ret) FFMS_EXTERN_C FFMS_DEPRECATED ret FFMS_CC 84 #endif // defined(_MSC_VER) 85 86 87 // we now return you to your regularly scheduled programming. 88 89 typedef struct FFMS_ErrorInfo { 90 int ErrorType; 91 int SubType; 92 int BufferSize; 93 char *Buffer; 94 } FFMS_ErrorInfo; 95 96 typedef struct FFMS_VideoSource FFMS_VideoSource; 97 typedef struct FFMS_AudioSource FFMS_AudioSource; 98 typedef struct FFMS_Indexer FFMS_Indexer; 99 typedef struct FFMS_Index FFMS_Index; 100 typedef struct FFMS_Track FFMS_Track; 101 102 typedef enum FFMS_Errors { 103 // No error 104 FFMS_ERROR_SUCCESS = 0, 105 106 // Main types - where the error occurred 107 FFMS_ERROR_INDEX = 1, // index file handling 108 FFMS_ERROR_INDEXING, // indexing 109 FFMS_ERROR_POSTPROCESSING, // video postprocessing (libpostproc) 110 FFMS_ERROR_SCALING, // image scaling (libswscale) 111 FFMS_ERROR_DECODING, // audio/video decoding 112 FFMS_ERROR_SEEKING, // seeking 113 FFMS_ERROR_PARSER, // file parsing 114 FFMS_ERROR_TRACK, // track handling 115 FFMS_ERROR_WAVE_WRITER, // WAVE64 file writer 116 FFMS_ERROR_CANCELLED, // operation aborted 117 FFMS_ERROR_RESAMPLING, // audio resampling (libavresample) 118 119 // Subtypes - what caused the error 120 FFMS_ERROR_UNKNOWN = 20, // unknown error 121 FFMS_ERROR_UNSUPPORTED, // format or operation is not supported with this binary 122 FFMS_ERROR_FILE_READ, // cannot read from file 123 FFMS_ERROR_FILE_WRITE, // cannot write to file 124 FFMS_ERROR_NO_FILE, // no such file or directory 125 FFMS_ERROR_VERSION, // wrong version 126 FFMS_ERROR_ALLOCATION_FAILED, // out of memory 127 FFMS_ERROR_INVALID_ARGUMENT, // invalid or nonsensical argument 128 FFMS_ERROR_CODEC, // decoder error 129 FFMS_ERROR_NOT_AVAILABLE, // requested mode or operation unavailable in this binary 130 FFMS_ERROR_FILE_MISMATCH, // provided index does not match the file 131 FFMS_ERROR_USER // problem exists between keyboard and chair 132 } FFMS_Errors; 133 134 typedef enum FFMS_SeekMode { 135 FFMS_SEEK_LINEAR_NO_RW = -1, 136 FFMS_SEEK_LINEAR = 0, 137 FFMS_SEEK_NORMAL = 1, 138 FFMS_SEEK_UNSAFE = 2, 139 FFMS_SEEK_AGGRESSIVE = 3 140 } FFMS_SeekMode; 141 142 typedef enum FFMS_IndexErrorHandling { 143 FFMS_IEH_ABORT = 0, 144 FFMS_IEH_CLEAR_TRACK = 1, 145 FFMS_IEH_STOP_TRACK = 2, 146 FFMS_IEH_IGNORE = 3 147 } FFMS_IndexErrorHandling; 148 149 typedef enum FFMS_TrackType { 150 FFMS_TYPE_UNKNOWN = -1, 151 FFMS_TYPE_VIDEO, 152 FFMS_TYPE_AUDIO, 153 FFMS_TYPE_DATA, 154 FFMS_TYPE_SUBTITLE, 155 FFMS_TYPE_ATTACHMENT 156 } FFMS_TrackType; 157 158 typedef enum FFMS_SampleFormat { 159 FFMS_FMT_U8 = 0, 160 FFMS_FMT_S16, 161 FFMS_FMT_S32, 162 FFMS_FMT_FLT, 163 FFMS_FMT_DBL 164 } FFMS_SampleFormat; 165 166 typedef enum FFMS_AudioChannel { 167 FFMS_CH_FRONT_LEFT = 0x00000001, 168 FFMS_CH_FRONT_RIGHT = 0x00000002, 169 FFMS_CH_FRONT_CENTER = 0x00000004, 170 FFMS_CH_LOW_FREQUENCY = 0x00000008, 171 FFMS_CH_BACK_LEFT = 0x00000010, 172 FFMS_CH_BACK_RIGHT = 0x00000020, 173 FFMS_CH_FRONT_LEFT_OF_CENTER = 0x00000040, 174 FFMS_CH_FRONT_RIGHT_OF_CENTER = 0x00000080, 175 FFMS_CH_BACK_CENTER = 0x00000100, 176 FFMS_CH_SIDE_LEFT = 0x00000200, 177 FFMS_CH_SIDE_RIGHT = 0x00000400, 178 FFMS_CH_TOP_CENTER = 0x00000800, 179 FFMS_CH_TOP_FRONT_LEFT = 0x00001000, 180 FFMS_CH_TOP_FRONT_CENTER = 0x00002000, 181 FFMS_CH_TOP_FRONT_RIGHT = 0x00004000, 182 FFMS_CH_TOP_BACK_LEFT = 0x00008000, 183 FFMS_CH_TOP_BACK_CENTER = 0x00010000, 184 FFMS_CH_TOP_BACK_RIGHT = 0x00020000, 185 FFMS_CH_STEREO_LEFT = 0x20000000, 186 FFMS_CH_STEREO_RIGHT = 0x40000000 187 } FFMS_AudioChannel; 188 189 typedef enum FFMS_Resizers { 190 FFMS_RESIZER_FAST_BILINEAR = 0x0001, 191 FFMS_RESIZER_BILINEAR = 0x0002, 192 FFMS_RESIZER_BICUBIC = 0x0004, 193 FFMS_RESIZER_X = 0x0008, 194 FFMS_RESIZER_POINT = 0x0010, 195 FFMS_RESIZER_AREA = 0x0020, 196 FFMS_RESIZER_BICUBLIN = 0x0040, 197 FFMS_RESIZER_GAUSS = 0x0080, 198 FFMS_RESIZER_SINC = 0x0100, 199 FFMS_RESIZER_LANCZOS = 0x0200, 200 FFMS_RESIZER_SPLINE = 0x0400 201 } FFMS_Resizers; 202 203 typedef enum FFMS_AudioDelayModes { 204 FFMS_DELAY_NO_SHIFT = -3, 205 FFMS_DELAY_TIME_ZERO = -2, 206 FFMS_DELAY_FIRST_VIDEO_TRACK = -1 207 } FFMS_AudioDelayModes; 208 209 typedef enum FFMS_ChromaLocations { 210 FFMS_LOC_UNSPECIFIED = 0, 211 FFMS_LOC_LEFT = 1, 212 FFMS_LOC_CENTER = 2, 213 FFMS_LOC_TOPLEFT = 3, 214 FFMS_LOC_TOP = 4, 215 FFMS_LOC_BOTTOMLEFT = 5, 216 FFMS_LOC_BOTTOM = 6 217 } FFMS_ChromaLocations; 218 219 typedef enum FFMS_ColorRanges { 220 FFMS_CR_UNSPECIFIED = 0, 221 FFMS_CR_MPEG = 1, // 219*2^(n-8), i.e. 16-235 with 8-bit samples 222 FFMS_CR_JPEG = 2 // 2^n-1, or "fullrange" 223 } FFMS_ColorRanges; 224 225 typedef enum FFMS_Stereo3DType { 226 FFMS_S3D_TYPE_2D = 0, 227 FFMS_S3D_TYPE_SIDEBYSIDE, 228 FFMS_S3D_TYPE_TOPBOTTOM, 229 FFMS_S3D_TYPE_FRAMESEQUENCE, 230 FFMS_S3D_TYPE_CHECKERBOARD, 231 FFMS_S3D_TYPE_SIDEBYSIDE_QUINCUNX, 232 FFMS_S3D_TYPE_LINES, 233 FFMS_S3D_TYPE_COLUMNS 234 } FFMS_Stereo3DType; 235 236 typedef enum FFMS_Stereo3DFlags { 237 FFMS_S3D_FLAGS_INVERT = 1 238 } FFMS_Stereo3DFlags; 239 240 typedef enum FFMS_MixingCoefficientType { 241 FFMS_MIXING_COEFFICIENT_Q8 = 0, 242 FFMS_MIXING_COEFFICIENT_Q15 = 1, 243 FFMS_MIXING_COEFFICIENT_FLT = 2 244 } FFMS_MixingCoefficientType; 245 246 typedef enum FFMS_MatrixEncoding { 247 FFMS_MATRIX_ENCODING_NONE = 0, 248 FFMS_MATRIX_ENCODING_DOBLY = 1, 249 FFMS_MATRIX_ENCODING_PRO_LOGIC_II = 2, 250 FFMS_MATRIX_ENCODING_PRO_LOGIC_IIX = 3, 251 FFMS_MATRIX_ENCODING_PRO_LOGIC_IIZ = 4, 252 FFMS_MATRIX_ENCODING_DOLBY_EX = 5, 253 FFMS_MATRIX_ENCODING_DOLBY_HEADPHONE = 6 254 } FFMS_MatrixEncoding; 255 256 typedef enum FFMS_ResampleFilterType { 257 FFMS_RESAMPLE_FILTER_CUBIC = 0, 258 FFMS_RESAMPLE_FILTER_SINC = 1, /* misnamed as multiple windowsed sinc filters exist, actually called BLACKMAN_NUTTALL */ 259 FFMS_RESAMPLE_FILTER_KAISER = 2 260 } FFMS_ResampleFilterType; 261 262 typedef enum FFMS_AudioDitherMethod { 263 FFMS_RESAMPLE_DITHER_NONE = 0, 264 FFMS_RESAMPLE_DITHER_RECTANGULAR = 1, 265 FFMS_RESAMPLE_DITHER_TRIANGULAR = 2, 266 FFMS_RESAMPLE_DITHER_TRIANGULAR_HIGHPASS = 3, 267 FFMS_RESAMPLE_DITHER_TRIANGULAR_NOISESHAPING = 4 268 } FFMS_AudioDitherMethod; 269 270 typedef enum FFMS_LogLevels { 271 FFMS_LOG_QUIET = -8, 272 FFMS_LOG_PANIC = 0, 273 FFMS_LOG_FATAL = 8, 274 FFMS_LOG_ERROR = 16, 275 FFMS_LOG_WARNING = 24, 276 FFMS_LOG_INFO = 32, 277 FFMS_LOG_VERBOSE = 40, 278 FFMS_LOG_DEBUG = 48, 279 FFMS_LOG_TRACE = 56 280 } FFMS_LogLevels; 281 282 typedef struct FFMS_ResampleOptions { 283 int64_t ChannelLayout; 284 FFMS_SampleFormat SampleFormat; 285 int SampleRate; 286 FFMS_MixingCoefficientType MixingCoefficientType; 287 double CenterMixLevel; 288 double SurroundMixLevel; 289 double LFEMixLevel; 290 int Normalize; 291 int ForceResample; 292 int ResampleFilterSize; 293 int ResamplePhaseShift; 294 int LinearInterpolation; 295 double CutoffFrequencyRatio; 296 FFMS_MatrixEncoding MatrixedStereoEncoding; 297 FFMS_ResampleFilterType FilterType; 298 int KaiserBeta; 299 FFMS_AudioDitherMethod DitherMethod; 300 } FFMS_ResampleOptions; 301 302 303 typedef struct FFMS_Frame { 304 const uint8_t *Data[4]; 305 int Linesize[4]; 306 int EncodedWidth; 307 int EncodedHeight; 308 int EncodedPixelFormat; 309 int ScaledWidth; 310 int ScaledHeight; 311 int ConvertedPixelFormat; 312 int KeyFrame; 313 int RepeatPict; 314 int InterlacedFrame; 315 int TopFieldFirst; 316 char PictType; 317 int ColorSpace; 318 int ColorRange; 319 /* Introduced in FFMS_VERSION ((2 << 24) | (21 << 16) | (0 << 8) | 0) */ 320 int ColorPrimaries; 321 int TransferCharateristics; 322 int ChromaLocation; 323 /* Introduced in FFMS_VERSION ((2 << 24) | (27 << 16) | (0 << 8) | 0) */ 324 int HasMasteringDisplayPrimaries; /* Non-zero if the 4 fields below are valid */ 325 double MasteringDisplayPrimariesX[3]; 326 double MasteringDisplayPrimariesY[3]; 327 double MasteringDisplayWhitePointX; 328 double MasteringDisplayWhitePointY; 329 int HasMasteringDisplayLuminance; /* Non-zero if the 2 fields below are valid */ 330 double MasteringDisplayMinLuminance; 331 double MasteringDisplayMaxLuminance; 332 int HasContentLightLevel; /* Non-zero if the 2 fields below are valid */ 333 unsigned int ContentLightLevelMax; 334 unsigned int ContentLightLevelAverage; 335 } FFMS_Frame; 336 337 typedef struct FFMS_TrackTimeBase { 338 int64_t Num; 339 int64_t Den; 340 } FFMS_TrackTimeBase; 341 342 typedef struct FFMS_FrameInfo { 343 int64_t PTS; 344 int RepeatPict; 345 int KeyFrame; 346 int64_t OriginalPTS; 347 } FFMS_FrameInfo; 348 349 typedef struct FFMS_VideoProperties { 350 int FPSDenominator; 351 int FPSNumerator; 352 int RFFDenominator; 353 int RFFNumerator; 354 int NumFrames; 355 int SARNum; 356 int SARDen; 357 int CropTop; 358 int CropBottom; 359 int CropLeft; 360 int CropRight; 361 int TopFieldFirst; 362 FFMS_DEPRECATED int ColorSpace; /* Provided in FFMS_Frame */ 363 FFMS_DEPRECATED int ColorRange; /* Provided in FFMS_Frame */ 364 double FirstTime; 365 double LastTime; 366 /* Introduced in FFMS_VERSION ((2 << 24) | (24 << 16) | (0 << 8) | 0) */ 367 int Rotation; 368 int Stereo3DType; 369 int Stereo3DFlags; 370 /* Introduced in FFMS_VERSION ((2 << 24) | (30 << 16) | (0 << 8) | 0) */ 371 double LastEndTime; 372 int HasMasteringDisplayPrimaries; /* Non-zero if the 4 fields below are valid */ 373 double MasteringDisplayPrimariesX[3]; 374 double MasteringDisplayPrimariesY[3]; 375 double MasteringDisplayWhitePointX; 376 double MasteringDisplayWhitePointY; 377 int HasMasteringDisplayLuminance; /* Non-zero if the 2 fields below are valid */ 378 double MasteringDisplayMinLuminance; 379 double MasteringDisplayMaxLuminance; 380 int HasContentLightLevel; /* Non-zero if the 2 fields below are valid */ 381 unsigned int ContentLightLevelMax; 382 unsigned int ContentLightLevelAverage; 383 /* Introduced in FFMS_VERSION ((2 << 24) | (31 << 16) | (0 << 8) | 0) */ 384 int Flip; 385 } FFMS_VideoProperties; 386 387 typedef struct FFMS_AudioProperties { 388 int SampleFormat; 389 int SampleRate; 390 int BitsPerSample; 391 int Channels; 392 int64_t ChannelLayout; // should probably be a plain int, none of the constants are >32 bits long 393 int64_t NumSamples; 394 double FirstTime; 395 double LastTime; 396 /* Introduced in FFMS_VERSION ((2 << 24) | (30 << 16) | (0 << 8) | 0) */ 397 double LastEndTime; 398 } FFMS_AudioProperties; 399 400 typedef int (FFMS_CC *TIndexCallback)(int64_t Current, int64_t Total, void *ICPrivate); 401 402 /* Most functions return 0 on success */ 403 /* Functions without error message output can be assumed to never fail in a graceful way */ 404 FFMS_API(void) FFMS_Init(int, int); /* Pass 0 to both arguments, kept to partially preserve abi */ 405 FFMS_API(void) FFMS_Deinit(); 406 FFMS_API(int) FFMS_GetVersion(); 407 FFMS_API(int) FFMS_GetLogLevel(); 408 FFMS_API(void) FFMS_SetLogLevel(int Level); 409 FFMS_API(FFMS_VideoSource *) FFMS_CreateVideoSource(const char *SourceFile, int Track, FFMS_Index *Index, int Threads, int SeekMode, FFMS_ErrorInfo *ErrorInfo); 410 FFMS_API(FFMS_AudioSource *) FFMS_CreateAudioSource(const char *SourceFile, int Track, FFMS_Index *Index, int DelayMode, FFMS_ErrorInfo *ErrorInfo); 411 FFMS_API(void) FFMS_DestroyVideoSource(FFMS_VideoSource *V); 412 FFMS_API(void) FFMS_DestroyAudioSource(FFMS_AudioSource *A); 413 FFMS_API(const FFMS_VideoProperties *) FFMS_GetVideoProperties(FFMS_VideoSource *V); 414 FFMS_API(const FFMS_AudioProperties *) FFMS_GetAudioProperties(FFMS_AudioSource *A); 415 FFMS_API(const FFMS_Frame *) FFMS_GetFrame(FFMS_VideoSource *V, int n, FFMS_ErrorInfo *ErrorInfo); 416 FFMS_API(const FFMS_Frame *) FFMS_GetFrameByTime(FFMS_VideoSource *V, double Time, FFMS_ErrorInfo *ErrorInfo); 417 FFMS_API(int) FFMS_GetAudio(FFMS_AudioSource *A, void *Buf, int64_t Start, int64_t Count, FFMS_ErrorInfo *ErrorInfo); 418 FFMS_API(int) FFMS_SetOutputFormatV2(FFMS_VideoSource *V, const int *TargetFormats, int Width, int Height, int Resizer, FFMS_ErrorInfo *ErrorInfo); /* Introduced in FFMS_VERSION ((2 << 24) | (15 << 16) | (3 << 8) | 0) */ 419 FFMS_API(void) FFMS_ResetOutputFormatV(FFMS_VideoSource *V); 420 FFMS_API(int) FFMS_SetInputFormatV(FFMS_VideoSource *V, int ColorSpace, int ColorRange, int Format, FFMS_ErrorInfo *ErrorInfo); /* Introduced in FFMS_VERSION ((2 << 24) | (17 << 16) | (1 << 8) | 0) */ 421 FFMS_API(void) FFMS_ResetInputFormatV(FFMS_VideoSource *V); 422 FFMS_API(FFMS_ResampleOptions *) FFMS_CreateResampleOptions(FFMS_AudioSource *A); /* Introduced in FFMS_VERSION ((2 << 24) | (15 << 16) | (4 << 8) | 0) */ 423 FFMS_API(int) FFMS_SetOutputFormatA(FFMS_AudioSource *A, const FFMS_ResampleOptions*options, FFMS_ErrorInfo *ErrorInfo); /* Introduced in FFMS_VERSION ((2 << 24) | (15 << 16) | (4 << 8) | 0) */ 424 FFMS_API(void) FFMS_DestroyResampleOptions(FFMS_ResampleOptions *options); /* Introduced in FFMS_VERSION ((2 << 24) | (15 << 16) | (4 << 8) | 0) */ 425 FFMS_API(void) FFMS_DestroyIndex(FFMS_Index *Index); 426 FFMS_API(int) FFMS_GetFirstTrackOfType(FFMS_Index *Index, int TrackType, FFMS_ErrorInfo *ErrorInfo); 427 FFMS_API(int) FFMS_GetFirstIndexedTrackOfType(FFMS_Index *Index, int TrackType, FFMS_ErrorInfo *ErrorInfo); 428 FFMS_API(int) FFMS_GetNumTracks(FFMS_Index *Index); 429 FFMS_API(int) FFMS_GetNumTracksI(FFMS_Indexer *Indexer); 430 FFMS_API(int) FFMS_GetTrackType(FFMS_Track *T); 431 FFMS_API(int) FFMS_GetTrackTypeI(FFMS_Indexer *Indexer, int Track); 432 FFMS_API(FFMS_IndexErrorHandling) FFMS_GetErrorHandling(FFMS_Index *Index); 433 FFMS_API(const char *) FFMS_GetCodecNameI(FFMS_Indexer *Indexer, int Track); 434 FFMS_API(const char *) FFMS_GetFormatNameI(FFMS_Indexer *Indexer); 435 FFMS_API(int) FFMS_GetNumFrames(FFMS_Track *T); 436 FFMS_API(const FFMS_FrameInfo *) FFMS_GetFrameInfo(FFMS_Track *T, int Frame); 437 FFMS_API(FFMS_Track *) FFMS_GetTrackFromIndex(FFMS_Index *Index, int Track); 438 FFMS_API(FFMS_Track *) FFMS_GetTrackFromVideo(FFMS_VideoSource *V); 439 FFMS_API(FFMS_Track *) FFMS_GetTrackFromAudio(FFMS_AudioSource *A); 440 FFMS_API(const FFMS_TrackTimeBase *) FFMS_GetTimeBase(FFMS_Track *T); 441 FFMS_API(int) FFMS_WriteTimecodes(FFMS_Track *T, const char *TimecodeFile, FFMS_ErrorInfo *ErrorInfo); 442 FFMS_API(FFMS_Indexer *) FFMS_CreateIndexer(const char *SourceFile, FFMS_ErrorInfo *ErrorInfo); 443 FFMS_API(void) FFMS_TrackIndexSettings(FFMS_Indexer *Indexer, int Track, int Index, int); /* Pass 0 to last argument, kapt to preserve abi. Introduced in FFMS_VERSION ((2 << 24) | (21 << 16) | (0 << 8) | 0) */ 444 FFMS_API(void) FFMS_TrackTypeIndexSettings(FFMS_Indexer *Indexer, int TrackType, int Index, int); /* Pass 0 to last argument, kapt to preserve abi. Introduced in FFMS_VERSION ((2 << 24) | (21 << 16) | (0 << 8) | 0) */ 445 FFMS_API(void) FFMS_SetProgressCallback(FFMS_Indexer *Indexer, TIndexCallback IC, void *ICPrivate); /* Introduced in FFMS_VERSION ((2 << 24) | (21 << 16) | (0 << 8) | 0) */ 446 FFMS_API(FFMS_Index *) FFMS_DoIndexing2(FFMS_Indexer *Indexer, int ErrorHandling, FFMS_ErrorInfo *ErrorInfo); /* Introduced in FFMS_VERSION ((2 << 24) | (21 << 16) | (0 << 8) | 0) */ 447 FFMS_API(void) FFMS_CancelIndexing(FFMS_Indexer *Indexer); 448 FFMS_API(FFMS_Index *) FFMS_ReadIndex(const char *IndexFile, FFMS_ErrorInfo *ErrorInfo); 449 FFMS_API(FFMS_Index *) FFMS_ReadIndexFromBuffer(const uint8_t *Buffer, size_t Size, FFMS_ErrorInfo *ErrorInfo); 450 FFMS_API(int) FFMS_IndexBelongsToFile(FFMS_Index *Index, const char *SourceFile, FFMS_ErrorInfo *ErrorInfo); 451 FFMS_API(int) FFMS_WriteIndex(const char *IndexFile, FFMS_Index *Index, FFMS_ErrorInfo *ErrorInfo); 452 FFMS_API(int) FFMS_WriteIndexToBuffer(uint8_t **BufferPtr, size_t *Size, FFMS_Index *Index, FFMS_ErrorInfo *ErrorInfo); 453 FFMS_API(void) FFMS_FreeIndexBuffer(uint8_t **BufferPtr); 454 FFMS_API(int) FFMS_GetPixFmt(const char *Name); 455 #endif 456