Page 1 of 1

Out-of-tree Plugin does not show up

Posted: 03 May 2016 17:18
by rhegner
I'm absolutely new to VLC development so please forgive me any stupid questions...

I want to create my own out-of-tree VLC plugin with Visual Studio 2015 (I'm not a Linux user and building the whole source tree under Windows seems to be difficult - this is why I decided to start this way).

What I tried so far: At first it didn't compile so I had to add the following code before any VLC includes:

Code: Select all

// seems to be necessary, according to WIKI #define MODULE_STRING "MyTest_Video_Filter" // this is to get rid of the error C3861: 'poll': identifier not found #define LIBVLC_USE_PTHREAD_CANCEL // this is to get rid of various errors due to the missing ssize_t type #if defined(_MSC_VER) #include <BaseTsd.h> typedef SSIZE_T ssize_t; #endif // this is to get rid of the error C3861: 'N_': identifier not found #define N_(str) (str)
Now I can successfully build my plugin DLL.

But here's the problem:
When I copy my plugin DLL to C:\Program Files (x86)\VideoLAN\VLC\plugins\video_filter and restart VLC, my hello-world plugin does not show up in the Plugins and extensions dialog of VLC.

What do I have to do to make my plugin available to VLC? Does VLC maybe write a log where I can see which DLLs it considers as plugins and why it discards them?

Edit 1:
Ok I just found out about the naming convention. My plugin is now built as libhello_plugin.dll. But it does still not show up.

Re: Out-of-tree Plugin does not show up

Posted: 04 May 2016 08:18
by rhegner
I was missing the cflags like __PLUGIN__
Now I can see my hello-world plugin :D

Re: Out-of-tree Plugin does not show up

Posted: 12 Jun 2016 03:33
by dmack
I came back to revisit this and just can't get it working.

I don't know I have a complete program fully functional with libvlc but this plugin stuff is kicking my ass. I was considering trying out possible just a plugin to see how it would work. I renamed the plugin same as yours and using the hello example.

Exactly which directory does this go in? It own?

Maybe it is some setting in Visual Studio 15?

I'm using #define __PLUGIN__ right after #define MODULE_STRING

edit: here is my code. Maybe I am doing something wrong?

Code: Select all

// test.cpp : Defines the exported functions for the DLL application. // #include "pch.h" #include "test.h" // seems to be necessary, according to WIKI #define __PLUGIN__ #define MODULE_STRING "myplugin" // this is to get rid of the error C3861: 'poll': identifier not found #define LIBVLC_USE_PTHREAD_CANCEL // this is to get rid of various errors due to the missing ssize_t type #if defined(_MSC_VER) #include <BaseTsd.h> typedef SSIZE_T ssize_t; #endif // this is to get rid of the error C3861: 'N_': identifier not found //#define N_(str) (str) /** * @file hello.c * @brief Hello world interface VLC module example */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #define DOMAIN "myplugin" #define _(str) dgettext(DOMAIN, str) #define N_(str) (str) #include <stdlib.h> #include <malloc.h> /* VLC core API headers */ #include "..\VLC\include\vlc_common.h" #include "..\VLC\include\vlc_plugin.h" #include "..\VLC\include\vlc_interface.h" /* Forward declarations */ /* Forward declarations */ static int Open(vlc_object_t *); static void Close(vlc_object_t *); /* Module descriptor */ vlc_module_begin() set_text_domain(DOMAIN) set_description(N_("My plugin")) set_capability("interface", 0) set_callbacks(Open, Close) set_category(CAT_INTERFACE) add_string("hello-who", "world", "Target", "Whom to say hello to.", false) vlc_module_end() /* Internal state for an instance of the module */ struct intf_sys_t { char *who; }; /** * Starts our example interface. */ static int Open(vlc_object_t *obj) { intf_thread_t *intf = (intf_thread_t *)obj; /* Allocate internal state */ intf_sys_t *sys = (intf_sys_t*)malloc(sizeof(*sys)); if (unlikely(sys == NULL)) return VLC_ENOMEM; intf->p_sys = sys; /* Read settings */ char *who = var_InheritString(intf, "hello-who"); if (who == NULL) { msg_Err(intf, "Nobody to say hello to!"); goto error; } sys->who = who; msg_Info(intf, "Hello %s!", who); return VLC_SUCCESS; error: free(sys); return VLC_EGENERIC; } /** * Stops the interface. */ static void Close(vlc_object_t *obj) { intf_thread_t *intf = (intf_thread_t *)obj; intf_sys_t *sys = intf->p_sys; msg_Info(intf, "Good bye %s!"); /* Free internal state */ free(sys->who); free(sys); }