appsrc fed data python

Sebastian Dröge sebastian at centricular.com
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.data = self.stream_queue.dequeue()
>         src.emit('push-buffer', self.data)
> 
> 
> I wanna insert self.data 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)
buf.fill(0, self.data)

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 - http://www.centricular.com
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: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140223/d87a6a81/attachment.pgp>


More information about the gstreamer-devel mailing list