2020-07-29 19:27:40 +05:30
|
|
|
/* WirePlumber
|
|
|
|
|
*
|
2020-08-31 16:21:35 +03:00
|
|
|
* Copyright © 2020 Collabora Ltd.
|
2020-07-29 19:27:40 +05:30
|
|
|
* @author Raghavendra Rao <raghavendra.rao@collabora.com>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __WIREPLUMBER_METADATA_H__
|
|
|
|
|
#define __WIREPLUMBER_METADATA_H__
|
|
|
|
|
|
lib: refactor WpProxy
This is an attempt to unclutter the API of WpProxy and
split functionality into smaller pieces, making it easier
to work with.
In this new class layout, we have the following classes:
- WpObject: base class for everything; handles activating
| and deactivating "features"
|- WpProxy: base class for anything that wraps a pw_proxy;
| handles events from pw_proxy and nothing more
|- WpGlobalProxy: handles integration with the registry
All the other classes derive from WpGlobalProxy. The reason
for separating WpGlobalProxy from WpProxy, though, is that
classes such as WpImplNode / WpSpaDevice can also derive from
WpProxy now, without interfacing with the registry.
All objects that come with an "info" structure and have properties
and/or params also implement the WpPipewireObject interface. This
provides the API to query properties and get/set params. Essentially,
this is implemented by all classes except WpMetadata (pw_metadata
does not have info)
This interface is implemented on each object separately, using
a private "mixin", which is a set of vfunc implementations and helper
functions (and macros) to facilitate the implementation of this interface.
A notable difference to the old WpProxy is that now features can be
deactivated, so it is possible to enable something and later disable
it again.
This commit disables modules, tests, tools, etc, to avoid growing the
patch more, while ensuring that the project compiles.
2020-11-10 19:17:02 +02:00
|
|
|
#include "global-proxy.h"
|
2020-07-29 19:27:40 +05:30
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
2021-05-13 17:54:58 +03:00
|
|
|
/*!
|
2021-05-21 18:40:43 +03:00
|
|
|
* \brief An extension of WpProxyFeatures for WpMetadata objects
|
|
|
|
|
* \ingroup wpmetadata
|
lib: refactor WpProxy
This is an attempt to unclutter the API of WpProxy and
split functionality into smaller pieces, making it easier
to work with.
In this new class layout, we have the following classes:
- WpObject: base class for everything; handles activating
| and deactivating "features"
|- WpProxy: base class for anything that wraps a pw_proxy;
| handles events from pw_proxy and nothing more
|- WpGlobalProxy: handles integration with the registry
All the other classes derive from WpGlobalProxy. The reason
for separating WpGlobalProxy from WpProxy, though, is that
classes such as WpImplNode / WpSpaDevice can also derive from
WpProxy now, without interfacing with the registry.
All objects that come with an "info" structure and have properties
and/or params also implement the WpPipewireObject interface. This
provides the API to query properties and get/set params. Essentially,
this is implemented by all classes except WpMetadata (pw_metadata
does not have info)
This interface is implemented on each object separately, using
a private "mixin", which is a set of vfunc implementations and helper
functions (and macros) to facilitate the implementation of this interface.
A notable difference to the old WpProxy is that now features can be
deactivated, so it is possible to enable something and later disable
it again.
This commit disables modules, tests, tools, etc, to avoid growing the
patch more, while ensuring that the project compiles.
2020-11-10 19:17:02 +02:00
|
|
|
*/
|
|
|
|
|
typedef enum { /*< flags >*/
|
2021-05-21 18:40:43 +03:00
|
|
|
/*! caches metadata locally */
|
lib: refactor WpProxy
This is an attempt to unclutter the API of WpProxy and
split functionality into smaller pieces, making it easier
to work with.
In this new class layout, we have the following classes:
- WpObject: base class for everything; handles activating
| and deactivating "features"
|- WpProxy: base class for anything that wraps a pw_proxy;
| handles events from pw_proxy and nothing more
|- WpGlobalProxy: handles integration with the registry
All the other classes derive from WpGlobalProxy. The reason
for separating WpGlobalProxy from WpProxy, though, is that
classes such as WpImplNode / WpSpaDevice can also derive from
WpProxy now, without interfacing with the registry.
All objects that come with an "info" structure and have properties
and/or params also implement the WpPipewireObject interface. This
provides the API to query properties and get/set params. Essentially,
this is implemented by all classes except WpMetadata (pw_metadata
does not have info)
This interface is implemented on each object separately, using
a private "mixin", which is a set of vfunc implementations and helper
functions (and macros) to facilitate the implementation of this interface.
A notable difference to the old WpProxy is that now features can be
deactivated, so it is possible to enable something and later disable
it again.
This commit disables modules, tests, tools, etc, to avoid growing the
patch more, while ensuring that the project compiles.
2020-11-10 19:17:02 +02:00
|
|
|
WP_METADATA_FEATURE_DATA = (WP_PROXY_FEATURE_CUSTOM_START << 0),
|
|
|
|
|
} WpMetadataFeatures;
|
|
|
|
|
|
2021-05-13 17:54:58 +03:00
|
|
|
/*!
|
2021-05-21 18:40:43 +03:00
|
|
|
* \brief The WpMetadata GType
|
|
|
|
|
* \ingroup wpmetadata
|
2020-07-29 19:27:40 +05:30
|
|
|
*/
|
|
|
|
|
#define WP_TYPE_METADATA (wp_metadata_get_type ())
|
2020-07-31 17:36:21 +03:00
|
|
|
|
2020-07-29 19:27:40 +05:30
|
|
|
WP_API
|
lib: refactor WpProxy
This is an attempt to unclutter the API of WpProxy and
split functionality into smaller pieces, making it easier
to work with.
In this new class layout, we have the following classes:
- WpObject: base class for everything; handles activating
| and deactivating "features"
|- WpProxy: base class for anything that wraps a pw_proxy;
| handles events from pw_proxy and nothing more
|- WpGlobalProxy: handles integration with the registry
All the other classes derive from WpGlobalProxy. The reason
for separating WpGlobalProxy from WpProxy, though, is that
classes such as WpImplNode / WpSpaDevice can also derive from
WpProxy now, without interfacing with the registry.
All objects that come with an "info" structure and have properties
and/or params also implement the WpPipewireObject interface. This
provides the API to query properties and get/set params. Essentially,
this is implemented by all classes except WpMetadata (pw_metadata
does not have info)
This interface is implemented on each object separately, using
a private "mixin", which is a set of vfunc implementations and helper
functions (and macros) to facilitate the implementation of this interface.
A notable difference to the old WpProxy is that now features can be
deactivated, so it is possible to enable something and later disable
it again.
This commit disables modules, tests, tools, etc, to avoid growing the
patch more, while ensuring that the project compiles.
2020-11-10 19:17:02 +02:00
|
|
|
G_DECLARE_DERIVABLE_TYPE (WpMetadata, wp_metadata, WP, METADATA, WpGlobalProxy)
|
2020-07-29 19:27:40 +05:30
|
|
|
|
|
|
|
|
struct _WpMetadataClass
|
|
|
|
|
{
|
lib: refactor WpProxy
This is an attempt to unclutter the API of WpProxy and
split functionality into smaller pieces, making it easier
to work with.
In this new class layout, we have the following classes:
- WpObject: base class for everything; handles activating
| and deactivating "features"
|- WpProxy: base class for anything that wraps a pw_proxy;
| handles events from pw_proxy and nothing more
|- WpGlobalProxy: handles integration with the registry
All the other classes derive from WpGlobalProxy. The reason
for separating WpGlobalProxy from WpProxy, though, is that
classes such as WpImplNode / WpSpaDevice can also derive from
WpProxy now, without interfacing with the registry.
All objects that come with an "info" structure and have properties
and/or params also implement the WpPipewireObject interface. This
provides the API to query properties and get/set params. Essentially,
this is implemented by all classes except WpMetadata (pw_metadata
does not have info)
This interface is implemented on each object separately, using
a private "mixin", which is a set of vfunc implementations and helper
functions (and macros) to facilitate the implementation of this interface.
A notable difference to the old WpProxy is that now features can be
deactivated, so it is possible to enable something and later disable
it again.
This commit disables modules, tests, tools, etc, to avoid growing the
patch more, while ensuring that the project compiles.
2020-11-10 19:17:02 +02:00
|
|
|
WpGlobalProxyClass parent_class;
|
2021-06-08 17:38:14 +03:00
|
|
|
|
|
|
|
|
/*< private >*/
|
|
|
|
|
WP_PADDING(4)
|
2020-07-29 19:27:40 +05:30
|
|
|
};
|
|
|
|
|
|
2020-08-31 16:14:47 +03:00
|
|
|
WP_API
|
2021-02-05 10:20:33 -05:00
|
|
|
WpIterator * wp_metadata_new_iterator (WpMetadata * self, guint32 subject);
|
2020-08-31 16:14:47 +03:00
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
void wp_metadata_iterator_item_extract (const GValue * item, guint32 * subject,
|
|
|
|
|
const gchar ** key, const gchar ** type, const gchar ** value);
|
|
|
|
|
|
2021-01-11 13:09:23 -05:00
|
|
|
WP_API
|
|
|
|
|
const gchar * wp_metadata_find (WpMetadata * self, guint32 subject,
|
|
|
|
|
const gchar * key, const gchar ** type);
|
|
|
|
|
|
2020-08-31 16:14:47 +03:00
|
|
|
WP_API
|
|
|
|
|
void wp_metadata_set (WpMetadata * self, guint32 subject,
|
|
|
|
|
const gchar * key, const gchar * type, const gchar * value);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
void wp_metadata_clear (WpMetadata * self);
|
2020-07-29 19:27:40 +05:30
|
|
|
|
2021-05-13 17:54:58 +03:00
|
|
|
/*!
|
2021-05-21 18:40:43 +03:00
|
|
|
* \brief The WpImplMetadata GType
|
|
|
|
|
* \ingroup wpmetadata
|
2020-07-29 19:27:40 +05:30
|
|
|
*/
|
|
|
|
|
#define WP_TYPE_IMPL_METADATA (wp_impl_metadata_get_type ())
|
2020-07-31 17:36:21 +03:00
|
|
|
|
2020-07-29 19:27:40 +05:30
|
|
|
WP_API
|
|
|
|
|
G_DECLARE_FINAL_TYPE (WpImplMetadata, wp_impl_metadata, WP, IMPL_METADATA, WpMetadata)
|
2020-07-31 17:36:21 +03:00
|
|
|
|
2020-07-29 19:27:40 +05:30
|
|
|
WP_API
|
|
|
|
|
WpImplMetadata * wp_impl_metadata_new (WpCore * core);
|
2020-07-31 17:36:21 +03:00
|
|
|
|
2020-07-29 19:27:40 +05:30
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
|
|
#endif
|