diff --git a/src/peaq.c b/src/peaq.c index acd2a37..6575ad9 100644 --- a/src/peaq.c +++ b/src/peaq.c @@ -24,6 +24,8 @@ #include #include +#include + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -81,6 +83,8 @@ static void on_pad_added(GstElement *element, GstPad *pad, gpointer data) { gst_object_unref(sinkpad); } +GST_PLUGIN_STATIC_DECLARE(peaq); + int main(int argc, char *argv[]) { @@ -152,9 +156,16 @@ main(int argc, char *argv[]) peaq = gst_element_factory_make ("peaq", "peaq"); if (!peaq) { - puts ("Error: peaq element could not be instantiated - is the plugin installed correctly?"); + puts ("Warning: peaq plugin is not installed - registering statically"); + GST_PLUGIN_STATIC_REGISTER(peaq); + } + + peaq = gst_element_factory_make ("peaq", "peaq"); + if (!peaq) { + puts ("Error: peaq element could not be instantiated"); exit (2); } + gst_object_ref_sink (peaq); g_object_set (G_OBJECT (peaq), "advanced", advanced, "console_output", FALSE, NULL);