[Libav-user] How to process incomming AVFrame pointer in a decoder ?

2016-07-15 Thread ssshukla26
Hi,

I am implementing the custom decoder of qualcomm chipset into ffmpeg, have a
working linux application for the same. Every thing is working fine except
one thing, that is I am unable to fill decoded data into in coming AVFrame
pointer. 

My implementation of decoder has the following function to decode frames,
*int qhw_decode_frame (AVCodecContext *avctx, void *pframe, int *got_frame,
AVPacket *avpkt);*

First of all the do_decode call was asserting with the following error
*Assertion avctx->internal->buffer_frame->buf[0] failed at
libavcodec/utils.c:2772*

So I used *av_frame_get_buffer* function to allocate memory to data buffers,
but still the pipe (as follows) isn't working.

*$ ffmpeg -f h264 -c:v h264_qhw -i no_mans_sky_1080p_10sec.h264 -vcodec
rawvideo -pix_fmt nv12_tiled -s 1920x1080 -r 30 output.yuv -loglevel debug
*

Note: I confirm my decoder is working by *dumping* the first decode frame on
a file, as the decode function is only called once and then it hang up, just
hanp up and do nothing.

Please help am so much stuck, please guyz need some insight on how to
process and fill the incoming AVFrame pointer from do_decode function.




--
View this message in context: 
http://libav-users.943685.n4.nabble.com/Libav-user-How-to-process-incomming-AVFrame-pointer-in-a-decoder-tp4662357.html
Sent from the libav-users mailing list archive at Nabble.com.
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


[Libav-user] Memory leak using AVStream

2016-07-15 Thread David Nguyen
Hi,

I am upgrading from FFmpeg 2.8.4 to 3.1.1, and changing code to not use
AVStream.codec anymore. By doing so, I get a memory leak with valgrind,
here's the trace

==15481==at 0x4A07306: memalign (vg_replace_malloc.c:532)
==15481==by 0x4A0735F: posix_memalign (vg_replace_malloc.c:660)
==15481==by 0x6EA3E48: av_malloc (mem.c:97)
==15481==by 0x6EA4165: av_mallocz (mem.c:254)
==15481==by 0x599D3E8: init_context_defaults (options.c:127)
==15481==by 0x599D540: avcodec_alloc_context3 (options.c:163)
==15481==by 0x6BDED26: avformat_new_stream (utils.c:4098)

Seems like AVCodecContext.priv_data is not being freed.

Looking at the code, the AVStream.codec is still being allocated by you and
freed here
https://www.ffmpeg.org/doxygen/3.1/libavformat_2utils_8c_source.html at
line 3980.

Because I am experiencing a leak, shouldn't that line be
avcodec_free_context(>codec) or avcodec_close(st->codec) as it is an
AVCodecContext ?

I used to close st->codec myself before this deprecation.
What am I missing here?

Thanks,

David
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user