📄 prmdec.h
字号:
void* pInitParams,
UINT32 ulInitParamsSize,
ra_format_info* pStreamInfo);
void ra_decode_destroy(ra_decode* pFrontEnd);
typedef struct rv_format_info_struct
{
UINT32 ulLength;
UINT32 ulMOFTag;
UINT32 ulSubMOFTag;
UINT16 usWidth;
UINT16 usHeight;
UINT16 usBitCount;
UINT16 usPadWidth;
UINT16 usPadHeight;
UFIXED32 ufFramesPerSecond;
UINT32 ulOpaqueDataSize;
BYTE* pOpaqueData;
} rv_format_info;
typedef struct rv_segment_struct
{
HXBOOL bIsValid;
UINT32 ulOffset;
} rv_segment;
typedef struct rv_frame_struct
{
UINT32 ulDataLen;
BYTE* pData;
UINT32 ulTimestamp;
UINT16 usSequenceNum;
UINT16 usFlags;
HXBOOL bLastPacket;
UINT32 ulNumSegments;
rv_segment* pSegment;
} rv_frame;
typedef struct rv_backend_init_params_struct
{
UINT16 usOuttype;
UINT16 usPels;
UINT16 usLines;
UINT16 usPadWidth; /* number of columns of padding on right to get 16 x 16 block*/
UINT16 usPadHeight; /* number of rows of padding on bottom to get 16 x 16 block*/
UINT16 pad_to_32; /* to keep struct member alignment independent of */
/* compiler options */
UINT32 ulInvariants;
/* ulInvariants specifies the invariant picture header bits */
INT32 bPacketization;
UINT32 ulStreamVersion;
} rv_backend_init_params;
typedef struct rv_backend_in_params_struct
{
UINT32 dataLength;
INT32 bInterpolateImage;
UINT32 numDataSegments;
rv_segment *pDataSegments;
UINT32 flags;
/* 'flags' should be initialized by the front-end before each */
/* invocation to decompress a frame. It is not updated by the decoder. */
/* */
/* If it contains RV_DECODE_MORE_FRAMES, it informs the decoder */
/* that it is being called to extract the second or subsequent */
/* frame that the decoder is emitting for a given input frame. */
/* The front-end should set this only in response to seeing */
/* an RV_DECODE_MORE_FRAMES indication in H263DecoderOutParams. */
/* */
/* If it contains RV_DECODE_DONT_DRAW, it informs the decoder */
/* that it should decode the image (in order to produce a valid */
/* reference frame for subsequent decoding), but that no image */
/* should be returned. This provides a "hurry-up" mechanism. */
UINT32 timestamp;
} rv_backend_in_params;
typedef struct rv_backend_out_params_struct
{
UINT32 numFrames;
UINT32 notes;
/* 'notes' is assigned by the transform function during each call to */
/* decompress a frame. If upon return the notes parameter contains */
/* the indication RV_DECODE_MORE_FRAMES, then the front-end */
/* should invoke the decoder again to decompress the same image. */
/* For this additional invocation, the front-end should first set */
/* the RV_DECODE_MORE_FRAMES bit in the 'H263DecoderInParams.flags' */
/* member, to indicate to the decoder that it is being invoked to */
/* extract the next frame. */
/* The front-end should continue invoking the decoder until the */
/* RV_DECODE_MORE_FRAMES bit is not set in the 'notes' member. */
/* For each invocation to decompress a frame in the same "MORE_FRAMES" */
/* loop, the front-end should send in the same input image. */
/* */
/* If the decoder has no frames to return for display, 'numFrames' will */
/* be set to zero. To avoid redundancy, the decoder does *not* set */
/* the RV_DECODE_DONT_DRAW bit in 'notes' in this case. */
UINT32 timestamp;
/* The 'temporal_offset' parameter is used in conjunction with the */
/* RV_DECODE_MORE_FRAMES note, to assist the front-end in */
/* determining when to display each returned frame. */
/* If the decoder sets this to T upon return, the front-end should */
/* attempt to display the returned image T milliseconds relative to */
/* the front-end's idea of the presentation time corresponding to */
/* the input image. */
/* Be aware that this is a signed value, and will typically be */
/* negative. */
UINT32 width;
UINT32 height;
/* Width and height of the returned frame. */
/* This is the width and the height as signalled in the bitstream. */
} rv_backend_out_params;
typedef HX_RESULT(*rv_backend_init_fp)(void *prv10Init,
void **global);
typedef HX_RESULT(*rv_backend_decode_fp)(UCHAR *pRV10Packets,
UCHAR *pDecodedFrameBuffer,
void *pInputParams,
void *pOutputParams,
void *global);
typedef HX_RESULT(*rv_backend_custom_message_fp)(UINT32 *msg_id,
void *global);
typedef HX_RESULT(*rv_backend_hive_message_fp)(UINT32 *msg,
void *global);
typedef HX_RESULT(*rv_backend_free_fp)(void* global);
/* The rv_backend struct contains the RealVideo decoder backend
* function pointers. */
typedef struct rv_backend_struct
{
rv_backend_init_fp fpInit;
rv_backend_decode_fp fpDecode;
rv_backend_custom_message_fp fpCustomMessage;
rv_backend_hive_message_fp fpHiveMessage;
rv_backend_free_fp fpFree;
} rv_backend;
typedef HX_RESULT(*rv_frame_avail_func_ptr)(void* pAvail, UINT32 ulSubStreamNum, rv_frame* frame);
typedef void rv_depack;
rv_depack* rv_depack_create(void* pAvail,
rv_frame_avail_func_ptr fpAvail,
void* pUserError,
rm_error_func_ptr fpError);
typedef struct rv_depack_internal_struct
{
void* pAvail;
rv_frame_avail_func_ptr fpAvail;
rm_error_func_ptr fpError;
void* pUserError;
rm_malloc_func_ptr fpMalloc;
rm_free_func_ptr fpFree;
void* pUserMem;
UINT32 ulZeroTimeOffset;
HX_BITFIELD bHasRelativeTimeStamps;
rm_rule_map rule2Flag;
rm_multistream_hdr multiStreamHdr;
rv_format_info* pSubStreamHdr;
HXBOOL* bIgnoreSubStream;
HXBOOL bStreamSwitchable;
UINT32 ulActiveSubStream;
rv_frame* pCurFrame;
HXBOOL bBrokenUpByUs;
HXBOOL bCreatedFirstFrame;
UINT32 ulLastSeqNumIn;
UINT32 ulLastSeqNumOut;
} rv_depack_internal;
typedef struct rv_decode_struct
{
rm_error_func_ptr fpError;
/* User defined error function. */
void* pUserError;
/* User defined parameter for error function. */
rm_malloc_func_ptr fpMalloc;
/* User defined malloc function. */
rm_free_func_ptr fpFree;
/* User defined free function. */
void* pUserMem;
/* User defined parameter for malloc and free functions. */
UINT32 ulSPOExtra;
/* The SPO Extra bits. Opaque data appended to bitstream header. */
UINT32 ulStreamVersion;
/* The stream version. Opaque data following the SPO Extra bits. */
UINT32 ulMajorBitstreamVersion;
/* The major bitstream version. Indicates RV7, RV8, RV9, etc. */
UINT32 ulMinorBitstreamVersion;
/* The minor bitstream version. Indicates minor revision or RAW. */
UINT32 ulNumResampledImageSizes;
/* The number of RPR sizes. Optional RV7 and RV8 opaque data. */
UINT32 ulEncodeSize;
/* The maximum encoded frame dimensions. Optional RV9 opaque data.*/
UINT32 ulLargestPels;
/* The maximum encoded frame width. */
UINT32 ulLargestLines;
/* The maximum encoded frame height. */
UINT32 pDimensions[2*(8+1)];
/* Table of encoded dimensions, including RPR sizes. */
UINT32 ulOutSize;
/* The maximum size of the output frame in bytes. */
UINT32 ulECCMask;
/* Mask for identifying ECC packets. */
UINT32 bInputFrameIsReference;
/* Identifies whether input frame is a key frame or not. */
UINT32 ulInputFrameQuant;
/* The input frame quantization parameter. */
rv_format_info *pBitstreamHeader;
/* The bitstream header. */
rv_frame *pInputFrame;
/* Pointer to the input frame struct. */
void *pDecodeState;
/* Pointer to decoder backend state. */
rv_backend *pDecode;
/* Decoder backend function pointers. */
rv_backend_init_params pInitParams;
/* Initialization parameters for the decoder backend. */
rv_backend_in_params pInputParams;
/* The decoder backend input parameter struct. */
rv_backend_out_params pOutputParams;
/* The decoder backend output parameter struct. */
} rv_decode;
rv_decode* rv_decode_create(void* pUserError, rm_error_func_ptr fpError);
/* rm file header -- all real media files start with this header */
struct rm_file_hdr
{
UINT32 id; /* unique identifier for this header */
UINT32 size; /* size of header in file */
UINT16 version; /* struct version */
UINT32 file_version; /* revision number for realmedia file */
UINT32 num_headers; /* num headers in file (including this one) */
};
/* rm properties header -- summarizes data for entire clip */
struct rm_properties_hdr
{
UINT32 id; /* unique identifier for this header */
UINT32 size; /* size of header in file */
UINT16 version; /* struct version */
UINT32 max_bit_rate; /* maximum bit rate of clip */
UINT32 avg_bit_rate; /* average bit rate of clip */
UINT32 max_pkt_size; /* max length of packet in clip (bytes) */
UINT32 avg_pkt_size; /* averge length of packet in clip (bytes) */
UINT32 num_pkts; /* total packets in clip (all streams) */
UINT32 duration; /* duration of clip (milliseconds) */
UINT32 preroll; /* preroll time (milliseconds) */
UINT32 index_offset; /* offset to beginning of index data */
UINT32 data_offset; /* offset to beginning of packet data */
UINT16 num_streams; /* total number of streams in clip */
UINT16 flags; /* various and sundry */
};
typedef struct rm_parser_internal_struct
{
rm_error_func_ptr fpError;
void* pUserError;
rm_malloc_func_ptr fpMalloc;
rm_free_func_ptr fpFree;
void* pUserMem;
void* /*rm_read_func_ptr*/ fpRead;
void* /*rm_seek_func_ptr*/ fpSeek;
void* pUserRead;
struct rm_file_hdr fileHdr;
struct rm_properties_hdr propHdr;
#if 0
struct rm_content_hdr contHdr;
UINT32 ulNumStreams;
UINT32 ulNumMediaPropsHdrs;
UINT32 ulNumMediaPropsHdrsAlloc;
struct rm_media_props_hdr* pMediaPropsHdr;
UINT32 ulNumLogicalStreamHdrs;
struct rm_logical_stream_hdr* pLogicalStreamHdr;
struct rm_logical_stream_hdr* pLogicalFileInfo;
BYTE* pReadBuffer; /* Read buffer */
UINT32 ulReadBufferSize; /* Allocated size of the read buffer */
UINT32 ulNumBytesRead; /* Current number of bytes read into the buffer */
UINT32 ulCurFileOffset; /* Current read offset into the file */
UINT32 ulStreamNumMapSize;
UINT32* pulStreamNumMap;
UINT32 ulMaxDuration;
struct rm_stream_info* pStreamInfo;
struct rm_data_hdr dataHdr;
HXBOOL bIsRealDataType;
UINT32 ulMinFirstPacketTime;
rm_stream_header* pStreamHdr;
UINT32 ulKeyframesNeeded;
#endif
} rm_parser_internal;
#define RAW_RVG2_MAJOR_VERSION 2
#define RAW_RV8_MAJOR_VERSION 3
#define RAW_RV9_MAJOR_VERSION 4
extern void rm_parseri_file_seek(rm_parser_internal* pInt, UINT32 ulOffset, UINT32 ulOrigin);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -