<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Per my understanding,<div><br></div><div>    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.</div><div><br></div><div>   If you don't respond to need-data for appsrc, the state change to paused will fail, so the later operations will fail.</div><div><br></div><div><br></div><div>Regards,</div><div>Haiming Wang<br><br><div>> Subject: Re: h264 streaming - byte buffer a source<br>> From: t.i.m@zen.co.uk<br>> To: gstreamer-devel@lists.freedesktop.org<br>> Date: Fri, 26 Jul 2013 15:23:57 +0100<br>> <br>> On Fri, 2013-07-26 at 06:15 -0700, thegoodgiant wrote:<br>> <br>> Hi,<br>> <br>> > every time there is new data available (in the form of an uint8_t pointer).<br>> > This should be my data source, but I have some issues: my compiles and runs<br>> > with no errors, but I see no video :)<br>> <br>> Try with<br>> <br>>  appsrc ! h264parse ! fakesink<br>> <br>> first, and check if buffers make it to fakesink (either via<br>> GST_DEBUG=*sink:5 or by using the "handoff" signal which should be fired<br>> for each buffer).<br>> <br>> <br>> > void play_data(void *inBuf ,  size_t len) {<br>> > <br>> >  static gboolean white = FALSE;<br>> >       static GstClockTime timestamp = 0;<br>> >   GstBuffer *buffer;<br>> >   guint size;<br>> >  GstFlowReturn ret_;<br>> >  size = len;<br>> > <br>> >      buffer =  gst_buffer_new();<br>> >  GST_BUFFER_MALLOCDATA(buffer) = GST_BUFFER_DATA(buffer) = inBuf;<br>> >     GST_BUFFER_SIZE(buffer) = len;<br>> > <br>> > <br>> >       GstCaps* caps = gst_caps_new_simple ("video/x-h264",<br>> >                                                        "width", G_TYPE_INT, 800,<br>> >                                                          "height", G_TYPE_INT, 480,<br>> >                                                         "framerate", GST_TYPE_FRACTION,<br>> > 25,<br>> >               1,<br>> >                                            NULL);<br>> > <br>> >        gst_buffer_set_caps(buffer, caps);<br>> > <br>> > <br>> >  GST_BUFFER_TIMESTAMP (buffer) = timestamp;<br>> > <br>> >       GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale_int (1, GST_SECOND,<br>> > 2);<br>> > <br>> >  timestamp += GST_BUFFER_DURATION (buffer);<br>> > <br>> >       g_signal_emit_by_name (app->appsrc, "push-buffer", buffer, &ret_);<br>> > <br>> >      if (ret_ != GST_FLOW_OK) {<br>> > <br>> >       /* something wrong, stop pushing */<br>> > <br>> >      g_main_loop_quit (app->loop);<br>> > <br>> >         }<br>> <br>> This looks a bit dodgy - there doesn't seem to be any memory management<br>> - so either you're leaking data, or you need to actually *copy* the data<br>> before pushing it into the pipeline. It depends on the lifecycle<br>> management of inBuf.<br>> <br>> Cheers<br>>  -Tim<br>> <br>> _______________________________________________<br>> gstreamer-devel mailing list<br>> gstreamer-devel@lists.freedesktop.org<br>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel<br></div></div>                                         </div></body>
</html>