input-device

input-device

Functions

SrtInputDeviceInterfaceFlags srt_input_device_get_interface_flags ()
SrtInputDeviceTypeFlags srt_input_device_get_type_flags ()
const char * srt_input_device_get_dev_node ()
const char * srt_input_device_get_sys_path ()
const char * srt_input_device_get_subsystem ()
gchar ** srt_input_device_dup_udev_properties ()
gchar * srt_input_device_dup_uevent ()
gboolean srt_input_device_get_identity ()
size_t srt_input_device_get_event_capabilities ()
size_t srt_input_device_get_event_types ()
gboolean srt_input_device_has_event_type ()
gboolean srt_input_device_has_event_capability ()
gboolean srt_input_device_has_input_property ()
size_t srt_input_device_get_input_properties ()
SrtInputDeviceTypeFlags srt_input_device_guess_type_flags_from_event_capabilities ()
const char * srt_input_device_get_hid_sys_path ()
GBytes * srt_input_device_dup_hid_report_descriptor ()
gchar * srt_input_device_dup_hid_uevent ()
gboolean srt_input_device_get_hid_identity ()
const char * srt_input_device_get_input_sys_path ()
gchar * srt_input_device_dup_input_uevent ()
gboolean srt_input_device_get_input_identity ()
const char * srt_input_device_get_usb_device_sys_path ()
gchar * srt_input_device_dup_usb_device_uevent ()
gboolean srt_input_device_get_usb_device_identity ()
int srt_input_device_open ()
SrtInputDeviceMonitor * srt_input_device_monitor_new ()
SrtInputDeviceMonitorFlags srt_input_device_monitor_get_flags ()
void srt_input_device_monitor_request_raw_hid ()
void srt_input_device_monitor_request_evdev ()
gboolean srt_input_device_monitor_is_active ()
gboolean srt_input_device_monitor_start ()
void srt_input_device_monitor_stop ()

Properties

SrtInputDeviceMonitorFlags flags Read / Write / Construct Only
gboolean is-active Read

Signals

Types and Values

Object Hierarchy

    GFlags
    ├── SrtInputDeviceInterfaceFlags
    ├── SrtInputDeviceMonitorFlags
    ╰── SrtInputDeviceTypeFlags
    GInterface
    ├── SrtInputDevice
    ╰── SrtInputDeviceMonitor

Description

Functions

srt_input_device_get_interface_flags ()

SrtInputDeviceInterfaceFlags
srt_input_device_get_interface_flags (SrtInputDevice *device);

Return flags describing how the input device can be used.

Parameters

device

An object implementing SrtInputDeviceInterface

 

Returns

Flags describing the input device.


srt_input_device_get_type_flags ()

SrtInputDeviceTypeFlags
srt_input_device_get_type_flags (SrtInputDevice *device);

Return flags describing what sort of device this is. If possible, these will be taken from a data source such as udev's input_id builtin, which will be treated as authoritative.

Parameters

device

An object implementing SrtInputDeviceInterface

 

Returns

Flags describing the input device.


srt_input_device_get_dev_node ()

const char *
srt_input_device_get_dev_node (SrtInputDevice *device);

Return the path of the device node in /dev that is implemented by this input device, or NULL if not known or if the device does not have a corresponding device node.

For processes in a container, it is not guaranteed that this path will exist in the container's /dev.

The returned string will not be freed as long as device is referenced, but the device node in /dev might be deleted, or even reused for a different device.

Parameters

device

An object implementing SrtInputDeviceInterface

 

Returns

A path in /dev that will not be freed as long as a reference to device is held, or NULL.

[nullable][transfer none]


srt_input_device_get_sys_path ()

const char *
srt_input_device_get_sys_path (SrtInputDevice *device);

Return the path of the device directory in /sys that represents this input device.

For processes in a container, it is not guaranteed that this path will exist in the container's /sys.

The returned string will not be freed as long as device is referenced, but the directory in /sys might be deleted, or even reused for a different device.

Parameters

device

An object implementing SrtInputDeviceInterface

 

Returns

A path in /sys that will not be freed as long as a reference to device is held, or NULL.

[nullable][transfer none]


srt_input_device_get_subsystem ()

const char *
srt_input_device_get_subsystem (SrtInputDevice *device);

Return the subsystem in which this device exists, typically input or hidraw, or NULL if not known.

Parameters

device

An object implementing SrtInputDeviceInterface

 

Returns

A short string that will not be freed as long as a reference to device is held, or NULL.

[nullable][transfer none]


srt_input_device_dup_udev_properties ()

gchar **
srt_input_device_dup_udev_properties (SrtInputDevice *device);

Return the udev properties of this input device, if available, in the same format as environ. g_environ_getenv() can be used to process them.

Parameters

device

An object implementing SrtInputDeviceInterface

 

Returns

udev properties, or NULL. Free with g_strfreev().

[nullable][transfer full]


srt_input_device_dup_uevent ()

gchar *
srt_input_device_dup_uevent (SrtInputDevice *device);

Return the uevent data from the kernel.

Parameters

device

An object implementing SrtInputDeviceInterface

 

Returns

A multi-line string, or NULL. Free with g_free().

[nullable][transfer full]


srt_input_device_get_identity ()

gboolean
srt_input_device_get_identity (SrtInputDevice *device,
                               unsigned int *bus_type,
                               unsigned int *vendor_id,
                               unsigned int *product_id,
                               unsigned int *version);

Attempt to identify the device. If available, return the bus type, the vendor ID, the product ID and/or the device version via "out" parameters.

The source of the information is unspecified. Use srt_input_device_get_hid_identity(), srt_input_device_get_input_identity() and/or srt_input_device_get_usb_device_identity() if a specific source is desired.

Parameters

device

An object implementing SrtInputDeviceInterface

 

bus_type

Used to return the bus type from <linux/input.h>, usually BUS_USB or BUS_BLUETOOTH.

[out]

vendor_id

Used to return the vendor ID, namespaced by the bus_type , or 0 if unavailable.

[out]

product_id

Used to return the product ID, namespaced by the vendor_id , or 0 if unavailable.

[out]

version

Used to return the device version, or 0 if unavailable.

[out]

Returns

TRUE if information was available


srt_input_device_get_event_capabilities ()

size_t
srt_input_device_get_event_capabilities
                               (SrtInputDevice *device,
                                unsigned int type,
                                unsigned long *storage,
                                size_t n_longs);

Fill a buffer with the event capabilities in the same encoding used for the EVIOCGBIT ioctl, or query how large that buffer would have to be.

Bits in storage above the highest known event value will be zeroed.

If storage is too small, high event values will not be represented. For example, if type is EV_KEY and n_longs is 1, then storage will only indicate whether the first 32 or 64 key event codes are supported, and will not indicate anything about the level of support for KEY_RIGHTALT (event code 100).

If type is not a supported type, all of storage will be zeroed and 0 will be returned.

Parameters

device

An object implementing SrtInputDeviceInterface

 

type

An event type from <linux/input.h> such as EV_KEY, or 0 to get the supported event types

 

storage

An array of n_longs unsigned long values that will receive the bitfield, allocated by the caller. Bit number 0 is the least significant bit of storage[0] and so on up to the most significant bit of storage[0], which is one place less significant than the least significant bit of storage[1] if present.

[optional][out caller-allocates][array length=n_longs]

n_longs

The length of storage , or 0 if storage is NULL

 

Returns

The number of unsigned long values that would have been required for the highest possible event of type type , which might be greater than n_longs


srt_input_device_get_event_types ()

size_t
srt_input_device_get_event_types (SrtInputDevice *device,
                                  unsigned long *storage,
                                  size_t n_longs);

Fill a buffer with the supported event types in the same encoding used for the EVIOCGBIT ioctl, or query how large that buffer would have to be. This is the same as srt_input_device_get_event_capabilities (device, 0, ...), except that bit numbers in storage reflect event types, for example bit number 3 (storage[0] & (1 << 3)) represents event type 3 (EV_ABS).

Parameters

device

An object implementing SrtInputDeviceInterface

 

storage

An array of n_longs unsigned long values that will receive the bitfield, allocated by the caller. Bit number 0 is the least significant bit of storage[0] and so on up to the most significant bit of storage[0], which is one place less significant than the least significant bit of storage[1] if present.

[optional][out caller-allocates][array length=n_longs]

n_longs

The length of storage , or 0 if storage is NULL

 

Returns

The number of unsigned long values that would have been required for the highest possible event of type type , which might be greater than n_longs


srt_input_device_has_event_type ()

gboolean
srt_input_device_has_event_type (SrtInputDevice *device,
                                 unsigned int type);

If the device is an evdev device implementing the given event type, return TRUE. Otherwise return FALSE.

Parameters

device

An object implementing SrtInputDeviceInterface

 

type

EV_KEY, EV_ABS, EV_REL, EV_FF or another evdev event type

 

Returns

TRUE if the object implements the given event type.


srt_input_device_has_event_capability ()

gboolean
srt_input_device_has_event_capability (SrtInputDevice *device,
                                       unsigned int type,
                                       unsigned int code);

If the device is an evdev device implementing the given event type and code, return TRUE. Otherwise return FALSE.

This is currently only implemented for EV_KEY, EV_ABS, EV_REL and EV_FF (the interesting event types for game controllers), and will return FALSE for more exotic event types.

Parameters

device

An object implementing SrtInputDeviceInterface

 

type

EV_KEY, EV_ABS, EV_REL, EV_FF or another evdev event type

 

code

A bit appropriate for the given evdev event type; for example, if type is EV_KEY, then code might be KEY_BACKSPACE or BTN_X

 

Returns

TRUE if the object implements the given event type.


srt_input_device_has_input_property ()

gboolean
srt_input_device_has_input_property (SrtInputDevice *device,
                                     unsigned int input_prop);

If the device is an evdev device with the given input property, return TRUE. Otherwise return FALSE.

Parameters

device

An object implementing SrtInputDeviceInterface

 

input_prop

An input property such as INPUT_PROP_POINTER

 

Returns

TRUE if the object has the given input property.


srt_input_device_get_input_properties ()

size_t
srt_input_device_get_input_properties (SrtInputDevice *device,
                                       unsigned long *storage,
                                       size_t n_longs);

Fill a buffer with the input device properties in the same encoding used for the EVIOCGPROP ioctl, or query how large that buffer would have to be.

Bit numbers in storage reflect input properties, for example bit number 6 (storage[0] & (1 << 6)) represents input property 6 (INPUT_PROP_ACCELEROMETER).

Parameters

device

An object implementing SrtInputDeviceInterface

 

storage

An array of n_longs unsigned long values that will receive the bitfield, allocated by the caller. Bit number 0 is the least significant bit of storage[0] and so on up to the most significant bit of storage[0], which is one place less significant than the least significant bit of storage[1] if present.

[optional][out caller-allocates][array length=n_longs]

n_longs

The length of storage , or 0 if storage is NULL

 

Returns

The number of unsigned long values that would have been required for the highest possible event of type type , which might be greater than n_longs


srt_input_device_guess_type_flags_from_event_capabilities ()

SrtInputDeviceTypeFlags
srt_input_device_guess_type_flags_from_event_capabilities
                               (SrtInputDevice *device);

srt_input_device_get_hid_sys_path ()

const char *
srt_input_device_get_hid_sys_path (SrtInputDevice *device);

Return the path of the device directory in /sys that represents this input device's closest ancestor that is a Human Interface Device. Many, but not all, input devices have a HID ancestor. If there is no applicable HID device, return NULL.

For processes in a container, it is not guaranteed that this path will exist in the container's /sys.

The returned string will not be freed as long as device is referenced, but the directory in /sys might be deleted, or even reused for a different device.

Parameters

device

An object implementing SrtInputDeviceInterface

 

Returns

A path in /sys that will not be freed as long as a reference to device is held, or NULL.

[nullable][transfer none]


srt_input_device_dup_hid_report_descriptor ()

GBytes *
srt_input_device_dup_hid_report_descriptor
                               (SrtInputDevice *device);

Return the raw HID report descriptor from the kernel.

Parameters

device

An object implementing SrtInputDeviceInterface

 

Returns

The bytes of a HID report descriptor, or NULL for non-HID devices or if no HID descriptor is available. Free with g_bytes_unref().

[nullable][transfer full]


srt_input_device_dup_hid_uevent ()

gchar *
srt_input_device_dup_hid_uevent (SrtInputDevice *device);

Return the uevent data structure similar to srt_input_device_dup_uevent(), but for the ancestor device returned by srt_input_device_get_hid_sys_path().

Parameters

device

An object implementing SrtInputDeviceInterface

 

Returns

A multi-line string, or NULL. Free with g_free().

[nullable][transfer full]


srt_input_device_get_hid_identity ()

gboolean
srt_input_device_get_hid_identity (SrtInputDevice *device,
                                   unsigned int *bus_type,
                                   unsigned int *vendor_id,
                                   unsigned int *product_id,
                                   const char **name,
                                   const char **phys,
                                   const char **uniq);

Attempt to identify the device. If available, return details via "out" parameters.

Parameters

device

An object implementing SrtInputDeviceInterface

 

bus_type

Used to return the bus type from <linux/input.h>, usually BUS_USB or BUS_BLUETOOTH.

[out]

vendor_id

Used to return the vendor ID, namespaced by the bus_type , or 0 if unavailable.

[out]

product_id

Used to return the product ID, namespaced by the vendor_id , or 0 if unavailable.

[out]

name

Used to return a human-readable name that usually combines the vendor and product, or empty or NULL if unavailable.

[out][transfer none]

phys

Used to return how the device is physically attached, or empty or NULL if unavailable.

[out][transfer none]

uniq

Used to return the device's serial number or other unique identifier, or empty or NULL if unavailable.

[out][transfer none]

Returns

TRUE if this is an evdev device and information was available


srt_input_device_get_input_sys_path ()

const char *
srt_input_device_get_input_sys_path (SrtInputDevice *device);

If the device has an ancestor device that advertises evdev input capabilities, return the path in /sys for that device. Otherwise return NULL.

For processes in a container, it is not guaranteed that this path will exist in the container's /sys.

The returned string will not be freed as long as device is referenced, but the directory in /sys might be deleted, or even reused for a different device.

Parameters

device

An object implementing SrtInputDeviceInterface

 

Returns

A path in /sys that will not be freed as long as a reference to device is held, or NULL.

[nullable][transfer none]


srt_input_device_dup_input_uevent ()

gchar *
srt_input_device_dup_input_uevent (SrtInputDevice *device);

Return the uevent data structure similar to srt_input_device_dup_uevent(), but for the ancestor device returned by srt_input_device_get_input_sys_path().

Parameters

device

An object implementing SrtInputDeviceInterface

 

Returns

A multi-line string, or NULL. Free with g_free().

[nullable][transfer full]


srt_input_device_get_input_identity ()

gboolean
srt_input_device_get_input_identity (SrtInputDevice *device,
                                     unsigned int *bus_type,
                                     unsigned int *vendor_id,
                                     unsigned int *product_id,
                                     unsigned int *version,
                                     const char **name,
                                     const char **phys,
                                     const char **uniq);

Attempt to identify the device. If available, return details via "out" parameters.

Parameters

device

An object implementing SrtInputDeviceInterface

 

bus_type

Used to return the bus type from <linux/input.h>, usually BUS_USB or BUS_BLUETOOTH.

[out]

vendor_id

Used to return the vendor ID, namespaced by the bus_type , or 0 if unavailable.

[out]

product_id

Used to return the product ID, namespaced by the vendor_id , or 0 if unavailable.

[out]

version

Used to return the product version, or 0 if unavailable.

[out]

name

Used to return a human-readable name that usually combines the vendor and product, or empty or NULL if unavailable.

[out][transfer none]

phys

Used to return how the device is physically attached, or empty or NULL if unavailable.

[out][transfer none]

uniq

Used to return the device's serial number or other unique identifier, or empty or NULL if unavailable.

[out][transfer none]

Returns

TRUE if this is an evdev device and information was available


srt_input_device_get_usb_device_sys_path ()

const char *
srt_input_device_get_usb_device_sys_path
                               (SrtInputDevice *device);

If the device is associated with a USB device, return the path in /sys representing the Linux usb_device. If not, return NULL.

For processes in a container, it is not guaranteed that this path will exist in the container's /sys.

The returned string will not be freed as long as device is referenced, but the directory in /sys might be deleted, or even reused for a different device.

Parameters

device

An object implementing SrtInputDeviceInterface

 

Returns

A path in /sys that will not be freed as long as a reference to device is held, or NULL.

[nullable][transfer none]


srt_input_device_dup_usb_device_uevent ()

gchar *
srt_input_device_dup_usb_device_uevent
                               (SrtInputDevice *device);

Return the uevent data structure similar to srt_input_device_dup_uevent(), but for the ancestor device returned by srt_input_device_get_usb_device_sys_path().

Parameters

device

An object implementing SrtInputDeviceInterface

 

Returns

A multi-line string, or NULL. Free with g_free().

[nullable][transfer full]


srt_input_device_get_usb_device_identity ()

gboolean
srt_input_device_get_usb_device_identity
                               (SrtInputDevice *device,
                                unsigned int *vendor_id,
                                unsigned int *product_id,
                                unsigned int *device_version,
                                const char **manufacturer,
                                const char **product,
                                const char **serial);

Attempt to identify the device. If available, return details via "out" parameters.

Parameters

device

An object implementing SrtInputDeviceInterface

 

vendor_id

Used to return the vendor ID, namespaced by the bus_type , or 0 if unavailable.

[out]

product_id

Used to return the product ID, namespaced by the vendor_id , or 0 if unavailable.

[out]

device_version

Used to return the product version, or 0 if unavailable.

[out]

manufacturer

Used to return the human-readable name of the manufacturer, or empty or NULL if unavailable.

[out][transfer none]

product

Used to return the human-readable name of the product, or empty or NULL if unavailable.

[out][transfer none]

serial

Used to return the device's serial number or other unique identifier, or empty or NULL if unavailable.

[out][transfer none]

Returns

TRUE if this is a USB device and information was available


srt_input_device_open ()

int
srt_input_device_open (SrtInputDevice *device,
                       int flags,
                       GError **error);

flags must include one of: O_RDONLY, O_WRONLY, or O_RDWR.

flags may include zero or more of: O_NONBLOCK.

The file descriptor is always opened with O_CLOEXEC and O_NOCTTY. Explicitly specifying those flags is not allowed.

Parameters

device

An object implementing SrtInputDeviceInterface

 

flags

Flags affecting how the device is opened

 

error

Used to report the error on failure

 

Returns

A file descriptor owned by the caller, which must be closed with close(2) after use, or a negative number on error.


srt_input_device_monitor_new ()

SrtInputDeviceMonitor *
srt_input_device_monitor_new (SrtInputDeviceMonitorFlags flags);

Return an object that can be used to enumerate and monitor input devices.

Take additional references with g_object_ref(), release references with g_object_unref().

Parameters

flags

Flags affecting the behaviour of the input device monitor.

 

Returns

the input device monitor.

[transfer full]


srt_input_device_monitor_get_flags ()

SrtInputDeviceMonitorFlags
srt_input_device_monitor_get_flags (SrtInputDeviceMonitor *monitor);

Return flags describing the input device monitor.

Parameters

monitor

An object implementing SrtInputDeviceMonitorInterface

 

Returns

Flags describing the input device monitor.


srt_input_device_monitor_request_raw_hid ()

void
srt_input_device_monitor_request_raw_hid
                               (SrtInputDeviceMonitor *monitor);

Tell the input device monitor to return all raw HID devices.

If neither this method nor srt_input_device_monitor_request_evdev() is called, no devices will be found.

This function cannot be called if srt_input_device_monitor_start() or srt_input_device_monitor_stop() have already been called.

Parameters

monitor

The input device monitor

 

srt_input_device_monitor_request_evdev ()

void
srt_input_device_monitor_request_evdev
                               (SrtInputDeviceMonitor *monitor);

Tell the input device monitor to return all evdev (event) devices.

If neither this method nor srt_input_device_monitor_request_raw_hid() is called, no devices will be found.

This function cannot be called if srt_input_device_monitor_start() or srt_input_device_monitor_stop() have already been called.

Parameters

monitor

The input device monitor

 

srt_input_device_monitor_is_active ()

gboolean
srt_input_device_monitor_is_active (SrtInputDeviceMonitor *monitor);

Return TRUE if srt_input_device_monitor_start() has been called successfully, and srt_input_device_monitor_stop() has not subsequently been called.

Parameters

monitor

The input device monitor

 

Returns

TRUE if active


srt_input_device_monitor_start ()

gboolean
srt_input_device_monitor_start (SrtInputDeviceMonitor *monitor,
                                GError **error);

Start to watch for input devices.

The device monitor will emit signals in the thread-default main context of the thread where this function was called (see g_main_context_push_thread_default() for details).

The SrtInputDeviceMonitor::added signal will be emitted when a matching input device is detected. If the monitor is watching for both SRT_INPUT_DEVICE_INTERFACE_FLAGS_EVENT and SRT_INPUT_DEVICE_INTERFACE_FLAGS_RAW_HID devices, one signal will be emitted for each one.

The SrtInputDeviceMonitor::removed signal will be emitted when a matching input device is removed.

This function cannot be called if srt_input_device_monitor_start() or srt_input_device_monitor_stop() have already been called.

Parameters

monitor

The input device monitor

 

error

Used to report an error on failure

 

srt_input_device_monitor_stop ()

void
srt_input_device_monitor_stop (SrtInputDeviceMonitor *monitor);

Stop the input device monitor. It still exists in memory until all references are released, but will stop signalling new events.

Parameters

monitor

The input device monitor

 

Types and Values

enum SrtInputDeviceTypeFlags

Flags describing a type of input device. An input device can fall into one or more of these categories.

Members

SRT_INPUT_DEVICE_TYPE_FLAGS_JOYSTICK

A joystick, gamepad, steering wheel or other game controller (udev ID_INPUT_JOYSTICK)

 

SRT_INPUT_DEVICE_TYPE_FLAGS_ACCELEROMETER

An accelerometer, either motion controls in a game controller such as Playstation 3 "sixaxis" controllers or in the computer itself (udev ID_INPUT_ACCELEROMETER). Note that unlike SDL, SrtInputDeviceMonitor always considers accelerometers to be their own device type distinct from joysticks; there is no equivalent of SDL_HINT_ACCELEROMETER_AS_JOYSTICK.

 

SRT_INPUT_DEVICE_TYPE_FLAGS_KEYBOARD

Keyboards with a somewhat full set of keys (udev ID_INPUT_KEYBOARD)

 

SRT_INPUT_DEVICE_TYPE_FLAGS_HAS_KEYS

Any device with keyboard keys, however incomplete (udev ID_INPUT_KEY)

 

SRT_INPUT_DEVICE_TYPE_FLAGS_MOUSE

A mouse or mouse-like pointer controller (udev ID_INPUT_MOUSE)

 

SRT_INPUT_DEVICE_TYPE_FLAGS_TOUCHPAD

A touchpad, perhaps built in to a game controller like the Playstation 4 controller, or perhaps used as a mouse replacement as in most laptops (udev ID_INPUT_TOUCHPAD)

 

SRT_INPUT_DEVICE_TYPE_FLAGS_TOUCHSCREEN

A touchscreen (udev ID_INPUT_TOUCHSCREEN)

 

SRT_INPUT_DEVICE_TYPE_FLAGS_TABLET

A graphics tablet (udev ID_INPUT_TABLET)

 

SRT_INPUT_DEVICE_TYPE_FLAGS_TABLET_PAD

A graphics tablet with buttons (udev ID_INPUT_TABLET_PAD)

 

SRT_INPUT_DEVICE_TYPE_FLAGS_POINTING_STICK

A mouse-like control similar to the IBM/Lenovo Trackpoint (udev ID_INPUT_POINTINGSTICK)

 

SRT_INPUT_DEVICE_TYPE_FLAGS_SWITCH

A switch, such as a laptop lid being opened (udev ID_INPUT_SWITCH)

 

SRT_INPUT_DEVICE_TYPE_FLAGS_NONE

None of the above

 

enum SrtInputDeviceInterfaceFlags

Flags describing the interface offered by an input device.

Members

SRT_INPUT_DEVICE_INTERFACE_FLAGS_EVENT

evdev event device nodes, typically /dev/input/event*

 

SRT_INPUT_DEVICE_INTERFACE_FLAGS_RAW_HID

Raw USB or Bluetooth HID device nodes, typically /dev/hidraw*

 

SRT_INPUT_DEVICE_INTERFACE_FLAGS_READABLE

Only report device nodes that appear to be openable in read-only mode

 

SRT_INPUT_DEVICE_INTERFACE_FLAGS_READ_WRITE

Only report device nodes that appear to be openable in read/write mode

 

SRT_INPUT_DEVICE_INTERFACE_FLAGS_NONE

None of the above

 

enum SrtInputDeviceMonitorFlags

Flags affecting the behaviour of the input device monitor.

Members

SRT_INPUT_DEVICE_MONITOR_FLAGS_ONCE

Enumerate the devices that were available when monitoring starts, and then stop monitoring.

 

SRT_INPUT_DEVICE_MONITOR_FLAGS_UDEV

Prefer to get devices from udev.

 

SRT_INPUT_DEVICE_MONITOR_FLAGS_DIRECT

Prefer to get devices by monitoring /dev, /sys directly.

 

SRT_INPUT_DEVICE_MONITOR_FLAGS_NONE

No special behaviour.

 

Property Details

The “flags” property

  “flags”                    SrtInputDeviceMonitorFlags

Flags affecting the input device monitor.

Flags: Read / Write / Construct Only


The “is-active” property

  “is-active”                gboolean

TRUE if started and not stopped.

Flags: Read

Default value: FALSE

Signal Details

The “added” signal

void
user_function (SrtInputDeviceMonitor *monitor,
               SrtInputDevice        *device,
               gpointer               user_data)

Emitted when an input device is added.

Parameters

monitor

The input device monitor

 

device

The device

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “all-for-now” signal

void
user_function (SrtInputDeviceMonitor *monitor,
               gpointer               user_data)

Emitted when the initial batch of input devices has been discovered.

Parameters

monitor

The input device monitor

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “removed” signal

void
user_function (SrtInputDeviceMonitor *monitor,
               SrtInputDevice        *device,
               gpointer               user_data)

Emitted when an input device is removed.

Parameters

monitor

The input device monitor

 

device

The device

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last