mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 01:31:03 +00:00
gst-full: Register GIO modules when glib-networking is a subproject
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2653>
This commit is contained in:
parent
124f93a05d
commit
412362281f
2 changed files with 28 additions and 3 deletions
16
meson.build
16
meson.build
|
@ -205,10 +205,14 @@ foreach sp : subprojects
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
# Check if we need to also build glib-networking for TLS modules
|
# Check if we need to also build glib-networking for TLS modules
|
||||||
|
giomodules = []
|
||||||
glib_dep = dependency('glib-2.0')
|
glib_dep = dependency('glib-2.0')
|
||||||
if glib_dep.type_name() == 'internal'
|
if glib_dep.type_name() == 'internal'
|
||||||
subproject('glib-networking', required : get_option('tls'),
|
subp = subproject('glib-networking', required : get_option('tls'),
|
||||||
default_options: ['gnutls=auto', 'openssl=auto'])
|
default_options: ['gnutls=auto', 'openssl=auto'])
|
||||||
|
if subp.found()
|
||||||
|
giomodules += subp.get_variable('giomodules', [])
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
gst_plugins_doc_dep = custom_target('plugins-doc-cache',
|
gst_plugins_doc_dep = custom_target('plugins-doc-cache',
|
||||||
|
@ -322,7 +326,8 @@ if building_full
|
||||||
'-e ' + get_option('gst-full-elements'),
|
'-e ' + get_option('gst-full-elements'),
|
||||||
'-t ' + get_option('gst-full-typefind-functions'),
|
'-t ' + get_option('gst-full-typefind-functions'),
|
||||||
'-d ' + get_option('gst-full-device-providers'),
|
'-d ' + get_option('gst-full-device-providers'),
|
||||||
'-T ' + get_option('gst-full-dynamic-types')
|
'-T ' + get_option('gst-full-dynamic-types'),
|
||||||
|
'--giomodules', ';'.join(giomodules),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -385,12 +390,17 @@ if building_full
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
giomodules_deps = []
|
||||||
|
foreach module : giomodules
|
||||||
|
giomodules_deps += dependency(module)
|
||||||
|
endforeach
|
||||||
|
|
||||||
# Build both shared and static library
|
# Build both shared and static library
|
||||||
gstfull = both_libraries('gstreamer-full-1.0',
|
gstfull = both_libraries('gstreamer-full-1.0',
|
||||||
init_static_plugins_c,
|
init_static_plugins_c,
|
||||||
link_args: gstfull_link_args,
|
link_args: gstfull_link_args,
|
||||||
link_whole : exposed_libs,
|
link_whole : exposed_libs,
|
||||||
dependencies : [incdir_deps, glib_deps, all_plugins],
|
dependencies : [incdir_deps, glib_deps, all_plugins, giomodules_deps],
|
||||||
link_depends : link_deps,
|
link_depends : link_deps,
|
||||||
install : true,
|
install : true,
|
||||||
)
|
)
|
||||||
|
|
|
@ -12,6 +12,7 @@ $typefind_funcs_declaration
|
||||||
$device_providers_declaration
|
$device_providers_declaration
|
||||||
$dynamic_types_declaration
|
$dynamic_types_declaration
|
||||||
$plugins_declaration
|
$plugins_declaration
|
||||||
|
$giomodules_declaration
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_init_static_plugins (void)
|
gst_init_static_plugins (void)
|
||||||
|
@ -23,6 +24,7 @@ gst_init_static_plugins (void)
|
||||||
$device_providers_registration
|
$device_providers_registration
|
||||||
$dynamic_types_registration
|
$dynamic_types_registration
|
||||||
$plugins_registration
|
$plugins_registration
|
||||||
|
$giomodules_registration
|
||||||
|
|
||||||
g_once_init_leave (&initialization_value, 1);
|
g_once_init_leave (&initialization_value, 1);
|
||||||
}
|
}
|
||||||
|
@ -69,6 +71,8 @@ if __name__ == "__main__":
|
||||||
dest="deviceproviders", help="The list of plugin:deviceproviders")
|
dest="deviceproviders", help="The list of plugin:deviceproviders")
|
||||||
parser.add_argument('-T', '--dynamic-types', nargs='?', default='',
|
parser.add_argument('-T', '--dynamic-types', nargs='?', default='',
|
||||||
dest="dynamictypes", help="The list of plugin:dynamictypes")
|
dest="dynamictypes", help="The list of plugin:dynamictypes")
|
||||||
|
parser.add_argument('--giomodules', nargs='?', default='',
|
||||||
|
dest="giomodules", help="The list of GIO modules")
|
||||||
options = parser.parse_args()
|
options = parser.parse_args()
|
||||||
if options.output is None:
|
if options.output is None:
|
||||||
output_file = 'gstinitstaticplugins.c'
|
output_file = 'gstinitstaticplugins.c'
|
||||||
|
@ -85,6 +89,8 @@ if __name__ == "__main__":
|
||||||
dynamic_types_registration = []
|
dynamic_types_registration = []
|
||||||
plugins_declaration = []
|
plugins_declaration = []
|
||||||
plugins_registration = []
|
plugins_registration = []
|
||||||
|
giomodules_declaration = []
|
||||||
|
giomodules_registration = []
|
||||||
|
|
||||||
if ',' in options.plugins or ':' in options.plugins:
|
if ',' in options.plugins or ':' in options.plugins:
|
||||||
print("Only ';' is allowed in the list of plugins.")
|
print("Only ';' is allowed in the list of plugins.")
|
||||||
|
@ -116,6 +122,13 @@ if __name__ == "__main__":
|
||||||
plugins_registration += ['GST_PLUGIN_STATIC_REGISTER(%s);' % (plugin_name)]
|
plugins_registration += ['GST_PLUGIN_STATIC_REGISTER(%s);' % (plugin_name)]
|
||||||
plugins_declaration += ['GST_PLUGIN_STATIC_DECLARE(%s);' % (plugin_name)]
|
plugins_declaration += ['GST_PLUGIN_STATIC_DECLARE(%s);' % (plugin_name)]
|
||||||
|
|
||||||
|
giomodules = options.giomodules.split(';') if options.giomodules else []
|
||||||
|
for module_name in giomodules:
|
||||||
|
if module_name.startswith('gio'):
|
||||||
|
module_name = module_name[3:]
|
||||||
|
giomodules_declaration.append(f'extern void g_io_{module_name}_load (gpointer data);')
|
||||||
|
giomodules_registration.append(f'g_io_{module_name}_load (NULL);')
|
||||||
|
|
||||||
with open(output_file.strip(), "w") as f:
|
with open(output_file.strip(), "w") as f:
|
||||||
static_elements_plugin = ''
|
static_elements_plugin = ''
|
||||||
f.write(TEMPLATE.substitute({
|
f.write(TEMPLATE.substitute({
|
||||||
|
@ -129,4 +142,6 @@ if __name__ == "__main__":
|
||||||
'dynamic_types_registration': '\n '.join(dynamic_types_registration),
|
'dynamic_types_registration': '\n '.join(dynamic_types_registration),
|
||||||
'plugins_declaration': '\n'.join(plugins_declaration),
|
'plugins_declaration': '\n'.join(plugins_declaration),
|
||||||
'plugins_registration': '\n '.join(plugins_registration),
|
'plugins_registration': '\n '.join(plugins_registration),
|
||||||
|
'giomodules_declaration': '\n'.join(giomodules_declaration),
|
||||||
|
'giomodules_registration': '\n '.join(giomodules_registration),
|
||||||
}))
|
}))
|
||||||
|
|
Loading…
Reference in a new issue