Class: Gst::DeviceProvider

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Overview

The structure of the base Gst::DeviceProviderClass

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Object

#add_control_binding, check_uniqueness, #control_bindings_disabled=, #control_rate, #control_rate=, default_deep_notify, #default_error, #get_control_binding, #get_g_value_array, #get_value, #get_value_array, #has_active_control_bindings, #has_ancestor, #has_as_ancestor, #has_as_parent, #name, #name=, #parent, #parent=, #path_string, #ref, ref_sink, #remove_control_binding, replace, #set_control_binding_disabled, #suggest_next_sync, #sync_values, #unparent, #unref

Class Method Details

.register(plugin, name, rank, type) ⇒ Boolean

Create a new device providerfactory capable of instantiating objects of the type and add the factory to plugin.

Parameters:

  • plugin (Gst::Plugin)

    Gst::Plugin to register the device provider with, or nil for a static device provider.

  • name (String)

    name of device providers of this type

  • rank (Integer)

    rank of device provider (higher rank means more importance when autoplugging)

  • type (GLib::Type)

    GType of device provider to register

Returns:

  • (Boolean)

    true, if the registering succeeded, false on error

Instance Method Details

#add_metadata(key, value) ⇒ nil

Set key with value as metadata in klass.

Parameters:

  • key (String)

    the key to set

  • value (String)

    the value to set

Returns:

  • (nil)

#add_static_metadata(key, value) ⇒ nil

Set key with value as metadata in klass.

Same as gst_device_provider_class_add_metadata(), but value must be a static string or an inlined string, as it will not be copied. (GStreamer plugins will be made resident once loaded, so this function can be used even from dynamically loaded plugins.)

Parameters:

  • key (String)

    the key to set

  • value (String)

    the value to set

Returns:

  • (nil)

#busGst::Bus

Gets the Gst::Bus of this #GstDeviceProvider

Returns:

#can_monitorBoolean

Returns:

  • (Boolean)

#device_add(device) ⇒ nil

Posts a message on the provider's Gst::Bus to inform applications that a new device has been added.

This is for use by subclasses.

device's reference count will be incremented, and any floating reference will be removed (see gst_object_ref_sink()).

Parameters:

  • device (Gst::Device)

    a Gst::Device that has been added

Returns:

  • (nil)

#device_changed(device, changed_device) ⇒ nil

This function is used when changed_device was modified into its new form device. This will post a DEVICE_CHANGED message on the bus to let the application know that the device was modified. Gst::Device is immutable for MT. safety purposes so this is an "atomic" way of letting the application know when a device was modified.

Parameters:

  • device (Gst::Device)

    the new version of changed_device

  • changed_device (Gst::Device)

    the old version of the device that has been updated

Returns:

  • (nil)

#device_remove(device) ⇒ nil

Posts a message on the provider's Gst::Bus to inform applications that a device has been removed.

This is for use by subclasses.

Parameters:

  • device (Gst::Device)

    a Gst::Device that has been removed

Returns:

  • (nil)

#devicesGLib::List<Gst::Device>

Gets a list of devices that this provider understands. This may actually probe the hardware if the provider is not currently started.

If the provider has been started, this will returned the same Gst::Device objedcts that have been returned by the #GST_MESSAGE_DEVICE_ADDED messages.

Returns:

  • (GLib::List<Gst::Device>)

    a #GList of Gst::Device

#factoryGst::DeviceProviderFactory

Retrieves the factory that was used to create this device provider.

Returns:

  • (Gst::DeviceProviderFactory)

    the Gst::DeviceProviderFactory used for creating this device provider. no refcounting is needed.

#get_metadata(key) ⇒ String

Get metadata with key in klass.

Parameters:

  • key (String)

    the key to get

Returns:

  • (String)

    the metadata for key.

#hidden_providersArray<String>

Get the provider factory names of the Gst::DeviceProvider instances that are hidden by provider.

Returns:

  • (Array<String>)

    a list of hidden providers factory names or nil when nothing is hidden by provider. Free with g_strfreev.

#hide_provider(name) ⇒ nil

Make provider hide the devices from the factory with name.

This function is used when provider will also provide the devices reported by provider factory name. A monitor should stop monitoring the device provider with name to avoid duplicate devices.

Parameters:

  • name (String)

    a provider factory name

Returns:

  • (nil)

#is_startedBoolean

This function can be used to know if the provider was successfully started.

Returns:

  • (Boolean)

#set_metadata(longname, classification, description, author) ⇒ nil

Sets the detailed information for a Gst::DeviceProviderClass.

This function is for use in _class_init functions only. for more details and common types. E.g: "Sink/File" E.g: "Write stream to a file" multiple author metadata. E.g: "Joe Bloggs <joe.blogs at foo.com>"

Parameters:

  • longname (String)

    The long English name of the device provider. E.g. "File Sink"

  • classification (String)

    String describing the type of device provider, as an unordered list separated with slashes ('/'). See draft-klass.txt of the design docs

  • description (String)

    Sentence describing the purpose of the device provider.

  • author (String)

    Name and contact details of the author(s). Use \n to separate

Returns:

  • (nil)

#set_static_metadata(longname, classification, description, author) ⇒ nil

Sets the detailed information for a Gst::DeviceProviderClass.

This function is for use in _class_init functions only.

Same as gst_device_provider_class_set_metadata(), but longname, classification, description, and author must be static strings or inlined strings, as they will not be copied. (GStreamer plugins will be made resident once loaded, so this function can be used even from dynamically loaded plugins.) an unordered list separated with slashes ('/'). See draft-klass.txt of the design docs for more details and common types. E.g: "Sink/File" element. E.g: "Write stream to a file" to separate multiple author metadata. E.g: "Joe Bloggs <joe.blogs at foo.com>"

Parameters:

  • longname (String)

    The long English name of the element. E.g. "File Sink"

  • classification (String)

    String describing the type of element, as

  • description (String)

    Sentence describing the purpose of the

  • author (String)

    Name and contact details of the author(s). Use \n

Returns:

  • (nil)

#startBoolean

Starts providering the devices. This will cause #GST_MESSAGE_DEVICE_ADDED and #GST_MESSAGE_DEVICE_REMOVED messages to be posted on the provider's bus when devices are added or removed from the system.

Since the Gst::DeviceProvider is a singleton, gst_device_provider_start() may already have been called by another user of the object, gst_device_provider_stop() needs to be called the same number of times.

After this function has been called, gst_device_provider_get_devices() will return the same objects that have been received from the #GST_MESSAGE_DEVICE_ADDED messages and will no longer probe.

Returns:

  • (Boolean)

    true if the device providering could be started

#stopnil

Decreases the use-count by one. If the use count reaches zero, this Gst::DeviceProvider will stop providering the devices. This needs to be called the same number of times that gst_device_provider_start() was called.

Returns:

  • (nil)

#unhide_provider(name) ⇒ nil

Make provider unhide the devices from factory name.

This function is used when provider will no longer provide the devices reported by provider factory name. A monitor should start monitoring the devices from provider factory name in order to see all devices again.

Parameters:

  • name (String)

    a provider factory name

Returns:

  • (nil)