FFMPEG学习【libavcodec】:解码:帧解析

一、数据结构

struct  	AVCodecParserContext
struct  	AVCodecParser



二、枚举

enum  	AVPictureStructure { 
	AV_PICTURE_STRUCTURE_UNKNOWN, 
	AV_PICTURE_STRUCTURE_TOP_FIELD, 
	AV_PICTURE_STRUCTURE_BOTTOM_FIELD, 
	AV_PICTURE_STRUCTURE_FRAME 
}


三、函数

1、AVCodecParser * av_parser_next(const AVCodecParser * c)


2、void av_register_codec_parser(AVCodecParser * parser)


3、AVCodecParserContext * av_parser_init (int codec_id)


4、int av_parser_parse2 (AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int64_t pts, int64_t dts, int64_t pos)

注释:解析一个数据包。

参数:s-解析上下文

    avctx-编解码上下文

    poutbuf-设置为指向解析缓冲区的指针,如果尚未完成则设置为NULL。

    poutbuf_size-设置为解析缓冲区的大小,如果尚未完成则设置为零。

    buf-输入缓冲

    buf_size-无填充的缓冲区大小(以字节为单位)。 即 假定完整缓冲区大小为buf_size + AV_INPUT_BUFFER_PADDING_SIZE。 要发送EOF信号,应该为设置为0(这样可以输出最后一帧)。

    pts-输入显示时间戳。

    dts-输入解码时间戳

    pos-在流中输入字节位置。

返回:使用的输入比特流的字节数。


5、int av_parser_change (AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe)

返回:如果输出缓冲区是输入的子集,则返回0,返回1,如果输出缓冲区被分配,且必须被释放。

废弃:使用AVBitStreamFilter


6、void av_parser_close (AVCodecParserContext *s)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值