lib: object/interface: do not (transfer full) interfaces and objects
This commit is contained in:
@@ -75,20 +75,20 @@ wp_interface_impl_get_object (WpInterfaceImpl * self)
|
||||
* @self: the interface implementation instance
|
||||
* @interface: an interface type
|
||||
*
|
||||
* Returns: (type GObject*) (nullable) (transfer full): the object
|
||||
* Returns: (type GObject*) (nullable) (transfer none): the object
|
||||
* implementing @interface
|
||||
*/
|
||||
gpointer
|
||||
wp_interface_impl_get_sibling (WpInterfaceImpl * self, GType interface)
|
||||
{
|
||||
WpInterfaceImplPrivate *priv = wp_interface_impl_get_instance_private (self);
|
||||
GObject *iface = NULL;
|
||||
gpointer iface = NULL;
|
||||
|
||||
g_return_val_if_fail (WP_IS_INTERFACE_IMPL (self), NULL);
|
||||
g_return_val_if_fail (G_TYPE_IS_INTERFACE (interface), NULL);
|
||||
|
||||
if (g_type_is_a (G_TYPE_FROM_INSTANCE (self), interface)) {
|
||||
iface = G_OBJECT (g_object_ref (self));
|
||||
iface = self;
|
||||
} else if (priv->object) {
|
||||
iface = wp_object_get_interface (priv->object, interface);
|
||||
}
|
||||
|
@@ -94,7 +94,7 @@ wp_object_implements_interface (WpObject * self, GType interface)
|
||||
* @self: the object
|
||||
* @interface: an interface type
|
||||
*
|
||||
* Returns: (type GObject*) (nullable) (transfer full): the object
|
||||
* Returns: (type GObject*) (nullable) (transfer none): the object
|
||||
* implementing @interface
|
||||
*/
|
||||
gpointer
|
||||
@@ -108,7 +108,7 @@ wp_object_get_interface (WpObject * self, GType interface)
|
||||
for (i = 0; i < priv->iface_objects->len; i++) {
|
||||
GObject *obj = g_array_index (priv->iface_objects, GObject*, i);
|
||||
if (g_type_is_a (G_TYPE_FROM_INSTANCE (obj), interface))
|
||||
return g_object_ref (obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
@@ -117,8 +117,8 @@ default_handle_pw_proxy (WpPlugin * self, WpProxy * proxy)
|
||||
|
||||
case PW_TYPE_INTERFACE_Node:
|
||||
{
|
||||
WpProxyRegistry *reg;
|
||||
g_autoptr (WpProxy) parent;
|
||||
g_autoptr (WpProxyRegistry) reg;
|
||||
|
||||
reg = wp_object_get_interface (priv->core, WP_TYPE_PROXY_REGISTRY);
|
||||
parent = wp_proxy_registry_get_proxy (reg, wp_proxy_get_parent_id (proxy));
|
||||
|
@@ -223,7 +223,7 @@ static void
|
||||
wp_proxy_constructed (GObject * object)
|
||||
{
|
||||
WpProxy *self = WP_PROXY (object);
|
||||
g_autoptr (WpProxyRegistry) pr = NULL;
|
||||
WpProxyRegistry *pr = NULL;
|
||||
struct pw_registry_proxy *reg_proxy;
|
||||
const void *events = NULL;
|
||||
uint32_t ver = 0;
|
||||
|
@@ -78,7 +78,7 @@ static void
|
||||
device_node_destroyed (WpProxy * device_node, DefaultSession * session)
|
||||
{
|
||||
g_autoptr (WpObject) core = NULL;
|
||||
g_autoptr (WpSessionRegistry) sr = NULL;
|
||||
WpSessionRegistry *sr = NULL;
|
||||
|
||||
g_info ("Proxy %u destroyed - unregistering session %u",
|
||||
wp_proxy_get_id (device_node), session->session_id);
|
||||
@@ -94,9 +94,9 @@ static gboolean
|
||||
handle_node (WpPlugin * self, WpProxy * proxy)
|
||||
{
|
||||
g_autoptr (WpObject) core = NULL;
|
||||
g_autoptr (WpSessionRegistry) sr = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
g_autoptr (DefaultSession) session = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
WpSessionRegistry *sr = NULL;
|
||||
const gchar *media_class, *ptr;
|
||||
WpSessionDirection direction;
|
||||
guint32 media_type;
|
||||
@@ -158,9 +158,9 @@ plug_dsp (WpProxy * node)
|
||||
{
|
||||
DefaultSession *session;
|
||||
g_autoptr (WpObject) core = NULL;
|
||||
g_autoptr (WpPipewireObjects) pw_objects = NULL;
|
||||
WpPipewireObjects *pw_objects = NULL;
|
||||
struct pw_core_proxy *core_proxy;
|
||||
g_autoptr (WpPipewireProperties) pw_props = NULL;
|
||||
WpPipewireProperties *pw_props = NULL;
|
||||
struct pw_properties *props;
|
||||
const char *name;
|
||||
enum pw_direction reverse_direction;
|
||||
@@ -273,7 +273,7 @@ handle_pw_proxy (WpPlugin * self, WpProxy * proxy)
|
||||
{
|
||||
g_autoptr (WpObject) core = NULL;
|
||||
g_autoptr (WpProxy) parent = NULL;
|
||||
g_autoptr (WpProxyRegistry) reg = NULL;
|
||||
WpProxyRegistry *reg = NULL;
|
||||
DefaultSession *session;
|
||||
|
||||
if (wp_proxy_get_spa_type (proxy) != PW_TYPE_INTERFACE_Port &&
|
||||
|
@@ -85,7 +85,7 @@ static gboolean
|
||||
wp_core_parse_commands_file (WpCore * self, GInputStream * stream,
|
||||
GError ** error)
|
||||
{
|
||||
g_autoptr (WpPluginRegistry) plugin_registry = NULL;
|
||||
WpPluginRegistry *plugin_registry = NULL;
|
||||
gchar buffer[4096];
|
||||
gssize bytes_read;
|
||||
gchar *cur, *linestart, *saveptr;
|
||||
@@ -231,8 +231,8 @@ static void
|
||||
wp_core_dispose (GObject * obj)
|
||||
{
|
||||
WpCore *self = WP_CORE (obj);
|
||||
g_autoptr (WpPluginRegistry) plugin_registry = NULL;
|
||||
g_autoptr (WpProxyRegistry) proxy_registry = NULL;
|
||||
WpPluginRegistry *plugin_registry = NULL;
|
||||
WpProxyRegistry *proxy_registry = NULL;
|
||||
|
||||
/* ensure all proxies and plugins are unrefed,
|
||||
* so that the registries can be disposed */
|
||||
|
@@ -139,9 +139,7 @@ wp_plugin_registry_impl_unload (WpPluginRegistryImpl * self)
|
||||
static inline void
|
||||
make_plugin (WpPluginRegistryImpl * self, PluginData * plugin_data)
|
||||
{
|
||||
g_autoptr (WpObject) core =
|
||||
wp_interface_impl_get_object (WP_INTERFACE_IMPL (self));
|
||||
|
||||
WpObject *core = wp_interface_impl_get_object (WP_INTERFACE_IMPL (self));
|
||||
plugin_data->instance = g_object_new (plugin_data->gtype,
|
||||
"core", core, "metadata", plugin_data->metadata, NULL);
|
||||
}
|
||||
|
@@ -88,9 +88,8 @@ registry_global (void * data, uint32_t id, uint32_t parent_id,
|
||||
{
|
||||
WpProxyRegistryImpl *self = WP_PROXY_REGISTRY_IMPL (data);
|
||||
WpProxy *proxy;
|
||||
g_autoptr (WpPluginRegistry) plugin_registry = NULL;
|
||||
g_autoptr (WpObject) core =
|
||||
wp_interface_impl_get_object (WP_INTERFACE_IMPL (self));
|
||||
WpPluginRegistry *plugin_registry = NULL;
|
||||
WpObject *core = wp_interface_impl_get_object (WP_INTERFACE_IMPL (self));
|
||||
|
||||
proxy = g_object_new (WP_TYPE_PROXY,
|
||||
"id", id,
|
||||
|
@@ -104,8 +104,8 @@ register_session (WpSessionRegistry * sr,
|
||||
GError ** error)
|
||||
{
|
||||
WpSessionRegistryImpl * self = WP_SESSION_REGISTRY_IMPL (sr);
|
||||
g_autoptr (WpPluginRegistry) plugin_registry = NULL;
|
||||
g_autoptr (WpPipewireProperties) pw_props = NULL;
|
||||
WpPluginRegistry *plugin_registry = NULL;
|
||||
WpPipewireProperties *pw_props = NULL;
|
||||
const gchar *media_class = NULL;
|
||||
SessionData data;
|
||||
|
||||
|
Reference in New Issue
Block a user