mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-04 23:52:55 +08:00
add some missing methods
This commit is contained in:
@@ -62,6 +62,7 @@ func runPipeline(loop *glib.MainLoop) error {
|
|||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
fmt.Println("Starting device monitor")
|
||||||
monitor.Start()
|
monitor.Start()
|
||||||
fmt.Println("Started device monitor")
|
fmt.Println("Started device monitor")
|
||||||
devices := monitor.GetDevices()
|
devices := monitor.GetDevices()
|
||||||
|
@@ -23,18 +23,19 @@ func NewDeviceMonitor() *DeviceMonitor {
|
|||||||
return &DeviceMonitor{ptr: monitor}
|
return &DeviceMonitor{ptr: monitor}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *DeviceMonitor) AddFilter(classes string, caps *Caps) {
|
func (d *DeviceMonitor) AddFilter(classes string, caps *Caps) int {
|
||||||
var cClasses *C.gchar
|
var cClasses *C.gchar
|
||||||
if classes != "" {
|
if classes != "" {
|
||||||
cClasses = C.CString(classes)
|
cClasses = C.CString(classes)
|
||||||
defer C.free(unsafe.Pointer(cClasses))
|
defer C.free(unsafe.Pointer(cClasses))
|
||||||
}
|
}
|
||||||
|
|
||||||
C.gst_device_monitor_add_filter(d.ptr, cClasses, caps.Instance())
|
filterId := C.gst_device_monitor_add_filter(d.ptr, cClasses, caps.Instance())
|
||||||
// if caps == nil {
|
return uint(filterId)
|
||||||
// return nil
|
}
|
||||||
// }
|
|
||||||
//should return if we were able to add the filter
|
func (d *DeviceMonitor) RemoveFilter(filterId uint) bool {
|
||||||
|
return gobool(C.gst_device_monitor_remove_filter(d.ptr, C.guint(filterId)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetPipelineBus returns the message bus for this pipeline.
|
// GetPipelineBus returns the message bus for this pipeline.
|
||||||
@@ -70,8 +71,12 @@ func (d *DeviceMonitor) GetDevices() []*Device {
|
|||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
//https://gstreamer.freedesktop.org/documentation/gstreamer/gstdevicemonitor.html?gi-language=c
|
func (d *DeviceMonitor) SetShowAllDevices(show bool) {
|
||||||
|
C.gst_device_monitor_set_show_all_devices(d.ptr, gboolean(show))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (d *DeviceMonitor) GetShowAllDevices() bool {
|
||||||
|
return gobool(C.gst_device_monitor_get_show_all_devices(d.ptr))
|
||||||
|
}
|
||||||
|
|
||||||
//gst_device_monitor_get_providers
|
//gst_device_monitor_get_providers
|
||||||
//gst_device_monitor_get_show_all_devices
|
|
||||||
//gst_device_monitor_remove_filter
|
|
||||||
//gst_device_monitor_set_show_all_devices
|
|
||||||
|
Reference in New Issue
Block a user