How to get a list of all the dshowvideosrc devices?

Andoni Morales ylatuya at gmail.com
Sun Jan 20 05:26:57 PST 2013


2013/1/19 BRampersad <xc10254 at umbc.edu>:
> Hello, does the dshowvideosrc support property probing? I can't seem to get
> it to work. It fails on the second assert which means that dshowvideosrc
> doesn't support property probing. I am using gst 0.10.36 gstreamer.com sdk.

dshowvideosrc supports device probing, except that you are using the
wrong property name. Instead of "device" you should use "device-name".
Check the following example on how to do it taking in account the
difference platform sources and their properties:
http://git.gnome.org/browse/longomatch/tree/libcesarplayer/gst-camera-capturer.c#n1811

>
> #include <QCoreApplication>
> #include <QDebug>
>
> #include <QGst/Init>
> #include <QGst/ElementFactory>
> #include <QGst/PropertyProbe>
>
> void probeForDevices(const QGst::PropertyProbePtr & propertyProbe)
> {
>     QList<QGlib::Value> devices =
> propertyProbe->probeAndGetValues("device");
>
>     Q_FOREACH(const QGlib::Value & device, devices) {
>         propertyProbe->setProperty("device", device);
>
>         QString deviceName =
> propertyProbe->property("device-name").toString();
>         qDebug() << deviceName;
>     }
> }
>
> int main(int argc, char *argv[])
> {
>     QCoreApplication a(argc, argv);
>     QGst::init(&argc, &argv);
>
>     /* Print out all video sources */
>     qDebug() << "Video Sources";
>
>     QGst::ElementPtr videoSource =
> QGst::ElementFactory::make("dshowvideosrc");
>     QGst::PropertyProbePtr videoDevicesProbe;
>
>     videoSource->setState(QGst::StateReady);
>
>     videoDevicesProbe = videoSource.dynamicCast<QGst::PropertyProbe>();
>
>     Q_ASSERT(videoDevicesProbe);
>     Q_ASSERT(videoDevicesProbe->propertySupportsProbe("device"));
>
>     probeForDevices(videoDevicesProbe);
>
>     videoSource->setState(QGst::StateNull);
>
>     return a.exec();
> }
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-to-get-a-list-of-all-the-dshowvideosrc-devices-tp4658038.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



-- 
Andoni Morales Alastruey

LongoMatch:The Digital Coach
http://www.longomatch.ylatuya.es


More information about the gstreamer-devel mailing list