[gst-devel] Problem Trying To Use v4l2src
Tim-Philipp Müller
t.i.m at zen.co.uk
Sat Aug 22 02:28:52 CEST 2009
On Fri, 2009-08-21 at 17:16 -0500, Kulecz, Walter wrote:
> >If you have a GstElement * pointer to a v4l2src element, you can cast it
> >to a GstTuner using:
> >
> >GstTuner *tuner = GST_TUNER (v4l2src);
> >
> >(this will only work if the v4l2src device is open, ie. at least in
> >PAUSED or READY state.)
> >
> >Then you can get the norms using something like (snip)
>
> I have:
>
> GstElement *vrl2src=gst_element_factory_make("v4l2src", video-source);
>
> and did:
>
> GstTuner *tuner = GST_TUNER (v4l2src);
>
> and the rest, after I added all elements to the pipeline and linked them, just before doing:
>
> gst_element_set_state(pipeline, GST_STATE_PLAYING);
Have you tried setting v4l2src to PAUSED or PLAYING state before doing
the cast to GST_TUNER(), like I suggested?
> (HelloVideo:2347): GStreamer-CRITICAL **:
> gst_implements_interface_cast: assertion
> `gst_element_implements_interface (GST_ELEMENT (from), iface_type)'
> failed ** (HelloVideo:2347): CRITICAL **: gst_tuner_list_norms:
> assertion `GST_IS_TUNER (tuner)' failed
This is what you get when the element isn't in the right state (yes,
it's awful; and yes, it's very bad API and we intend to fix it at the
next possible opportunity, but we're stuck with it for the current API
cycle).
Cheers
-Tim
More information about the gstreamer-devel
mailing list