Question about getting plugins to work.
Posted: 16 May 2016 21:36
I downloaded VLC awhile back and been using it instead of windows media player.
I started a project with VLC for testing an idea out this last week.
I followed the wiki through and build the example with VLClib in Visual Studio 15 and it works great so I decided to make a plugin instead so I can get more control over the video.
I built the example plugin put the dll in its own directory under plugins.
I ran VLC --reset-plugin-cache but it doesn't show up in the list under plugins and extensions.
How do I install this plugin?
I am lost. I can't find the information in the wiki.
Oh and here is the code.
I started a project with VLC for testing an idea out this last week.
I followed the wiki through and build the example with VLClib in Visual Studio 15 and it works great so I decided to make a plugin instead so I can get more control over the video.
I built the example plugin put the dll in its own directory under plugins.
I ran VLC --reset-plugin-cache but it doesn't show up in the list under plugins and extensions.
How do I install this plugin?
I am lost. I can't find the information in the wiki.
Oh and here is the code.
Code: Select all
/**
* @file hello.c
* @brief Hello world interface VLC module example
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#define DOMAIN "vlc-hello"
#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 */
static int Open(vlc_object_t *);
static void Close(vlc_object_t *);
/* Module descriptor */
vlc_module_begin()
set_text_domain(DOMAIN)
set_shortname(N_("Hello"))
set_description(N_("mytest2"))
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);
}