Question about getting plugins to work.

This forum is about all development around libVLC.
dmack
New Cone
New Cone
Posts: 6
Joined: 16 May 2016 21:18

Question about getting plugins to work.

Postby dmack » 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.

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); }

dmack
New Cone
New Cone
Posts: 6
Joined: 16 May 2016 21:18

Re: Question about getting plugins to work.

Postby dmack » 19 May 2016 04:27

I guess I will stick to the library and make it instead of out of tree plugin. Darn

rhegner
Blank Cone
Blank Cone
Posts: 10
Joined: 29 Mar 2016 12:21

Re: Question about getting plugins to work.

Postby rhegner » 26 May 2016 10:54

I was able to build an out-of-tree plugin with Visual Studio 2015.
See my topic here: https://forum.videolan.org/viewtopic.php?f=32&t=132811.

dmack
New Cone
New Cone
Posts: 6
Joined: 16 May 2016 21:18

Re: Question about getting plugins to work.

Postby dmack » 28 May 2016 04:27

Oh cool it is flag _PLUGIN_

The application is already way beyond the plugin stage now. I will remember that for future reference so thank you much.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 20 guests