PipeWire Metadata¶
digraph inheritance { rankdir=LR; GObject -> WpObject; WpObject -> WpProxy; WpProxy -> WpGlobalProxy; WpGlobalProxy -> WpMetadata; WpMetadata-> WpImplMetadata; }-
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
-
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. Use wp_metadata_iterator_item_extract() to parse the items returned by this iterator.
- Parameters
self
: a metadata objectsubject
: the metadata subject id, or -1 (PW_ID_ANY)
-
void
wp_metadata_iterator_item_extract
(const GValue * item, guint32 * subject, const gchar ** key, const gchar ** type, const gchar ** value)¶ Extracts the metadata subject, key, type and value out of a GValue that was returned from the WpIterator of wp_metadata_find()
- Parameters
item
: a GValue that was returned from the WpIterator of wp_metadata_find()subject
: (out)(optional): the subject id of the current itemkey
: (out)(optional)(transfer none): the key of the current itemtype
: (out)(optional)(transfer none): the type of the current itemvalue
: (out)(optional)(transfer none): the value of the current item
-
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
(wp_metadata_get_type ())¶ The WpMetadata GType.
-
WP_TYPE_IMPL_METADATA
(wp_impl_metadata_get_type ())¶ The WpImplMetadata GType.