write GstBuffer data to a file in decoder's chain method

lyc loveyouachun at 163.com
Sun Oct 23 18:33:28 PDT 2011


hi,

I want to write the GstBuffer data to a file in decoder's method,but it
can't.I define a method to save data,the fllow is my detail:
static void save0(guchar *data,int len)
{
	   int fd;
	   int written;
	   if((fd = open("/home/sns/data.text",O_RDWR|O_CREAT|O_APPEND,0755)) < 0)
	   {
		   printf("open fail\n");
		 return ;
	   }
	   written =write(fd, data , len);
	   close(fd);
}

in decoder chain method,i invoke save0 method to save data via  
save0(GST_BUFFER_DATA(buf),GST_BUFFER_SIZE(buf));
but it can't write data to file,why?how can i do?

--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/write-GstBuffer-data-to-a-file-in-decoder-s-chain-method-tp3931773p3931773.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list