<div>
                <div>Hi,
                </div><div><span class="Apple-tab-span" style="white-space:pre">  </span>Brendan & Wonchul</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">  </span>Thanks for your replay,</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">     </span>i use the the callback "GstAppSinkCallbacks.new_buffer" to pull the the buffer data of appsink's</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">  </span>because of some performance issue du to comment of gstappsink's source code :)</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">      </span>about this issue, i fixed that if cast the element pointer to appsink, </div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>before (can not get more sample but just one):</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">      </span>cb_new_buffer (GstElement *elt, gpointer user_data)</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>fix the issue:</div> <span class="Apple-tab-span" style="white-space:pre">    </span>cb_new_buffer (GstAppSink *elt, gpointer user_data)</div><div><br><div><span class="Apple-tab-span" style="white-space:pre">     </span>i use the "GstElement" pointer as the sink element in version 0.10.x, it works well except in version v 1.0.9 :(</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">  </span>i do not know really why…..maybe some flag(or data) is lost if i do not cast to real type...</div><div><span class="Apple-tab-span" style="white-space:pre">       </span></div>
                <div><div><br></div><div>Thanks,</div><div><br></div><div>- Jojo</div><div><br></div></div>
                 
                <p style="color: #A0A0A8;">在 2013年8月27日星期二,上午7:02,Wonchul Lee 写道:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div><div dir="ltr">In addition, you should set the 'emit-signals' property to TRUE value for appsink element.</div><div><br><br><div>2013/8/27 Wonchul Lee <span dir="ltr"><<a href="mailto:chul0812@gmail.com" target="_blank">chul0812@gmail.com</a>></span><br><blockquote type="cite"><div><div dir="ltr">At the cb_new_buffer, you can get the buffer.<div>Like as blow code.</div><div><pre style="white-space:pre-wrap;word-wrap:break-word">static GstFlowReturn
cb_new_buffer(GstElement * sink)
{
  GstSample *sample;
  GstCaps *caps;
  GstBuffer *buf;</pre><pre style="white-space:pre-wrap;word-wrap:break-word">  g_signal_emit_by_name (sink, "pull-sample", &sample);</pre><pre style="white-space:pre-wrap;word-wrap:break-word"><pre style="word-wrap:break-word;white-space:pre-wrap">  caps = gst_sample_get_caps (sample);
  buf = gst_sample_get_buffer (sample);
</pre><div><br></div>  if (sample) {
    gst_sample_unref (sample);
  }

  return GST_FLOW_OK;
}</pre><pre style="white-space:pre-wrap;word-wrap:break-word"><br></pre><pre style="white-space:pre-wrap;word-wrap:break-word">GstSample contains the reference of buffer and caps data.</pre>
<pre style="white-space:pre-wrap;word-wrap:break-word">You should unref after use the sample data.</pre><pre style="white-space:pre-wrap;word-wrap:break-word">It is the reason why blocked after got the first data.</pre>
</div></div><div><div><div><br><br><div>2013/8/27 Brendan Long <span dir="ltr"><<a href="mailto:self@brendanlong.com" target="_blank">self@brendanlong.com</a>></span><br><blockquote type="cite"><div>

   
     
   
  <div text="#000000" bgcolor="#FFFFFF">
    <div>How are you getting the sample? Is it
      possible that you're accidentally blocking the pipeline?I think
      you're supposed to use "pull-sample" to get the new sample, but if
      you call "pull-sample" where there is no sample, it will block,
      and depending on how you're running your pipeline, that could
      block everything. That's just a guess though, since you're not
      showing very much of your code.<div><div><br>
      <br>
      On 08/24/2013 05:18 AM, jojo wrote:<br>
    </div></div></div><blockquote type="cite"><div><div><div>
      <div> Hi, </div>
      <div><span style="white-space:pre-wrap"> </span>i
        use the simplest pipe line again as bellow:</div>
      <div><br>
      </div>
      <div><span style="white-space:pre-wrap"> </span>pipe
        = gst_parse_launch("appsrc is-live=1 do-timestamp=1
        caps=\"image/jpeg, width=1920, height=1080\" name=\"appsrc\" !
        appsink name=\"appsink\"");</div>
      <div><br>
      </div>
      <div><span style="white-space:pre-wrap"> </span>it
        can get the first 1 "sample" just only.</div>
      <div>
        <div><br>
        </div>
        <div>Thanks,</div>
        <div><br>
        </div>
        <div>- Jojo</div>
        <div><br>
        </div>
      </div>
      <p style="color:#a0a0a8">在 2013年8月24日星期六,下午5:17,jojo 写道:</p><blockquote type="cite"><div>
        <span>
          <div>
            <div>
              <div>Hi, </div>
              <div><span style="white-space:pre-wrap"> </span>My pipeline is
                :</div>
              <div><br>
              </div>
              <div><span style="white-space:pre-wrap"> </span>pipe
                = gst_parse_launch("appsrc is-live=1 do-timestamp=1
                caps=image/jpeg, width=1920, height=1080 name=\"appsrc\"
                ! decodebin ! queue !  videoconvert ! appsink
                caps=\"%s\" name=\"appsink\",
                GST_VIDEO_CAPS_MAKE("BGRx")).</div>
              <div><br>
              </div>
              <div><span style="white-space:pre-wrap"> </span>g_signal_connect
                (appsink, "new-sample", G_CALLBACK (cb_new_buffer),
                data);</div>
              <div><br>
              </div>
              <div><span style="white-space:pre-wrap"> </span>in the
                gstreamer v0.10, the callback is triggered if there are
                new buffer, but i can not get new data from this
                callback in the version 1.0.9,</div>
              <div><br>
              </div>
              <div><span style="white-space:pre-wrap"> </span>some of my
                parameters of "gst_parse_launch" are wrong ?</div>
              <div><br>
              </div>
              <div><span style="white-space:pre-wrap"> </span>Any hins will
                be helpful.</div>
              <div>
                <div><br>
                </div>
                <div>Thanks,</div>
                <div><br>
                </div>
                <div>- Jojo</div>
                <div><br>
                </div>
              </div>
            </div>
          </div>
        </span> </div></blockquote><div> <br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
gstreamer-devel mailing list
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
    </div></blockquote><br>
  </div>

<br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></div></blockquote></div><br></div>
</div></div></div></blockquote></div><br></div>
</div><div><div>_______________________________________________</div><div>gstreamer-devel mailing list</div><div><a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a></div><div><a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></div></div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>
            </div>