Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wireplumber
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pkg
wireplumber
Commits
12310019
Commit
12310019
authored
5 years ago
by
Julian Bouzas
Browse files
Options
Downloads
Patches
Plain Diff
proxy-link: add new API
parent
d20633b8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/wp/meson.build
+2
-0
2 additions, 0 deletions
lib/wp/meson.build
lib/wp/proxy-link.c
+125
-0
125 additions, 0 deletions
lib/wp/proxy-link.c
lib/wp/proxy-link.h
+29
-0
29 additions, 0 deletions
lib/wp/proxy-link.h
lib/wp/wp.h
+1
-0
1 addition, 0 deletions
lib/wp/wp.h
with
157 additions
and
0 deletions
lib/wp/meson.build
+
2
−
0
View file @
12310019
...
...
@@ -8,6 +8,7 @@ wp_lib_sources = [
'proxy.c'
,
'proxy-node.c'
,
'proxy-port.c'
,
'proxy-link.c'
,
'remote.c'
,
'remote-pipewire.c'
,
]
...
...
@@ -22,6 +23,7 @@ wp_lib_headers = [
'proxy.h'
,
'proxy-node.h'
,
'proxy-port.h'
,
'proxy-link.h'
,
'remote.h'
,
'remote-pipewire.h'
,
'wp.h'
,
...
...
This diff is collapsed.
Click to expand it.
lib/wp/proxy-link.c
0 → 100644
+
125
−
0
View file @
12310019
/* WirePlumber
*
* Copyright © 2019 Collabora Ltd.
* @author Julian Bouzas <julian.bouzas@collabora.com>
*
* SPDX-License-Identifier: MIT
*/
#include
"proxy-link.h"
#include
<pipewire/pipewire.h>
struct
_WpProxyLink
{
WpProxy
parent
;
/* The link proxy listener */
struct
spa_hook
listener
;
/* The link info */
struct
pw_link_info
*
info
;
};
static
GAsyncInitableIface
*
proxy_link_parent_interface
=
NULL
;
static
void
wp_proxy_link_async_initable_init
(
gpointer
iface
,
gpointer
iface_data
);
G_DEFINE_TYPE_WITH_CODE
(
WpProxyLink
,
wp_proxy_link
,
WP_TYPE_PROXY
,
G_IMPLEMENT_INTERFACE
(
G_TYPE_ASYNC_INITABLE
,
wp_proxy_link_async_initable_init
))
static
void
link_event_info
(
void
*
data
,
const
struct
pw_link_info
*
info
)
{
WpProxyLink
*
self
=
data
;
/* Update the link info */
self
->
info
=
pw_link_info_update
(
self
->
info
,
info
);
}
static
const
struct
pw_link_proxy_events
link_events
=
{
PW_VERSION_LINK_PROXY_EVENTS
,
.
info
=
link_event_info
,
};
static
void
wp_proxy_link_finalize
(
GObject
*
object
)
{
WpProxyLink
*
self
=
WP_PROXY_LINK
(
object
);
/* Clear the info */
if
(
self
->
info
)
{
pw_link_info_free
(
self
->
info
);
self
->
info
=
NULL
;
}
G_OBJECT_CLASS
(
wp_proxy_link_parent_class
)
->
finalize
(
object
);
}
static
void
wp_proxy_link_init_async
(
GAsyncInitable
*
initable
,
int
io_priority
,
GCancellable
*
cancellable
,
GAsyncReadyCallback
callback
,
gpointer
data
)
{
WpProxyLink
*
self
=
WP_PROXY_LINK
(
initable
);
WpProxy
*
wp_proxy
=
WP_PROXY
(
initable
);
struct
pw_link_proxy
*
proxy
=
NULL
;
/* Get the proxy from the base class */
proxy
=
wp_proxy_get_pw_proxy
(
wp_proxy
);
/* Add the link proxy listener */
pw_link_proxy_add_listener
(
proxy
,
&
self
->
listener
,
&
link_events
,
self
);
/* Call the parent interface */
proxy_link_parent_interface
->
init_async
(
initable
,
io_priority
,
cancellable
,
callback
,
data
);
}
static
void
wp_proxy_link_async_initable_init
(
gpointer
iface
,
gpointer
iface_data
)
{
GAsyncInitableIface
*
ai_iface
=
iface
;
/* Set the parent interface */
proxy_link_parent_interface
=
g_type_interface_peek_parent
(
iface
);
/* Only set the init_async */
ai_iface
->
init_async
=
wp_proxy_link_init_async
;
}
static
void
wp_proxy_link_init
(
WpProxyLink
*
self
)
{
}
static
void
wp_proxy_link_class_init
(
WpProxyLinkClass
*
klass
)
{
GObjectClass
*
object_class
=
(
GObjectClass
*
)
klass
;
object_class
->
finalize
=
wp_proxy_link_finalize
;
}
void
wp_proxy_link_new
(
guint
global_id
,
gpointer
proxy
,
GAsyncReadyCallback
callback
,
gpointer
user_data
)
{
g_async_initable_new_async
(
WP_TYPE_PROXY_LINK
,
G_PRIORITY_DEFAULT
,
NULL
,
callback
,
user_data
,
"global-id"
,
global_id
,
"pw-proxy"
,
proxy
,
NULL
);
}
WpProxyLink
*
wp_proxy_link_new_finish
(
GObject
*
initable
,
GAsyncResult
*
res
,
GError
**
error
)
{
GAsyncInitable
*
ai
=
G_ASYNC_INITABLE
(
initable
);
return
WP_PROXY_LINK
(
g_async_initable_new_finish
(
ai
,
res
,
error
));
}
const
struct
pw_link_info
*
wp_proxy_link_get_info
(
WpProxyLink
*
self
)
{
return
self
->
info
;
}
This diff is collapsed.
Click to expand it.
lib/wp/proxy-link.h
0 → 100644
+
29
−
0
View file @
12310019
/* WirePlumber
*
* Copyright © 2019 Collabora Ltd.
* @author Julian Bouzas <julian.bouzas@collabora.com>
*
* SPDX-License-Identifier: MIT
*/
#ifndef __WIREPLUMBER_PROXY_LINK_H__
#define __WIREPLUMBER_PROXY_LINK_H__
#include
"core.h"
#include
"proxy.h"
G_BEGIN_DECLS
#define WP_TYPE_PROXY_LINK (wp_proxy_link_get_type ())
G_DECLARE_FINAL_TYPE
(
WpProxyLink
,
wp_proxy_link
,
WP
,
PROXY_LINK
,
WpProxy
)
void
wp_proxy_link_new
(
guint
global_id
,
gpointer
proxy
,
GAsyncReadyCallback
callback
,
gpointer
user_data
);
WpProxyLink
*
wp_proxy_link_new_finish
(
GObject
*
initable
,
GAsyncResult
*
res
,
GError
**
error
);
const
struct
pw_link_info
*
wp_proxy_link_get_info
(
WpProxyLink
*
self
);
G_END_DECLS
#endif
This diff is collapsed.
Click to expand it.
lib/wp/wp.h
+
1
−
0
View file @
12310019
...
...
@@ -13,6 +13,7 @@
#include
"module.h"
#include
"policy.h"
#include
"proxy.h"
#include
"proxy-link.h"
#include
"proxy-node.h"
#include
"proxy-port.h"
#include
"remote.h"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment