h264 streaming - byte buffer a source

Haiming Wang whm_buaa at hotmail.com
Mon Jul 29 01:29:58 PDT 2013


Per my understanding,
    when setting the state of pipeline   "     appsrc ! h264parse ! fakesink  "  to paused,  the pipeline will preroll.  That causes appsrc to emit need-data to read some input data for pre rolling.
   If you don't respond to need-data for appsrc, the state change to paused will fail, so the later operations will fail.

Regards,Haiming Wang

> Subject: Re: h264 streaming - byte buffer a source
> From: t.i.m at zen.co.uk
> To: gstreamer-devel at lists.freedesktop.org
> Date: Fri, 26 Jul 2013 15:23:57 +0100
> 
> On Fri, 2013-07-26 at 06:15 -0700, thegoodgiant wrote:
> 
> Hi,
> 
> > every time there is new data available (in the form of an uint8_t pointer).
> > This should be my data source, but I have some issues: my compiles and runs
> > with no errors, but I see no video :)
> 
> Try with
> 
>  appsrc ! h264parse ! fakesink
> 
> first, and check if buffers make it to fakesink (either via
> GST_DEBUG=*sink:5 or by using the "handoff" signal which should be fired
> for each buffer).
> 
> 
> > void play_data(void *inBuf ,  size_t len) {
> > 
> > 	static gboolean white = FALSE;
> > 	static GstClockTime timestamp = 0;
> > 	GstBuffer *buffer;
> > 	guint size;
> > 	GstFlowReturn ret_;
> > 	size = len;
> > 
> > 	buffer =  gst_buffer_new();
> > 	GST_BUFFER_MALLOCDATA(buffer) = GST_BUFFER_DATA(buffer) = inBuf;
> > 	GST_BUFFER_SIZE(buffer) = len;
> > 
> > 
> > 	GstCaps* caps = gst_caps_new_simple ("video/x-h264",
> > 		                                         "width", G_TYPE_INT, 800,
> > 		                                         "height", G_TYPE_INT, 480,
> > 		                                         "framerate", GST_TYPE_FRACTION,
> > 25,
> > 		   1,
> > 		                            NULL);
> > 
> > 	 gst_buffer_set_caps(buffer, caps);
> > 
> > 
> > 	GST_BUFFER_TIMESTAMP (buffer) = timestamp;
> > 
> > 	GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale_int (1, GST_SECOND,
> > 2);
> > 
> > 	timestamp += GST_BUFFER_DURATION (buffer);
> > 
> > 	g_signal_emit_by_name (app->appsrc, "push-buffer", buffer, &ret_);
> > 
> > 	if (ret_ != GST_FLOW_OK) {
> > 
> > 	/* something wrong, stop pushing */
> > 
> > 	g_main_loop_quit (app->loop);
> > 
> > 	}
> 
> This looks a bit dodgy - there doesn't seem to be any memory management
> - so either you're leaking data, or you need to actually *copy* the data
> before pushing it into the pipeline. It depends on the lifecycle
> management of inBuf.
> 
> Cheers
>  -Tim
> 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130729/0c814235/attachment.html>


More information about the gstreamer-devel mailing list