<div dir="ltr">Actually, I just write based on the gsttransform.c/h in gst-template.<div>I only modify the part with transform_ip () to transform ().</div><div>In details:</div><div>1. Change the definition to:</div><div>    static GstFlowReturn gst_plugin_template_transform (GstBaseTransform * base, GstBuffer *inbuf,</div><div>    GstBuffer * outbuf);</div><div>2. Change class init to:</div><div>   GST_BASE_TRANSFORM_CLASS (klass)->transform =</div><div>      GST_DEBUG_FUNCPTR (gst_plugin_template_transform);</div><div>3. Change the main flow to:</div><div>    static GstFlowReturn</div><div>gst_plugin_template_transform (GstBaseTransform * base, GstBuffer *inbuf, GstBuffer * outbuf)</div><div>{</div><div>   GstMapInfo map_in; </div><div>   GstMapInfo map_out;</div><div>   gst_buffer_map (inbuf, &map_in, GST_MAP_READ); </div><div>   gst_buffer_map (outbuf, &map_out, GST_MAP_WRITE);</div><div>   gst_buffer_unmap (inbuf, &map_in);</div><div>   gst_buffer_unmap (outbuf, &map_out);</div><div>  return GST_FLOW_OK;</div><div>}</div><div><br></div><div>The other parts are remained. However, it only displays black, and when i check the outbuf, it has camera capture data.</div><div><br></div><div>Best regards,</div><div><br></div><div>Ruo</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-05-15 16:48 GMT+02:00 Nicolas Dufresne <span dir="ltr"><<a href="mailto:nicolas@ndufresne.ca" target="_blank">nicolas@ndufresne.ca</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Le lundi 15 mai 2017 à 16:04 +0200, 张若 a écrit :<br>
> When I use GstFlowReturn (*transform_ip) (GstBaseTransform *trans,<br>
> GstBuffer *buf), it works fine. Inside the function I do nothing to<br>
> the buffer. The ximagesink display is the camera capture.<br>
><br>
> Because of what I need is to change the buffer size, I come<br>
> to GstFlowReturn (*transform) (GstBaseTransform *trans, GstBuffer<br>
> *inbuf, GstBuffer *outbuf).<br>
> In this function, I first do a simple test with copying inbuf to<br>
> outbuf. I check the data in outbuf which seems to be changed with<br>
> camera captures. However, the ximagesink display is always black. I<br>
> don't know why. It should be same to what I did in (*transform_ip),<br>
> but not.<br>
<br>
</span>This is most likely a bug in your code, which isn't visible to us.<br>
<br>
regards,<br>
Nicolas<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></div>