Package ch.bailu.gtk.gst
Klasse DeviceMonitor
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gst.DeviceMonitor
- Alle implementierten Schnittstellen:
PointerInterface
Applications should create a #GstDeviceMonitor when they want
to probe, list and monitor devices of a specific type. The
#GstDeviceMonitor will create the appropriate
#GstDeviceProvider objects and manage them. It will then post
messages on its #GstBus for devices that have been added and
removed.
The device monitor will monitor all devices matching the filters that
the application has set.
The basic use pattern of a device monitor is as follows:
to probe, list and monitor devices of a specific type. The
#GstDeviceMonitor will create the appropriate
#GstDeviceProvider objects and manage them. It will then post
messages on its #GstBus for devices that have been added and
removed.
The device monitor will monitor all devices matching the filters that
the application has set.
The basic use pattern of a device monitor is as follows:
static gboolean my_bus_func (GstBus * bus, GstMessage * message, gpointer user_data) { GstDevice *device; gchar *name; switch (GST_MESSAGE_TYPE (message)) { case GST_MESSAGE_DEVICE_ADDED: gst_message_parse_device_added (message, &device); name = gst_device_get_display_name (device); g_print("Device added: %s\n", name); g_free (name); gst_object_unref (device); break; case GST_MESSAGE_DEVICE_REMOVED: gst_message_parse_device_removed (message, &device); name = gst_device_get_display_name (device); g_print("Device removed: %s\n", name); g_free (name); gst_object_unref (device); break; default: break; } return G_SOURCE_CONTINUE; } GstDeviceMonitor * setup_raw_video_source_device_monitor (void) { GstDeviceMonitor *monitor; GstBus *bus; GstCaps *caps; monitor = gst_device_monitor_new (); bus = gst_device_monitor_get_bus (monitor); gst_bus_add_watch (bus, my_bus_func, NULL); gst_object_unref (bus); caps = gst_caps_new_empty_simple ("video/x-raw"); gst_device_monitor_add_filter (monitor, "Video/Source", caps); gst_caps_unref (caps); gst_device_monitor_start (monitor); return monitor; }
https://gstreamer.freedesktop.org/documentation/gstreamer/gi-index.html
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungint
Adds a filter for which #GstDevice will be monitored, any device that matches
all these classes and the #GstCaps will be returned.int
Adds a filter for which #GstDevice will be monitored, any device that matches
all these classes and the #GstCaps will be returned.getBus()
Gets the #GstBus of this #GstDeviceMonitorstatic ClassHandler
Gets a list of devices from all of the relevant monitors.static int
static long
static TypeSystem.TypeSize
boolean
Get if @monitor is currently showing all devices, even those from hidden
providers.static long
static TypeSystem.TypeSize
boolean
removeFilter
(int filter_id) Removes a filter from the #GstDeviceMonitor using the id that was returned
by gst_device_monitor_add_filter().void
setShowAllDevices
(boolean show_all) Set if all devices should be visible, even those devices from hidden
providers.boolean
start()
Starts monitoring the devices, one this has succeeded, the
%GST_MESSAGE_DEVICE_ADDED and %GST_MESSAGE_DEVICE_REMOVED messages
will be emitted on the bus when the list of devices changes.void
stop()
Stops monitoring the devices.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
DeviceMonitor
-
DeviceMonitor
public DeviceMonitor()Create a new #GstDeviceMonitor
-
-
Methodendetails
-
getClassHandler
-
addFilter
Adds a filter for which #GstDevice will be monitored, any device that matches
all these classes and the #GstCaps will be returned.
If this function is called multiple times to add more filters, each will be
matched independently. That is, adding more filters will not further restrict
what devices are matched.
The #GstCaps supported by the device as returned by gst_device_get_caps() are
not intersected with caps filters added using this function.
Filters must be added before the #GstDeviceMonitor is started.- Parameter:
classes
- device classes to use as filter or %NULL for any classcaps
- the #GstCaps to filter or %NULL for ANY- Gibt zurück:
- The id of the new filter or 0 if no provider matched the filter's classes.
-
addFilter
Adds a filter for which #GstDevice will be monitored, any device that matches
all these classes and the #GstCaps will be returned.
If this function is called multiple times to add more filters, each will be
matched independently. That is, adding more filters will not further restrict
what devices are matched.
The #GstCaps supported by the device as returned by gst_device_get_caps() are
not intersected with caps filters added using this function.
Filters must be added before the #GstDeviceMonitor is started.- Parameter:
classes
- device classes to use as filter or %NULL for any classcaps
- the #GstCaps to filter or %NULL for ANY- Gibt zurück:
- The id of the new filter or 0 if no provider matched the filter's classes.
-
getBus
Gets the #GstBus of this #GstDeviceMonitor- Gibt zurück:
- a #GstBus
-
getDevices
Gets a list of devices from all of the relevant monitors. This may actually
probe the hardware if the monitor is not currently started.- Gibt zurück:
- a #GList of #GstDevice
-
getShowAllDevices
public boolean getShowAllDevices()Get if @monitor is currently showing all devices, even those from hidden
providers.- Gibt zurück:
- %TRUE when all devices will be shown.
-
removeFilter
public boolean removeFilter(int filter_id) Removes a filter from the #GstDeviceMonitor using the id that was returned
by gst_device_monitor_add_filter().- Parameter:
filter_id
- the id of the filter- Gibt zurück:
- %TRUE of the filter id was valid, %FALSE otherwise
-
setShowAllDevices
public void setShowAllDevices(boolean show_all) Set if all devices should be visible, even those devices from hidden
providers. Setting @show_all to true might show some devices multiple times.- Parameter:
show_all
- show all devices
-
start
public boolean start()Starts monitoring the devices, one this has succeeded, the
%GST_MESSAGE_DEVICE_ADDED and %GST_MESSAGE_DEVICE_REMOVED messages
will be emitted on the bus when the list of devices changes.- Gibt zurück:
- %TRUE if the device monitoring could be started, i.e. at least a single device provider was started successfully.
-
stop
public void stop()Stops monitoring the devices. -
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-