[gst-devel] gstreamer and video device probing

Filippo Argiolas filippo.argiolas at gmail.com
Wed Jun 3 21:47:54 CEST 2009


On Mon, Jun 1, 2009 at 1:05 PM, Stefan Kost <ensonic at hora-obscura.de> wrote:
> Filippo Argiolas schrieb:
>> - there seems to be no way to get video device capabilities without
>> starting a pipeline, both v4lsrc and v4l2src implement (and not in a
>> good way) propertyprobe just for the "device" property. Would it be
>> possible to use propertyprobe for "flags" property too? is it possible
>> to fix a property (i.e. the device) and probe another one (i.e. the
>> flags)?
>> What I'd like to do is:
>> pspec = gst_property_probe_get_property (probe, "device");
>> GValueArray *array = gst_property_probe_probe_and_get_values (probe, pspec);
>> for (i = 0; i < array->n_values; i++) {
>>      g_object_set_property (G_OBJECT (element), "device", device);
>>      pspec = gst_property_probe_get_property (probe, "flags");
>>      /* get flags for the current device */
>>      ...
>> }
>> Linking and playing a simple pipeline for each device just for exclude
>> radios and tuners is not exactly optimal from my point of view.
>>
> I don't think it has to be played. You probably not even need to link it
> as READY is enough for getting it to open the device.

Nope, READY is not enough because v4l2src (probably v4lsrc too, didn't
check) uses basesrc start vmethod to open the device and this happens
in READY->PAUSED so you can't get caps nor flags nor other properties
that need an open device just setting v4l2src to READY. Other sources
(at least pulsesrc, but probably others too) manually listen to state
changes.

>> - there is no way to monitor new devices attached. At the moment we
>> don't use such a thing but wouldn't be bad to have it. But does it fit
>> in gstreamer purpose?
>>
> I don't think so, I use HAL in buzztard to detect devices. There is
> nothing in gstreamer that is guaranteed to always run.

Maybe we could start a mainloop in v4l2src? not sure how good it would
work though... maybe a custom element that runs an udev_monitor and
posts new devices in the bus?

Filippo




More information about the gstreamer-devel mailing list