mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
omx: Add hack to load and initialize libbcm_host.so
Needed on the Raspberry Pi. Patch based on a patch by George Kiagiadakis <george.kiagiadakis@collabora.com>
This commit is contained in:
parent
7c53535026
commit
5105daba1a
1 changed files with 30 additions and 0 deletions
30
omx/gstomx.c
30
omx/gstomx.c
|
@ -58,6 +58,36 @@ gst_omx_core_acquire (const gchar * filename)
|
|||
core->user_count = 0;
|
||||
g_hash_table_insert (core_handles, g_strdup (filename), core);
|
||||
|
||||
/* Hack for the Broadcom OpenMAX IL implementation */
|
||||
if (g_str_has_prefix (filename, "vc/lib/libopenmaxil.so")) {
|
||||
gchar *bcm_host_filename;
|
||||
gchar *bcm_host_path;
|
||||
GModule *bcm_host_module;
|
||||
void (*bcm_host_init) (void);
|
||||
|
||||
bcm_host_path = g_path_get_dirname (filename);
|
||||
bcm_host_filename =
|
||||
g_build_filename (bcm_host_path, "libbcm_host.so", NULL);
|
||||
|
||||
bcm_host_module = g_module_open (bcm_host_filename, G_MODULE_BIND_LAZY);
|
||||
|
||||
g_free (bcm_host_filename);
|
||||
g_free (bcm_host_path);
|
||||
|
||||
if (!bcm_host_module) {
|
||||
GST_ERROR ("Failed to load libbcm_host.so");
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!g_module_symbol (bcm_host_module, "bcm_host_init",
|
||||
(gpointer *) & bcm_host_init)) {
|
||||
GST_ERROR ("Failed to load symbol 'bcm_host_init' from libbcm_host.so");
|
||||
goto error;
|
||||
}
|
||||
|
||||
bcm_host_init ();
|
||||
}
|
||||
|
||||
core->module = g_module_open (filename, G_MODULE_BIND_LAZY);
|
||||
if (!core->module)
|
||||
goto load_failed;
|
||||
|
|
Loading…
Reference in a new issue