[gst-devel] v4l2src not working when pipeline is placed in a bin, but it works for videotestsrc
Edgard Lima
edgard.lima at indt.org.br
Tue Oct 9 09:41:38 CEST 2007
Hi,
I've tested with my webcam and everything works fine....
please send me a the log of
export GST_DEBUG=v4l2*:4
./a.out > log4 2>&1
then another log with debug "v4l2*:5"
BR,
Edgard
ext Jaap Haitsma wrote:
> Hi,
>
> I'm having trouble getting a v4l2src (a webcam) to work when it's part
> of a bin and subsequently placed in a pipeline the attached code is a
> minimal example, where it occurs. (put Makefile and gst-bin-test.c in
> a directory and run make)
>
> If you compile the example like this it doesn't work for me.
>
> On line 6 and 7 there are two defines
>
> #define PUT_IN_BIN
> #define V4L2SRC
>
> If I comment the PUT_IN_BIN my webcam works correctly, because the
> elements are not put in a bin
>
> If I comment the V4L2SRC the program correctly displays the test
> source no matter if everything is in a bin or in a pipeline (so it
> does not matter if you comment out PUT_IN_BIN)
>
> Any ideas what I'm doing wrong here? Or is this a bug?
>
> Thanks
>
> Jaap
>
>
> ------------------------------------------------------------------------
>
> #include <gtk/gtk.h>
> #include <gst/gst.h>
> #include <gst/gst.h>
> #include <gst/base/gstbasesrc.h>
>
>
> #define PUT_IN_BIN
> #define V4L2SRC
>
> int main(int argc, char **argv)
> {
> GstElement *pipeline;
> GstElement *bin;
> gboolean ok;
>
> GstElement *video_source;
>
> GstElement *csp;
> GstElement *video_sink;
>
> gtk_init(&argc, &argv);
> gst_init (&argc, &argv);
>
>
> pipeline = gst_pipeline_new ("pipeline");
> bin = gst_bin_new ("bin");
>
> #ifdef V4L2SRC
> video_source = gst_element_factory_make ("v4l2src", "video_src");
> #else
> video_source = gst_element_factory_make ("videotestsrc", "video_source");
> #endif
>
> csp = gst_element_factory_make ("ffmpegcolorspace", "csp");
> video_sink = gst_element_factory_make ("ximagesink", "video_sink");
>
> #ifdef PUT_IN_BIN
> gst_bin_add_many (GST_BIN (bin), video_source, csp, video_sink, NULL);
> gst_bin_add_many (GST_BIN (pipeline), bin, NULL);
> #else
> gst_bin_add_many (GST_BIN (pipeline), video_source, csp, video_sink, NULL);
> #endif
> ok = gst_element_link_many (video_source, csp, video_sink, NULL);
>
> gst_element_set_state (pipeline, GST_STATE_PLAYING);
>
> gtk_main();
> return 0;
> }
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
More information about the gstreamer-devel
mailing list