Create a GstBuffer
Totoketchup
anthony.damato at hotmail.fr
Wed Apr 1 06:28:15 PDT 2015
Hi !
I'm trying to write a plugin and i'm facing a problem.
I want to create a GstBuffer and put my data into this buffer.
Then I push it to the src pad.
But I have this error :
Caught SIGSEGV
Spinning. Please run 'gdb gst-launch-1.0 21570' to continue debugging,
Ctrl-C to quit, or Ctrl-\ to dump core.
I'm doing this to create the buffer :
GstTetrysElement* filter = (GstTetrysElement*)context;
GstPad* srcpad = filter->srcpad;
int size;
GstBuffer* buf;
GstMapInfo info;
GstMemory* mem;
switch(event)
{
/********* encoding messages *********/
case TETRYS_EVENT_ENCODED_SOURCE_PACKET:
size = tetrys_translate_src_to_buf(event_param2, bufferTmp); // Here i
get the size of the new buf and the data are collected in buffertmp ( a
pointer to the data )
buf = gst_buffer_new ();
mem = gst_allocator_alloc(NULL,size,NULL);
gst_buffer_append_memory(buf,mem);
gst_buffer_map(buf,&info,GST_MAP_WRITE);
memcpy(info.data,bufferTmp,size);
gst_buffer_unmap(buf,&info);
gst_pad_push (srcpad, buf);
Thanks ;)
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Create-a-GstBuffer-tp4671413.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list