Hi all,<div><br></div><div>I'm trying to link v4l2src and appsink in order to fill the buffer with captured frames from a camera.</div><div>However, I got a "gst_eleemnt_link_error" when gst_elemnt_link_filtered() was executed.</div>
<div>Could you give me any comments on the code snippet below?</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *myPipeline = gst_pipeline_new("myPipeline");</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *myBin = gst_bin_new("myBin");</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *cameraSrc = gst_element_factory_make("v4l2src", "cameraSrc");</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *testSink = gst_element_factory_make("appsink", "testsink");</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>GstCaps *caps = gst_caps_new_simple("video/x-raw-yuv", "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC('I', '4', '2', '2'), "width", G_TYPE_INT, 320, "height", G_TYPE_INT, 240, "framerate", GST_TYPE_FRACTION, 30, 1, NULL);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>if (!caps) {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>printf("error in caps\n");</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>exit(1);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_app_sink_set_caps((GstAppSink*)testSink, caps);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_bin_add_many(GST_BIN(myBin), cameraSrc, testSink, NULL);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_bin_add(GST_BIN(myPipeline), myBin);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if (!gst_element_link_filtered(cameraSrc, testSink, caps)) {</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>printf("gst_element_link_ error\n");</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>exit(1);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>
</div><div><br></div><div>Regards,</div><div>Won</div><div><br></div>