diff options
author | Wim Taymans <wtaymans@redhat.com> | 2019-05-20 16:11:23 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2019-05-23 12:59:24 +0200 |
commit | ff946e3d4be276c8f36a656a708a4c736a3e15aa (patch) | |
tree | 486730290f5ea9ced87e2a0ce6bf5fd470232065 /src/gst | |
parent | eb6481efb3c3f4288c2e0156940ee10434577a11 (diff) |
interface: add an interface structiface2
The interface struct has the type,version and methods of the
interface.
Make spa interfaces extend from spa_interface and make a
separate structure for the methods.
Pass a generic void* as the first argument of methods, like
we don in PipeWire.
Bundle the methods + implementation in a versioned inteface
and use that to invoke methods. This way we can do version
checks on the methods.
Make resource and proxy interfaces that we can can call. We
can then make the core interfaces independent on proxy/resource and
hide them in the lower layers.
Add add_listener method to methods of core interfaces, just
like SPA.
Diffstat (limited to 'src/gst')
-rw-r--r-- | src/gst/gstpipewiredeviceprovider.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gst/gstpipewiredeviceprovider.c b/src/gst/gstpipewiredeviceprovider.c index 8dad8f6b..513eeea5 100644 --- a/src/gst/gstpipewiredeviceprovider.c +++ b/src/gst/gstpipewiredeviceprovider.c @@ -462,7 +462,7 @@ static void registry_event_global(void *data, uint32_t id, uint32_t parent_id, u node = pw_registry_proxy_bind(rd->registry, id, PW_TYPE_INTERFACE_Node, - PW_VERSION_NODE, sizeof(*nd)); + PW_VERSION_NODE_PROXY, sizeof(*nd)); if (node == NULL) goto no_mem; @@ -486,7 +486,7 @@ static void registry_event_global(void *data, uint32_t id, uint32_t parent_id, u port = pw_registry_proxy_bind(rd->registry, id, PW_TYPE_INTERFACE_Port, - PW_VERSION_PORT, sizeof(*pd)); + PW_VERSION_PORT_PROXY, sizeof(*pd)); if (port == NULL) goto no_mem; @@ -580,8 +580,7 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider) self->list_only = TRUE; self->devices = NULL; - data->registry = pw_core_proxy_get_registry(self->core_proxy, - PW_VERSION_REGISTRY, 0); + data->registry = pw_core_proxy_get_registry(self->core_proxy, PW_VERSION_REGISTRY_PROXY, 0); pw_registry_proxy_add_listener(data->registry, &data->registry_listener, ®istry_events, data); pw_core_proxy_sync(self->core_proxy, 0, self->seq++); @@ -666,8 +665,8 @@ gst_pipewire_device_provider_start (GstDeviceProvider * provider) } GST_DEBUG_OBJECT (self, "connected"); - self->registry = pw_core_proxy_get_registry(self->core_proxy, - PW_VERSION_REGISTRY, 0); + self->registry = pw_core_proxy_get_registry(self->core_proxy, PW_VERSION_REGISTRY_PROXY, 0); + data->registry = self->registry; pw_registry_proxy_add_listener(self->registry, &data->registry_listener, ®istry_events, data); |