wireplumber/lib/wp/object-manager.h
George Kiagiadakis 753e708544 object-manager: refactor to be able to track locally created proxies
There are 3 kinds of WpProxy objects:
 * the ones that are created as a result of binding a global
   from the registry
 * the ones that are created as a result of calling into a remote
   factory (wp_node_new_from_factory, etc...)
 * the ones that are a local implementation of an object
   (WpImplNode, etc...) and are exported

Previously the object manager was only able to track the first kind.
With these changes we can now also have globals associated with
WpProxies that were created earlier (and caused the creation of the global).
This saves some resources and reduces round-trips (in case client
code wants to change properties of an object that is locally
implemented, it shouldn't need to do a round-trip through the server)
2020-02-14 17:12:23 +02:00

40 lines
967 B
C

/* WirePlumber
*
* Copyright © 2019 Collabora Ltd.
* @author George Kiagiadakis <george.kiagiadakis@collabora.com>
*
* SPDX-License-Identifier: MIT
*/
#ifndef __WIREPLUMBER_OBJECT_MANAGER_H__
#define __WIREPLUMBER_OBJECT_MANAGER_H__
#include <glib-object.h>
#include "proxy.h"
G_BEGIN_DECLS
typedef enum {
WP_OBJECT_MANAGER_CONSTRAINT_PW_GLOBAL_PROPERTY,
WP_OBJECT_MANAGER_CONSTRAINT_PW_PROPERTY,
WP_OBJECT_MANAGER_CONSTRAINT_G_PROPERTY,
} WpObjectManagerConstraintType;
#define WP_TYPE_OBJECT_MANAGER (wp_object_manager_get_type ())
WP_API
G_DECLARE_FINAL_TYPE (WpObjectManager, wp_object_manager, WP, OBJECT_MANAGER, GObject)
WP_API
WpObjectManager * wp_object_manager_new (void);
WP_API
void wp_object_manager_add_interest (WpObjectManager *self,
GType gtype, GVariant * constraints, WpProxyFeatures wanted_features);
WP_API
GPtrArray * wp_object_manager_get_objects (WpObjectManager *self,
GType type_filter);
G_END_DECLS
#endif