appsrc fed data python

Sebastian Dröge sebastian at
Sun Feb 23 01:30:36 PST 2014

On Fr, 2014-02-21 at 01:03 -0800, troywang wrote:
> hi all:
> I wanna using python gstreamer to do something。I use appsrc。  
> appsrc.connect('need-data',need_data)
> def need_data(self,src, need_bytes):
> = self.stream_queue.dequeue()
>         src.emit('push-buffer',
> I wanna insert into appsrc,But it told me needing Gst.buffer
> data,what should I do? 	

You can use e.g.
buf = Gst.Buffer.new_allocate(size)

In theory you should also be able to use gst_buffer_new_wrapped() or any
of the related API in GstMemory, but those currently don't work due to
various GObject-Introspection reasons.

Sebastian Dröge, Centricular Ltd -
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the gstreamer-devel mailing list