在应用层,很多时候 IDR、SEI、PPS、SPS 是打包在一起收到的, 需要手动解析出这几种帧类型。
定义 nalu 结构:
typedef struct
{
uint32_t len; //! Length of the NAL unit (Excluding the start code, which does not belong to the NALU)
int32_t forbidden_bit; //! should be always FALSE
int32_t nal_reference_idc; //! NALU_PRIORITY_xxxx
int32_t nal_unit_type; //! NALU_TYPE_xxxx
char *buf; //! contains the first byte followed by the EBSP
} NALU_t;