v4l2src + appsink problem

Won J Jeon wjjeon at gmail.com
Wed Aug 31 10:47:50 PDT 2011


Hi all,

I'm trying to link v4l2src and appsink in order to fill the buffer with
captured frames from a camera.
However, I got a "gst_eleemnt_link_error" when gst_elemnt_link_filtered()
was executed.
Could you give me any comments on the code snippet below?

GstElement *myPipeline = gst_pipeline_new("myPipeline");
GstElement *myBin = gst_bin_new("myBin");
GstElement *cameraSrc = gst_element_factory_make("v4l2src", "cameraSrc");
GstElement *testSink = gst_element_factory_make("appsink", "testsink");
 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);
if (!caps) {
printf("error in caps\n");
exit(1);
}
gst_app_sink_set_caps((GstAppSink*)testSink, caps);

gst_bin_add_many(GST_BIN(myBin), cameraSrc, testSink, NULL);
gst_bin_add(GST_BIN(myPipeline), myBin);
if (!gst_element_link_filtered(cameraSrc, testSink, caps)) {
printf("gst_element_link_ error\n");
exit(1);
}

Regards,
Won
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110831/fedf0bc8/attachment.htm>


More information about the gstreamer-devel mailing list