我正在尝试使用 c++ 中的 gstreamer 1.0 查询 Windows 上可用视频捕获设备(网络摄像头)的列表。
我使用 ksvideosrc 作为源,我能够捕获视频输入,但我无法查询可用设备(及其上限)的列表。
在 gstreamer 0.10 上,可以通过 GstPropertyProbe 实现,该功能在 gstreamer 1.0 中已被删除。文档建议使用 GstDeviceMonitor。但我也没有运气使用它。
有人成功获取设备名称列表吗?或者您能否建议另一种检索可用设备名称及其上限的方法?
您可以使用GstDeviceMonitor
and gst_device_monitor_get_devices ()
功能。
首先初始化GstDeviceMonitor
by gst_device_monitor_new()
.
第二次启动监视器gst_device_monitor_start(pMonitor)
.
三、获取设备列表gst_device_monitor_get_devices(pMonitor)
.
代码如下:
GstDeviceMonitor* monitor= gst_device_monitor_new();
if(!gst_device_monitor_start(monitor)){
printf("WARNING: Monitor couldn't started!!\n");
}
GList* devices = gst_device_monitor_get_devices(monitor);
我的参考资料:https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstDeviceMonitor.html#gst-device-monitor-get-devices https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstDeviceMonitor.html#gst-device-monitor-get-devices
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)