// Universal Codec Format typedef unsigned char byte; typedef enum {MTAudio,MTVideo} MediaType; typedef enum {CTCoder,CTDecoder} CodecType; typedef struct { MediaType Media; int CodecID; CodecType CType; int Version; int DefQuality; char *Name; char *Info; } CodecInfo; typedef struct { int Width,Height; int FPS; // Frames per second int NumFrames; int Format; // UCF_FMT_xxx int Quality; } VideoInfo; typedef struct { int Channels; // Mono/Stereo/Kvadro :) int BytesPerSample; // Sample size int SamplesPerSecond; // Sample rate int FrameSize; // Min size of input for encoder (in samples) int Quality; } AudioInfo; typedef int ( *GetCodecInfoProc)(CodecInfo*); typedef int (*GetFormatsProc)(void*); typedef int (*GetFrameSizesProc)(int,int,int *,int *,int *, int); typedef int (*SetQualityProc)(void *,int); typedef int (*AskFormatProc)(void *, void *); typedef int (*ProcessFrameProc)(void *,byte *,int *,int,byte *,int,byte *); typedef void (*CloseCodecProc)(void *); typedef int (*InitCodecProc)(void *,void **); typedef int (*PutCodecHeaderProc)(void *,byte *,int *); typedef int (*GetCodecHeaderProc)(byte *, int *, void *); // Error Codes #define UCFERR_OK 0 // OK. #define UCFERR_UNSUP 1 // Function unsupported #define UCFERR_NOMEM 2 // Out of memory #define UCFERR_ERR 3 // Other error // Codec's i/o formats #define UCF_FMT_ANY 0 // Any format // - Video #define UCF_FMT_BGR 1 // BGR,BGR,BGR #define UCF_FMT_YUV444 2 // YUV,YUV,YUV #define UCF_FMT_SYUV444 3 // Separate buffers Y,U,V #define UCF_FMT_SYUV411 4 // Separate buffers Y,U,V. U,V downsampled. // - Audio #define UCF_FMT_PCM #define UCF_FMT_TELP16000 // Flags for ProcessFrame #define PF_NONE 0 // No flags #define PF_KEY 1 // Make Key-frame #define PF_FAST 2 // As fast as possible // Return values for ProcessFrame #define UCF_PF_CODEAGAIN // Input is processed partily, supply same input // for next call #define UCF_PF_NOOUTPUT // Output is not generated, supply next input data // for next call // UpDown Value for GetFrameSizes() #define UCF_SEARCH_ANY 0 #define UCF_SEARCH_UP 1 #define UCF_SEARCH_DOWN 2 // Rule Value for GetFrameSizes() #define UCF_RULE_ANY 0 // Any frame sizes #define UCF_RULE_D2 2 // Sizes divisible by 2 #define UCF_RULE_D4 4 // Sizes divisible by 4 #define UCF_RULE_D8 8 // Sizes divisible by 8 #define UCF_RULE_D16 16 // Sizes divisible by 16 #define UCF_RULE_D32 32 // Sizes divisible by 32 #define UCF_RULE_STEPS 0x10000001 // Wavelet steps