<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 5, 2016 at 10:31 AM, alan wang <span dir="ltr"><<a href="mailto:alan.3976@gmail.com" target="_blank">alan.3976@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello<div><br></div><div>I have a requirement that when dealing with h264 stream If some flag is detected in the stream. The v4l2sink should be noticed.</div><div><br></div><div>The work flow is like:</div><div>gstomxvideodec.c--->handle_<wbr>frame-->[certain flag detected]--->notify---><wbr>gstv4l2sink.c</div></div></blockquote><div><br></div><div>It depends on the kind of information you want to pass onwards. Usually, you have 3 choices:<br><br></div><div>1) If it is a format change: use a caps event<br></div><div>2) If it is some event in the middle of the stream (like a metadata change) you can use a custom GstEvent to notify downstream.<br></div><div>3) If is a flag that indicates some particular information for a frame, you can attach a buffer meta to a GstBuffer.<br></div><div><br></div><div>If you provide more details on what this flag is and how it is used we could try to guide you better on how to do it.<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>Below is what I've done in <font color="#3d85c6">gstomxvideodec.c:gst_omx_<wbr>video_dec_handle_frame</font></div><div><br></div><div><br></div><div><div><font color="#0b5394">    caps =</font></div><div><font color="#0b5394">        gst_caps_new_full (gst_structure_new ("flag",</font></div><div><font color="#0b5394">        "flag", G_TYPE_INT, 1, NULL), NULL);</font></div><div><font color="#0b5394"><br></font></div><div><span style="color:rgb(11,83,148)">    if (!gst_pad_push_event (GST_VIDEO_DECODER_SINK_PAD(<wbr>decoder),</span><br></div><div><font color="#0b5394">                gst_event_new_caps (caps))) {</font></div><div><font color="#0b5394">      return GST_FLOW_ERROR;</font></div><div><font color="#0b5394">    }</font></div></div><div><font color="#0b5394"><br></font></div><div><font color="#000000">I was hoping, above code would invoke </font><font color="#0b5394">gstv4l2sink.c:gst_v4l2sink_<wbr>set_caps. </font><font color="#000000">Then I can extract the caps and do I have to do.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">But all I got is error message says: </font></div><div><font color="#000000"><br></font></div><div><div><font color="#ff0000">(gst-launch-1.0:7180): GStreamer-WARNING **: pad omxh264dec-omxh264dec0:sink pushing caps event in wrong direction</font></div><div><font color="#ff0000">0:00:01.210275279  7180 0xb5c01920 WARN                 qtdemux qtdemux.c:5307:gst_qtdemux_<wbr>loop:<qtdemux0> error: streaming stopped, reason error</font></div><div><font color="#ff0000">ERROR: from element /GstPipeline:pipeline0/<wbr>GstDecodeBin:decodebin0/<wbr>GstQTDemux:qtdemux0: GStreamer encountered a general stream error.</font></div><div style="color:rgb(0,0,0)"><br></div></div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">It seems that, the event caps is sent to qtdemux not to v4l2sink as I expected.</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">So what is the right way to communicate between gstomxvidedec and v4l2sink ?</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">Thank You for your time.</div><span class="HOEnZb"><font color="#888888"><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">Alan</div><div><br></div></font></span></div>
<br>______________________________<wbr>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.<wbr>freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-<wbr>devel</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Thiago Sousa Santos</div>
</div></div>