封装音频和视频帧的数据类型

定义


struct rts_frame
{
    void buf;
    int size;
    int is_audio;
    unsigned long long pts;
    unsigned long long dts;
    int flag;
    int duration;
    void (free_ptr)(struct rts_frame *);
    unsigned int uid;
};
                    

成员

成员 解释
buf frame数据buffer
size buf的字节数
is_audio 1: 音频帧;0: 视频帧
pts presentation time stamp, in ms
dts decoding time stamp, in ms
flag 当视频帧的时候(is_audio == 0), bit 0: key frame flag; bit 1: corruption flag
duration frame duration, in ms
free_ptr 函数指针,用来释放当前的rts_frame对象
uid reserved

Remarks

free_ptr: 参数是需要释放的rts_frame对象,比如:

frm->free_ptr(frm);