Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Julian Bouzas
WirePlumber
Commits
0a690f61
Commit
0a690f61
authored
Jan 08, 2020
by
Julian Bouzas
Browse files
core: add wp_core_create_local_object API
parent
55ff0a63
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/wp/core.c
View file @
0a690f61
...
...
@@ -545,6 +545,43 @@ wp_core_get_remote_state (WpCore * self, const gchar ** error)
return
(
WpRemoteState
)
pw_remote_get_state
(
self
->
pw_remote
,
error
);
}
WpProxy
*
wp_core_create_local_object
(
WpCore
*
self
,
const
gchar
*
factory_name
,
guint32
interface_type
,
guint32
interface_version
,
WpProperties
*
properties
)
{
struct
pw_proxy
*
pw_proxy
=
NULL
;
struct
pw_factory
*
factory
=
NULL
;
gpointer
iface
=
NULL
;
g_return_val_if_fail
(
WP_IS_CORE
(
self
),
NULL
);
g_return_val_if_fail
(
self
->
pw_core
,
NULL
);
g_return_val_if_fail
(
self
->
pw_remote
,
NULL
);
factory
=
pw_core_find_factory
(
self
->
pw_core
,
factory_name
);
if
(
!
factory
)
return
NULL
;
iface
=
pw_factory_create_object
(
factory
,
NULL
,
interface_type
,
interface_version
,
properties
?
wp_properties_to_pw_properties
(
properties
)
:
NULL
,
0
);
if
(
!
iface
)
return
NULL
;
pw_proxy
=
pw_remote_export
(
self
->
pw_remote
,
interface_type
,
properties
?
wp_properties_to_pw_properties
(
properties
)
:
NULL
,
iface
,
0
);
if
(
!
pw_proxy
)
return
NULL
;
return
wp_proxy_new_wrap
(
self
,
pw_proxy
,
interface_type
,
interface_version
);
}
WpProxy
*
wp_core_create_remote_object
(
WpCore
*
self
,
const
gchar
*
factory_name
,
guint32
interface_type
,
...
...
lib/wp/core.h
View file @
0a690f61
...
...
@@ -50,6 +50,9 @@ struct pw_remote * wp_core_get_pw_remote (WpCore * self);
gboolean
wp_core_connect
(
WpCore
*
self
);
WpRemoteState
wp_core_get_remote_state
(
WpCore
*
self
,
const
gchar
**
error
);
WpProxy
*
wp_core_create_local_object
(
WpCore
*
self
,
const
gchar
*
factory_name
,
guint32
interface_type
,
guint32
interface_version
,
WpProperties
*
properties
);
WpProxy
*
wp_core_create_remote_object
(
WpCore
*
self
,
const
gchar
*
factory_name
,
guint32
interface_type
,
guint32
interface_version
,
WpProperties
*
properties
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment