Skip to content

Instantly share code, notes, and snippets.

@tinyzimmer
Created January 4, 2021 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tinyzimmer/1b4d1fdc448af7e3092d1c084f494601 to your computer and use it in GitHub Desktop.
Save tinyzimmer/1b4d1fdc448af7e3092d1c084f494601 to your computer and use it in GitHub Desktop.
#include <dlfcn.h>
#include <stdio.h>
#include "gst/gst.h"
typedef GstPluginDesc * (*get_desc)();
GstPluginDesc * do_func (get_desc func) {
return func();
}
int main () {
void *plugin = dlopen("./test-plugin.so", RTLD_NOW);
get_desc func = dlsym(plugin, "gst_plugin_test_plugin_get_desc");
GstPluginDesc *desc = do_func(func);
printf("name: %s\n", desc->name);
dlclose(plugin);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment