PipeWire Metadata¶
digraph inheritance { rankdir=LR; GBoxed -> WpMetadataItem GObject -> WpObject; WpObject -> WpProxy; WpProxy -> WpGlobalProxy; WpGlobalProxy -> WpMetadata; WpMetadata-> WpImplMetadata; }-
struct
WpMetadataItem
¶ WpMetadataItem holds the subject, key, type and value of a metadata entry.
-
struct
WpMetadata
¶ The WpMetadata class allows accessing the properties and methods of PipeWire metadata object (
struct pw_metadata
).A WpMetadata is constructed internally when a new metadata object appears on the PipeWire registry and it is made available through the WpObjectManager API.
GObject Signals
- changed
-
struct
WpImplMetadata
¶ Implementation of the metadata object.
Activate this object with at least WP_PROXY_FEATURE_BOUND to export it to PipeWire.
-
wpmetadata::
WpMetadataFeatures
¶ An extension of WpProxyFeatures for WpMetadata objects.
Values:
caches metadata locally
-
WpMetadataItem *
wp_metadata_item_ref
(WpMetadataItem * self)¶ Increases the reference count of a metadata item object.
- Return
- (transfer full): self with an additional reference count on it
- Since
- 0.5.0
- Parameters
self
: a metadata item object
-
void
wp_metadata_item_unref
(WpMetadataItem * self)¶ Decreases the reference count on self and frees it when the ref count reaches zero.
- Since
- 0.5.0
- Parameters
self
: (transfer full): a metadata item object
-
guint32
wp_metadata_item_get_subject
(WpMetadataItem * self)¶ Gets the subject from a metadata item.
- Return
- the metadata subject of the item
- Since
- 0.5.0
- Parameters
self
: the item held by the GValue that was returned from the WpIterator of wp_metadata_new_iterator()
-
const gchar *
wp_metadata_item_get_key
(WpMetadataItem * self)¶ Gets the key from a metadata item.
- Return
- (transfer none): the metadata key of the item
- Since
- 0.5.0
- Parameters
self
: the item held by the GValue that was returned from the WpIterator of wp_metadata_new_iterator()
-
const gchar *
wp_metadata_item_get_value_type
(WpMetadataItem * self)¶ Gets the value type from a metadata item.
- Return
- (transfer none): the metadata value type of the item
- Since
- 0.5.0
- Parameters
self
: the item held by the GValue that was returned from the WpIterator of wp_metadata_new_iterator()
-
const gchar *
wp_metadata_item_get_value
(WpMetadataItem * self)¶ Gets the value from a metadata item.
- Return
- (transfer none): the metadata value of the item
- Since
- 0.5.0
- Parameters
self
: the item held by the GValue that was returned from the WpIterator of wp_metadata_new_iterator()
-
WpIterator *
wp_metadata_new_iterator
(WpMetadata * self, guint32 subject)¶ Iterates over metadata items that matches the given subject.
If no constraints are specified, the returned iterator iterates over all the stored metadata.
Note that this method works on cached metadata. When you change metadata with wp_metadata_set(), this cache will be updated on the next round-trip with the pipewire server.
- Return
- (transfer full): an iterator that iterates over the found metadata. The type of the iterator item is WpMetadataItem.
- Parameters
self
: a metadata objectsubject
: the metadata subject id, or -1 (PW_ID_ANY)
-
const gchar *
wp_metadata_find
(WpMetadata * self, guint32 subject, const gchar * key, const gchar ** type)¶ Finds the metadata value given its subject and key.
- Return
- the metadata string value, or NULL if not found.
- Parameters
self
: a metadata objectsubject
: the metadata subject idkey
: the metadata key nametype
: (out)(optional): the metadata type name
-
void
wp_metadata_set
(WpMetadata * self, guint32 subject, const gchar * key, const gchar * type, const gchar * value)¶ Sets the metadata associated with the given subject and key. Use NULL as a value to unset the given key and use NULL in both key and value to remove all metadata associated with the given subject.
- Parameters
self
: the metadata objectsubject
: the subject id for which this metadata property is being setkey
: (nullable): the key to set, or NULL to remove all metadata for subjecttype
: (nullable): the type of the value; NULL is synonymous to “string”value
: (nullable): the value to set, or NULL to unset the given key
-
void
wp_metadata_clear
(WpMetadata * self)¶ Clears permanently all stored metadata.
- Parameters
self
: the metadata object
-
WpImplMetadata *
wp_impl_metadata_new
(WpCore * core)¶ Creates a new metadata implementation.
- Return
- (transfer full): a new WpImplMetadata
- Parameters
core
: the core
-
WpImplMetadata *
wp_impl_metadata_new_full
(WpCore * core, const gchar * name, WpProperties * properties)¶ Creates a new metadata implementation with name and properties.
- Return
- (transfer full): a new WpImplMetadata
- Since
- 0.4.3
- Parameters
core
: the corename
: (nullable): the metadata nameproperties
: (nullable) (transfer full): the metadata properties
-
WP_TYPE_METADATA_ITEM
(wp_metadata_item_get_type ())¶ The WpMetadataItem GType.
-
WP_TYPE_METADATA
(wp_metadata_get_type ())¶ The WpMetadata GType.
-
WP_TYPE_IMPL_METADATA
(wp_impl_metadata_get_type ())¶ The WpImplMetadata GType.