v4l2src + appsink problem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

v4l2src + appsink problem

Won J Jeon
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


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: v4l2src + appsink problem

wally_bkg
I think you've also got to set caps on the appsink before you can link filtered.  In my version of gstreamer setting "video/x-raw-gray" on the appsink/appsrc causes run time errors, so I had to use I420.  Perhaps there are issues with I422 as well.

HTH,
--wally.