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
cb228637
Commit
cb228637
authored
4 years ago
by
George Kiagiadakis
Browse files
Options
Downloads
Patches
Plain Diff
wp: export functions to get the module & config dirs
parent
0d072874
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/component-loader.c
+2
-14
2 additions, 14 deletions
lib/wp/component-loader.c
lib/wp/meson.build
+1
-0
1 addition, 0 deletions
lib/wp/meson.build
lib/wp/wp.c
+24
-0
24 additions, 0 deletions
lib/wp/wp.c
lib/wp/wp.h
+6
-0
6 additions, 0 deletions
lib/wp/wp.h
with
33 additions
and
14 deletions
lib/wp/component-loader.c
+
2
−
14
View file @
cb228637
...
...
@@ -14,7 +14,7 @@
#define G_LOG_DOMAIN "wp-comp-loader"
#include
"component-loader.h"
#include
"
error
.h"
#include
"
wp
.h"
#include
"private/registry.h"
#include
<pipewire/impl.h>
...
...
@@ -33,18 +33,6 @@ wp_component_loader_class_init (WpComponentLoaderClass * klass)
{
}
static
const
gchar
*
get_module_dir
(
void
)
{
static
const
gchar
*
module_dir
=
NULL
;
if
(
!
module_dir
)
{
module_dir
=
g_getenv
(
"WIREPLUMBER_MODULE_DIR"
);
if
(
!
module_dir
)
module_dir
=
WIREPLUMBER_DEFAULT_MODULE_DIR
;
}
return
module_dir
;
}
static
gboolean
load_module
(
WpCore
*
core
,
const
gchar
*
module_name
,
GVariant
*
args
,
GError
**
error
)
...
...
@@ -53,7 +41,7 @@ load_module (WpCore * core, const gchar * module_name,
GModule
*
gmodule
;
gpointer
module_init
;
module_path
=
g_module_build_path
(
get_module_dir
(),
module_name
);
module_path
=
g_module_build_path
(
wp_
get_module_dir
(),
module_name
);
gmodule
=
g_module_open
(
module_path
,
G_MODULE_BIND_LOCAL
);
if
(
!
gmodule
)
{
g_set_error
(
error
,
WP_DOMAIN_LIBRARY
,
WP_LIBRARY_ERROR_OPERATION_FAILED
,
...
...
This diff is collapsed.
Click to expand it.
lib/wp/meson.build
+
1
−
0
View file @
cb228637
...
...
@@ -104,6 +104,7 @@ wp_lib = library('wireplumber-' + wireplumber_api_version,
'-D_GNU_SOURCE'
,
'-DG_LOG_USE_STRUCTURED'
,
'-DWIREPLUMBER_DEFAULT_MODULE_DIR="@0@"'
.
format
(
wireplumber_module_dir
),
'-DWIREPLUMBER_DEFAULT_CONFIG_DIR="@0@"'
.
format
(
wireplumber_config_dir
),
'-DBUILDING_WP'
,
],
install
:
true
,
...
...
This diff is collapsed.
Click to expand it.
lib/wp/wp.c
+
24
−
0
View file @
cb228637
...
...
@@ -78,3 +78,27 @@ wp_init (WpInitFlags flags)
g_type_ensure
(
WP_TYPE_PORT
);
g_type_ensure
(
WP_TYPE_SESSION
);
}
const
gchar
*
wp_get_module_dir
(
void
)
{
static
const
gchar
*
module_dir
=
NULL
;
if
(
!
module_dir
)
{
module_dir
=
g_getenv
(
"WIREPLUMBER_MODULE_DIR"
);
if
(
!
module_dir
)
module_dir
=
WIREPLUMBER_DEFAULT_MODULE_DIR
;
}
return
module_dir
;
}
const
gchar
*
wp_get_config_dir
(
void
)
{
static
const
gchar
*
config_dir
=
NULL
;
if
(
!
config_dir
)
{
config_dir
=
g_getenv
(
"WIREPLUMBER_CONFIG_DIR"
);
if
(
!
config_dir
)
config_dir
=
WIREPLUMBER_DEFAULT_CONFIG_DIR
;
}
return
config_dir
;
}
This diff is collapsed.
Click to expand it.
lib/wp/wp.h
+
6
−
0
View file @
cb228637
...
...
@@ -58,6 +58,12 @@ typedef enum {
WP_API
void
wp_init
(
WpInitFlags
flags
);
WP_API
const
gchar
*
wp_get_module_dir
(
void
);
WP_API
const
gchar
*
wp_get_config_dir
(
void
);
G_END_DECLS
#endif
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