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
19f10a81
Commit
19f10a81
authored
6 years ago
by
George Kiagiadakis
Browse files
Options
Downloads
Patches
Plain Diff
core: implement an interface to retrieve the pw_core & pw_remote
parent
4fcdb931
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/wp/core-interfaces.c
+29
-0
29 additions, 0 deletions
lib/wp/core-interfaces.c
lib/wp/core-interfaces.h
+19
-0
19 additions, 0 deletions
lib/wp/core-interfaces.h
src/core.c
+24
-1
24 additions, 1 deletion
src/core.c
with
72 additions
and
1 deletion
lib/wp/core-interfaces.c
+
29
−
0
View file @
19f10a81
...
...
@@ -10,6 +10,35 @@
#include
"plugin.h"
#include
"session.h"
/* WpPipewireObjects */
G_DEFINE_INTERFACE
(
WpPipewireObjects
,
wp_pipewire_objects
,
G_TYPE_OBJECT
)
static
void
wp_pipewire_objects_default_init
(
WpPipewireObjectsInterface
*
iface
)
{
}
struct
pw_core
*
wp_pipewire_objects_get_pw_core
(
WpPipewireObjects
*
self
)
{
WpPipewireObjectsInterface
*
iface
=
WP_PIPEWIRE_OBJECTS_GET_IFACE
(
self
);
g_return_val_if_fail
(
WP_IS_PIPEWIRE_OBJECTS
(
self
),
NULL
);
g_return_val_if_fail
(
iface
->
get_pw_core
,
NULL
);
return
iface
->
get_pw_core
(
self
);
}
struct
pw_remote
*
wp_pipewire_objects_get_pw_remote
(
WpPipewireObjects
*
self
)
{
WpPipewireObjectsInterface
*
iface
=
WP_PIPEWIRE_OBJECTS_GET_IFACE
(
self
);
g_return_val_if_fail
(
WP_IS_PIPEWIRE_OBJECTS
(
self
),
NULL
);
g_return_val_if_fail
(
iface
->
get_pw_remote
,
NULL
);
return
iface
->
get_pw_remote
(
self
);
}
/* WpPluginRegistry */
G_DEFINE_INTERFACE
(
WpPluginRegistry
,
wp_plugin_registry
,
WP_TYPE_INTERFACE_IMPL
)
...
...
This diff is collapsed.
Click to expand it.
lib/wp/core-interfaces.h
+
19
−
0
View file @
19f10a81
...
...
@@ -13,6 +13,25 @@
G_BEGIN_DECLS
/* WpPipewireObjects */
struct
pw_core
;
struct
pw_remote
;
#define WP_TYPE_PIPEWIRE_OBJECTS (wp_pipewire_objects_get_type ())
G_DECLARE_INTERFACE
(
WpPipewireObjects
,
wp_pipewire_objects
,
WP
,
PIPEWIRE_OBJECTS
,
GObject
)
struct
_WpPipewireObjectsInterface
{
GTypeInterface
parent
;
struct
pw_core
*
(
*
get_pw_core
)
(
WpPipewireObjects
*
self
);
struct
pw_remote
*
(
*
get_pw_remote
)
(
WpPipewireObjects
*
self
);
};
struct
pw_core
*
wp_pipewire_objects_get_pw_core
(
WpPipewireObjects
*
self
);
struct
pw_remote
*
wp_pipewire_objects_get_pw_remote
(
WpPipewireObjects
*
self
);
/* WpPluginRegistry */
#define WP_TYPE_PLUGIN_REGISTRY (wp_plugin_registry_get_type ())
...
...
This diff is collapsed.
Click to expand it.
src/core.c
+
24
−
1
View file @
19f10a81
...
...
@@ -36,7 +36,11 @@ struct _WpCore
GError
*
exit_error
;
};
G_DEFINE_TYPE
(
WpCore
,
wp_core
,
WP_TYPE_OBJECT
);
static
void
wp_core_pw_objects_init
(
WpPipewireObjectsInterface
*
iface
);
G_DEFINE_TYPE_WITH_CODE
(
WpCore
,
wp_core
,
WP_TYPE_OBJECT
,
G_IMPLEMENT_INTERFACE
(
WP_TYPE_PIPEWIRE_OBJECTS
,
wp_core_pw_objects_init
);
)
static
gboolean
signal_handler
(
gpointer
data
)
...
...
@@ -271,6 +275,25 @@ wp_core_class_init (WpCoreClass * klass)
object_class
->
finalize
=
wp_core_finalize
;
}
static
struct
pw_core
*
wp_core_get_pw_core
(
WpPipewireObjects
*
pwobj
)
{
return
WP_CORE
(
pwobj
)
->
core
;
}
static
struct
pw_remote
*
wp_core_get_pw_remote
(
WpPipewireObjects
*
pwobj
)
{
return
WP_CORE
(
pwobj
)
->
remote
;
}
static
void
wp_core_pw_objects_init
(
WpPipewireObjectsInterface
*
iface
)
{
iface
->
get_pw_core
=
wp_core_get_pw_core
;
iface
->
get_pw_remote
=
wp_core_get_pw_remote
;
}
WpCore
*
wp_core_get_instance
(
void
)
{
...
...
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