[gst-devel] Use of own buffer_alloc function

Felipe Contreras felipe.contreras at gmail.com
Sat Mar 14 13:49:17 CET 2009


On Thu, Mar 12, 2009 at 1:02 PM, TK, Pratheesh Gangadhar
<pratheesh at ti.com> wrote:
>
>
>> -----Original Message-----
>> From: Felipe Contreras [mailto:felipe.contreras at gmail.com]
>> Sent: Thursday, March 12, 2009 3:00 PM
>> To: Discussion of the development of GStreamer
>> Subject: Re: [gst-devel] Use of own buffer_alloc function
>>
>> On Thu, Mar 12, 2009 at 11:12 AM, Tim-Philipp Müller <t.i.m at zen.co.uk>
>> wrote:
>> > On Thu, 2009-03-12 at 09:29 +0200, Felipe Contreras wrote:
>> >
>> >> The filesrc is probably accessing the file with mmap,
>> >
>> > FWIW, filesrc does not use mmap by default, you have to enable that
>> > manually by setting the right properties (this is mostly for error
>> > handling reasons).
>> >
>> >> and doing pad_alloc on the demuxer.
>> >
>> > Not sure what you mean by that, but I doubt filesrc ever does a
>> > gst_pad_alloc_buffer() downstream, since this doesn't really make much
>> > sense afaics.
>>
>> Right, I was contradicting myself.
>>
>> Still the point remains: the memory domains of filesrc and a dma sink
>> are separate, so a memcpy/mmap is unavoidable.
>>
>
> This can be quite a bit of an overhead for camera capture use cases in embedded devices - V4L2 driver allocates buffers and resizes before sending to encoder. We resize to a pad_alloc buffer from encoder_input_pad for contiguous buffer. We have patched v42src for doing this and don’t understand why this can’t work. Memcpy at encoder input for raw video frames is a significant overhead.

This is an entirely different use case.

In video capturing you want the raw frames coming from the src
(mmaped) to be used directly as they are by the encoder (no memcpy).
If it's a software encoder there's obviously no need to memcpy because
the memory is already available trough the mmap. In the case of
hardware encoder all you need is another mmap to the encoder device
(running on the DSP).

I don't understand why you had to patch v4l2src to avoid memcpy.

-- 
Felipe Contreras




More information about the gstreamer-devel mailing list