Skip to content

Commit

Permalink
Let command line util "peaq" load the plugin statically
Browse files Browse the repository at this point in the history
  • Loading branch information
mincequi authored and martinholters committed Jul 8, 2024
1 parent 7397e49 commit 97978a5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/peaq.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <glib/gprintf.h>
#include <stdlib.h>

#include <gst/gstplugin.h>

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
Expand Down Expand Up @@ -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[])
{
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 97978a5

Please sign in to comment.