[Libav-user] Suggest how to propery fill incomming AVFrame pointer in a decoder !

ssshukla26 ssshukla26 at gmail.com
Sat Aug 13 14:38:29 EEST 2016


My video decoder is decoding both mp4 files and h264 files. I just wanted to
make sure that the way am filling incoming AVFrame pointer is proper or not,
code snippet as shown below.

int *qhw_decode_frame* (AVCodecContext *avctx, *void *pFrame*, int
*got_frame, AVPacket *avpkt)
{
...
    AVFrame *avframe = (AVFrame *) pFrame;
    avframe->width  = avctx->width; //width is1920
    avframe->height = avctx->height; //height is 1080
    avframe->format = AV_PIX_FMT_YUV420P;

    if(!(*av_frame_get_buffer(avframe,1)* < 0))
    {
         //Copy decoded data to avframe->data pointer.
    }
...
}


The above is the only a snippet of the code. I just want to understand that
using *av_frame_get_buffer* is correct way to get data buffers to fill
decoded data ?

I am copying decoded data in data buffer of avframe pointer, is that correct
?

The reason am asking this question is with ffmpeg my above code is working
but when I integrate my ffmpeg with chromium, its crashing when I copy
decoded data to avframe data pointers !



--
View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Suggest-how-to-propery-fill-incomming-AVFrame-pointer-in-a-decoder-tp4662417.html
Sent from the libav-users mailing list archive at Nabble.com.


More information about the Libav-user mailing list