【发布时间】:2014-07-07 18:52:05
【问题描述】:
我正在阅读这篇文章,How to integrate a codec in FFMPEG multimedia framework。
根据它,每个编解码器需要定义3个基本函数,并将这些函数分配给结构AVCodec的函数指针。
上篇文章中指定的3个函数指针分别是:
.init -> takes care of allocations and other initializations
.close -> freeing the allocated memory and de-initializations
.decode -> frame by frame decoding.
对于函数指针.decode,分配的函数为:
static int cook_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size) {
...
这些参数的细节在上面的文章中有详细说明。但是,在最新的代码中,以同样的函数为例,其声明如下:
static int cook_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
我需要对内存进行一些映射操作。所以,我请求是否有人可以在函数声明中解释上述参数。另外,哪个参数具有用于解码帧的输入缓冲区?解码一帧后,解码后的帧映射到哪个参数?
【问题讨论】:
标签: video ffmpeg codec decoder