📄 umc_structures.h
字号:
// The encoder should reorder the incoming frames in the encoding order itself. FLAG_VENC_REORDER = 0x00000004 }; enum // color space conversion flag(s) { FLAG_CCNV_NONE = 0x00000000, // do not use conversion FLAG_CCNV_CONVERT = 0x00000001, // use color conversion FLAG_CCNV_RESIZE_2S = 0x00000002 | FLAG_CCNV_CONVERT, // convert & subsampling by 2 FLAG_CCNV_RESIZE_4S = 0x00000004 | FLAG_CCNV_CONVERT, // convert & subsampling by 4 FLAG_CCNV_RESIZE_8S = 0x00000006 | FLAG_CCNV_CONVERT, // convert & subsampling by 8 FLAG_CCNV_RESIZE_2X = 0x0000000a | FLAG_CCNV_CONVERT, // convert & oversampling by 2 FLAG_CCNV_RESIZE_4X = 0x0000000c | FLAG_CCNV_CONVERT, // convert & oversampling by 4 FLAG_CCNV_RESIZE_8X = 0x0000000e | FLAG_CCNV_CONVERT, // convert & oversampling by 8 FLAG_CCNV_RESIZE_CUSTOM = 0x00000010 | FLAG_CCNV_CONVERT, // convert & custom resize FLAG_CCNV_DEINTERLACE = 0x00000001 // perform deinterlace after conversion }; enum // video renderer flags { //render inited with this flag will rerder decompressed data from decoder //in proper display order //see FLAG_VDEC_REORDER flag as pair for this FLAG_VREN_REORDER = 0x00000001, FLAG_VREN_CONVERT = 0x00000002, FLAG_VREN_USECOLORKEY = 0x00000004 }; enum AudioChannelConfig { CHANNEL_FRONT_LEFT = 0x1, CHANNEL_FRONT_RIGHT = 0x2, CHANNEL_FRONT_CENTER = 0x4, CHANNEL_LOW_FREQUENCY = 0x8, CHANNEL_BACK_LEFT = 0x10, CHANNEL_BACK_RIGHT = 0x20, CHANNEL_FRONT_LEFT_OF_CENTER = 0x40, CHANNEL_FRONT_RIGHT_OF_CENTER = 0x80, CHANNEL_BACK_CENTER = 0x100, CHANNEL_SIDE_LEFT = 0x200, CHANNEL_SIDE_RIGHT = 0x400, CHANNEL_TOP_CENTER = 0x800, CHANNEL_TOP_FRONT_LEFT = 0x1000, CHANNEL_TOP_FRONT_CENTER = 0x2000, CHANNEL_TOP_FRONT_RIGHT = 0x4000, CHANNEL_TOP_BACK_LEFT = 0x8000, CHANNEL_TOP_BACK_CENTER = 0x10000, CHANNEL_TOP_BACK_RIGHT = 0x20000, CHANNEL_RESERVED = 0x80000000 }; enum // audio renderer flags { FLAG_AREN_VOID = 0x00000001 }; enum // splitter flags { //invalid value UNDEF_SPLITTER = 0x00000000, //audio splittinf required in any present in stream AUDIO_SPLITTER = 0x00000001, //video splitting required in any present in stream VIDEO_SPLITTER = 0x00000002, //example if setup VIDEO_SPLITTER && !set AUDIO_SPLITTER, splitter will ignore //any audio elementary stream, only video data request will be valid //audio and video splitting required if any present in stream AV_SPLITTER = AUDIO_SPLITTER|VIDEO_SPLITTER, //main video header (sequence header) is required to return from Init //splitter function, application is responsible to pass it to decoder //as a regular video data for properly decoding consequent data FLAG_VSPL_VIDEO_HEADER_REQ = 0x00000010, //the first video frame is required to return from Init //splitter function, application is responsible to pass it to decoder //as a regular video data for properly decoding consequent data. //The first frame will follow main video header. This flag expands //splitter behavior for FLAG_VSPL_VIDEO_HEADER_REQ case FLAG_VSPL_VIDEO_FRAME_REQ = 0x00000020, FLAG_VSPL_AUDIO_INFO_REQ = 0x00000040, FLAG_VSPL_VIDEO_INFO_REQ = 0x00000080, //next flag describes endian rlated properties of input data //when set, means that coded data should be accessed by 4-reading operations //for little-endian systems it means that each 4 bytes are swapped //i.e [0]<->[3], [1]<->[2] //for big-endian systems swapping is not required FLAG_VSPL_4BYTE_ACCESS = 0x00000100, //traditional, not UMC specific behaviour //original byte order, headers before data, return bytes consumed FLAG_VSPL_COMPATIBLE = 0x00001000, //some splitters may have a behavior to run internal //to prohibit asynchronious splitting use this flag FLAG_VSPL_NO_INTERNAL_THREAD= 0x00002000 }; enum // values to select video or audio output channels { SELECT_ANY_VIDEO_PID = 0x00000000, //ask for one of available video streams SELECT_ANY_AUDIO_PID = 0x00000000, //ask for one of available audio streams SELECT_ALL_AUDIO_PIDS = 0xffffffff, //ask for all of available audio streams SELECT_ALL_VIDEO_PIDS = 0xffffffff //ask for all of available video streams }; enum { SINGLE_CLIENT = 0, // Connection oriented with single client per server MULTIPLE_CLIENTS, // Connection oriented with multiple clients per server BROADCAST // Connection less mode }; enum { MAXIMUM_PATH = 1024 }; typedef struct sAudioStreamInfo { int channels; // (int) number of audio channels int sample_frequency; // (int) sample rate in Hz vm_var32 bitrate; // (vm_var32) bitstream in bps vm_var32 bitPerSample; // (vm_var32) 0 if compressed double duration; // (double) duration of the stream AudioStreamType stream_type; // (AudioStreamType) general type of stream AudioStreamSubType stream_subtype; // (AudioStreamSubType) minor type of stream vm_var32 channel_mask; // (vm_var32) channel mask vm_var32 streamPID; // (vm_var32) unique ID } AudioStreamInfo; typedef struct sClipInfo { int width; // (int) width of media int height; // (int) height of media } ClipInfo; typedef struct sVideoStreamInfo { ClipInfo clip_info; // (ClipInfo) size of video stream ColorFormat color_format; // (ColorFormat) color format of uncompressed video vm_var32 bitrate; // (vm_var32) bitrate of video int aspect_ratio_width; // (int) video aspect ratio width int aspect_ratio_height; // (int) video aspect ratio height double framerate; // (double) frame rate of video double duration; // (double) duration of media stream InterlaceType interlace_type; // (InterlaceType) interlaced info VideoStreamType stream_type; // (VideoStreamType) video stream type VideoStreamSubType stream_subtype; // (VideoStreamSubType) video stream type vm_var32 streamPID; // (vm_var32) unique ID } VideoStreamInfo; typedef struct sSystemStreamInfo { double muxrate; // (double) stream bitrate SystemStreamType stream_type; // (SystemStreamType) stream type } SystemStreamInfo; struct RECT { RECT(): left(0), top(0), right(0), bottom(0) {} signed short left; signed short top; signed short right; signed short bottom; inline void SwapBigEndian() { left = BIG_ENDIAN_SWAP16(left); top = BIG_ENDIAN_SWAP16(top); right = BIG_ENDIAN_SWAP16(right); bottom = BIG_ENDIAN_SWAP16(bottom); } }; enum eUMC_Status { UMC_OK = VM_OK, //0, // no error UMC_OPERATION_FAILED = VM_OPERATION_FAILED, //-999, UMC_NOT_INITIALIZED = VM_NOT_INITIALIZED, //-998, UMC_TIMEOUT = VM_TIMEOUT, //-987, UMC_NOT_ENOUGH_DATA = VM_NOT_ENOUGH_DATA, //-996, // not enough input data UMC_NULL_PTR = VM_NULL_PTR, // null pointer in input parameters UMC_SO_CANT_LOAD = VM_SO_CANT_LOAD, UMC_SO_INVALID_HANDLE = VM_SO_INVALID_HANDLE, UMC_SO_CANT_GET_ADDR = VM_SO_CANT_GET_ADDR, UMC_FAILED_TO_INITIALIZE =-899, // failed to initialize codec UMC_NOT_FIND_SYNCWORD =-897, // can't find sync word in buffer UMC_NOT_ENOUGH_BUFFER =-896, // not enough buffer to put output data UMC_END_OF_STREAM =-895, UMC_FAILED_TO_OPEN_DEVICE =-894, UMC_FAILED_TO_ALLOCATE_BUFFER =-883, UMC_BAD_FORMAT =-882, UMC_ALLOC =-881, UMC_BAD_STREAM =-880, UMC_UNSUPPORTED =-879, UMC_NOT_IMPLEMENTED =-878, UMC_STOP =-877, UMC_FLAGS_ERROR =-876, UMC_WRN_NOT_CRITICAL_BAD_FORMAT = 1, UMC_WAIT_FOR_REPOSITION = 2 }; typedef int Status; const vm_char* GetErrString(Status ErrCode); const vm_char* GetStreamTypeString(SystemStreamType Code); const vm_char* GetFormatTypeString(ColorFormat Code); const vm_char* GetAudioTypeString(AudioStreamType Code); const vm_char* GetVideoTypeString(VideoStreamType Code); const vm_char* GetVideoRenderTypeString(VideoRenderType Code); const vm_char* GetAudioRenderTypeString(AudioRenderType Code);#ifdef __ICL// Intel compiler makes a remark// "template parameter "T" is not used// in declaring the parameter types of function template"#pragma warning(disable : 488)// Intel compiler makes a remark// "invalid type conversion"#pragma warning(disable : 171)#endif // __ICL enum { DEFAULT_ALIGN_VALUE = 16 }; // forward declaration of template template<class T> T align_pointer(void *lpv, size_t lAlignValue = DEFAULT_ALIGN_VALUE); // inline implementation of template template<class T> T align_pointer(void *lpv, size_t lAlignValue) { // some compilers complain to conversion to/from // pointer types from/to integral types. return (T) ((((size_t) (lpv)) + (lAlignValue - 1)) & ~(lAlignValue - 1)); } // forward declaration of template template<class T> T align_value(size_t nValue, size_t lAlignValue = DEFAULT_ALIGN_VALUE); // inline implementation of template template<class T> T align_value(size_t nValue, size_t lAlignValue) { return static_cast<T> ( (nValue + (lAlignValue - 1)) & ~(lAlignValue - 1)); }#ifdef __ICL#pragma warning(default : 488)#endif // __ICL} // namespace UMC#endif /* __UMC_STRUCTURES_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -