mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
Added two options: --gst-plugin-spew will print errors when plugins fail to load. --gst-plugin-path= will add a dire...
Original commit message from CVS: Added two options: --gst-plugin-spew will print errors when plugins fail to load. --gst-plugin-path= will add a directory to the path searched for plugins.
This commit is contained in:
parent
bc7eb8e691
commit
35f4d52d7b
4 changed files with 29 additions and 5 deletions
17
gst/gst.c
17
gst/gst.c
|
@ -40,6 +40,7 @@ gchar *_gst_progname;
|
|||
|
||||
|
||||
extern gint _gst_trace_on;
|
||||
extern gboolean _gst_plugin_spew;
|
||||
|
||||
|
||||
static gboolean gst_init_check (int *argc, gchar ***argv);
|
||||
|
@ -128,6 +129,16 @@ gst_init_check (int *argc,
|
|||
|
||||
(*argv)[i] = NULL;
|
||||
}
|
||||
else if (!strncmp ("--gst-plugin-spew", (*argv)[i], 17)) {
|
||||
_gst_plugin_spew = TRUE;
|
||||
|
||||
(*argv)[i] = NULL;
|
||||
}
|
||||
else if (!strncmp ("--gst-plugin-path=", (*argv)[i], 17)) {
|
||||
gst_plugin_add_path ((*argv)[i]+18);
|
||||
|
||||
(*argv)[i] = NULL;
|
||||
}
|
||||
else if (!strncmp ("--help", (*argv)[i], 6)) {
|
||||
showhelp = TRUE;
|
||||
}
|
||||
|
@ -153,8 +164,10 @@ gst_init_check (int *argc,
|
|||
g_print ("usage %s [OPTION...]\n", (*argv)[0]);
|
||||
|
||||
g_print ("\nGStreamer options\n");
|
||||
g_print (" --gst-info-mask=FLAGS Gst info flags to set (current %08x)\n", gst_info_get_categories());
|
||||
g_print (" --gst-debug-mask=FLAGS Gst debugging flags to set\n");
|
||||
g_print (" --gst-info-mask=FLAGS GST info flags to set (current %08x)\n", gst_info_get_categories());
|
||||
g_print (" --gst-debug-mask=FLAGS GST debugging flags to set\n");
|
||||
g_print (" --gst-plugin-spew Enable printout of errors while loading GST plugins\n");
|
||||
g_print (" --gst-plugin-path=PATH Add a directory to the plugin search path\n");
|
||||
|
||||
g_print ("\n Mask (to be OR'ed) info/debug FLAGS \n");
|
||||
g_print ("--------------------------------------------------------\n");
|
||||
|
|
|
@ -99,6 +99,12 @@ _gst_plugin_initialize (void)
|
|||
xmlFreeDoc (doc);
|
||||
}
|
||||
|
||||
void
|
||||
gst_plugin_add_path (const gchar *path)
|
||||
{
|
||||
_gst_plugin_paths = g_list_prepend (_gst_plugin_paths,g_strdup(path));
|
||||
}
|
||||
|
||||
static time_t
|
||||
get_time(const char * path)
|
||||
{
|
||||
|
@ -214,7 +220,7 @@ gst_plugin_load_all(void)
|
|||
|
||||
path = _gst_plugin_paths;
|
||||
while (path != NULL) {
|
||||
GST_DEBUG (GST_CAT_PLUGIN_LOADING,"loading plugins from %s\n",(gchar *)path->data);
|
||||
GST_INFO (GST_CAT_PLUGIN_LOADING,"loading plugins from %s\n",(gchar *)path->data);
|
||||
gst_plugin_load_recurse(path->data,NULL);
|
||||
path = g_list_next(path);
|
||||
}
|
||||
|
@ -364,7 +370,8 @@ gst_plugin_load_absolute (const gchar *name)
|
|||
}
|
||||
return TRUE;
|
||||
} else if (_gst_plugin_spew) {
|
||||
gst_info("error loading plugin: %s, reason: %s\n", name, g_module_error());
|
||||
// FIXME this should be some standard gst mechanism!!!
|
||||
g_printerr ("error loading plugin %s, reason: %s\n", name, g_module_error());
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
|
|
@ -61,6 +61,8 @@ void _gst_plugin_initialize (void);
|
|||
|
||||
GstPlugin* gst_plugin_new (const gchar *name);
|
||||
|
||||
void gst_plugin_add_path (const gchar *path);
|
||||
|
||||
const gchar* gst_plugin_get_name (GstPlugin *plugin);
|
||||
void gst_plugin_set_name (GstPlugin *plugin, const gchar *name);
|
||||
const gchar* gst_plugin_get_longname (GstPlugin *plugin);
|
||||
|
|
|
@ -282,6 +282,7 @@ gst_thread_change_state (GstElement *element)
|
|||
|
||||
GST_FLAG_SET (thread, GST_THREAD_STATE_REAPING);
|
||||
gst_thread_signal_thread (thread);
|
||||
pthread_join(thread->thread_id,NULL);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -324,7 +325,8 @@ gst_thread_main_loop (void *arg)
|
|||
}
|
||||
|
||||
GST_FLAG_UNSET (thread, GST_THREAD_STATE_REAPING);
|
||||
//pthread_join (thread->thread_id, 0);
|
||||
// FIXME this should be removed (why's it here???)
|
||||
// //pthread_join (thread->thread_id, 0);
|
||||
|
||||
GST_INFO (GST_CAT_THREAD, "gstthread: thread \"%s\" is stopped",
|
||||
GST_ELEMENT_NAME (thread));
|
||||
|
|
Loading…
Reference in a new issue