[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gstreamer-devel
Subject:    Re: [gst-devel] Upstream negotiation
From:       Michael Smith <msmith () fluendo ! com>
Date:       2006-11-28 15:28:58
Message-ID: 1164727738.5653.2.camel () localhost ! localdomain
[Download RAW message or body]

On Tue, 2006-11-28 at 15:21 +0000, Will Newton wrote:
> Hi all,
> 
> I'm writing a plugin to interface to a hardware device that needs
> buffers alloced in a certain way. So I wrote a buffer_alloc function
> for my plugin, which I thought looked like the right thing to do. I
> setup a pipeline like this:
> 
> gst-launch filesrc location=foo.mp3 ! mysink
> 
> But my buffer_alloc function is not called as I had expected, filesrc
> just does gst_buffer_new() and passes the buffer to me regardless that
> my sink has a buffer_alloc function. Is there any way to force my
> buffer_alloc function to be used? Is filesrc correct to alloc buffers
> in this way?


Normally, elements should do buffer allocation properly, but a) many
don't, and b) that is not enough by itself to ensure that the buffers
will be of the right type (it's not always possible).

The right thing to do is, in your chain function, check what type the
buffer is. If it's one of your custom-allocated buffers, great! Just use
it. If it isn't, then at that point you should allocate a buffer, and
copy the contents of the incoming buffer into your buffer before using
it.

Mike



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic