Device

Description

These devices can be enumerated and passed to flu_player_device_open(), instead of flu_player_uri_open(), which requires a URI. Devices allow the application to access cameras, microphones, screen capture or DVD drives, which do not map nicely to URIs in most cases.

flu_device_list_get ()

GList * flu_device_list_get ();

Retrieves the list of currently available hardware devices as a GList of FluDevice.

Free the whole list afterwards with flu_device_list_free(), or keep extra references with flu_device_ref() and flu_device_unref()

Returns

The GList of hardware devices

flu_device_ref ()

FluDevice * flu_device_ref (FluDevice *device);

Add a reference to an FluDevice

Parameters

device

The device to be referenced

Returns

The same object, for programming convenience

flu_device_unref ()

void flu_device_unref (FluDevice *device);

Remove a reference from an FluDevice

Parameters

device

The device to be unreferenced

flu_device_list_free ()

void flu_device_list_free (GList *devices_list);

Frees a device list returned by flu_device_list_get().

This is a convenience wrapper around g_list_free_full() calling flu_device_unref() for each entry in the list.

Parameters

devices_list

The list to free

flu_device_type_name_get ()

const gchar * flu_device_type_name_get (FluDeviceType type);

Returns a human-readable string describing a device category

Parameters

type

The FluDevice type

Returns

The device category name

flu_device_type_get ()

FluDeviceType flu_device_type_get (const FluDevice *device);

Category this device belongs to

Parameters

device

The FluDevice

Returns

The device's FluDeviceType

flu_device_uri_get ()

const gchar * flu_device_uri_get (const FluDevice *device);

Device URI

Could be dvd:///dev/dvd on Linux or dvd://\\.\D: on Windows, for example. Not all devices have a URI.

Parameters

device

The FluDevice

Returns

The device's URI, or NULL

flu_device_label_get ()

const gchar * flu_device_label_get (const FluDevice *device);

Media label read from the device. Not available for all kinds of media. Mostly human-readable.

Parameters

device

The FluDevice

Returns

The device's current media label, or NULL

flu_device_current_media_id_get ()

const gchar * flu_device_current_media_id_get (const FluDevice *device);

Unique ID for the media currently inserted in the device (for devices with removable media, like DVDs, for example).

It is a 128-bit MD5 string (16 chars), NULL-terminated for convenience.

Parameters

device

The FluDevice

Returns

The device's current media ID

Types and Values

enum FluDeviceType

Device categories, useful for searching for a specific device or using device-type-specific API

FLU_DEVICE_TYPE_UNKNOWN

Unknown device type

FLU_DEVICE_TYPE_DVD_DRIVE

A DVD drive

FLU_DEVICE_TYPE_CAMERA

A video camera

FLU_DEVICE_TYPE_SCREEN_CAPTURE

A monitor screen whose contents can be captured. Useful for recording game sessions or video tutorials.

FLU_DEVICE_TYPE_MICROPHONE

An audio recording device

FluDevice

typedef struct { } FluDevice;

An opaque structure representing a hardware device. Obtain the list of available devices using flu_device_list_get() and examine each one through the different flu_device_*_get() methods. You also receive an FluDevice in the FLU_EVENT_TYPE_NEW_MEDIA_AVAILABLE and FLU_EVENT_TYPE_MEDIA_REMOVED events.