[FFmpeg-devel] v4l2: bug #1570 and possible solution

Giorgio Vazzana mywing81 at gmail.com
Tue Feb 12 12:37:58 CET 2013


2013/2/10 Giorgio Vazzana <mywing81 at gmail.com>:
> 2013/2/10 Stefano Sabatini <stefasab at gmail.com>:
>> Also why aren't they dequeued?
>
> In v4l2.c::mmap_read_frame() I see:
>
> 609     pkt->data= s->buf_start[buf.index];
> 610     pkt->size = buf.bytesused;
>
> 615     pkt->destruct = mmap_release_buffer;


> so:
> 1) the data in the buffer is not copied to the packet, only a pointer is passed;
> 2) mmap_release_buffer() will be called when the packet is destroyed,
> and it will dequeue the buffer (as far as I can tell, the only code
> that can call mmap_release_buffer() is outside of v4l2.c)
>
> This means that as long as we need the packets, we cannot destroy
> them, and thus we cannot dequeue the buffers.

Sorry, this should read:
so:
1) the data in the buffer is not copied to the packet, only a pointer is passed;
2) mmap_release_buffer() will be called when the packet is destroyed,
and it will ENQUEUE the buffer (as far as I can tell, the only code
that can call mmap_release_buffer() is outside of v4l2.c)

This means that as long as we need the packets, we cannot destroy
them, and thus we cannot ENQUEUE the buffers.


More information about the ffmpeg-devel mailing list