Does anyone know about a C# VLC 1.1 Wrapper? I've found some wrappers for older versions of VLC (haven't tried them yet), but none for the new version.
So if you know of any, please post them.
Does anyone know about a C# VLC 1.1 Wrapper? I've found some wrappers for older versions of VLC (haven't tried them yet), but none for the new version.
So if you know of any, please post them.
I'm using http://www.codeproject.com/KB/audio-video/nVLC.aspx - it's excellent and the most recent library I've found for C#.
It should be noted that although the library is listed with GPL license, its author said in comments that it uses the same license libVLC uses, which as of version 2.0 is LGPL.
libvlc.net now has support for libVLC 1.1.x. You'll have to grab the sources from the SVN repository; they haven't officially released this support yet.
I was looking for this too and I have found that most of the .NET wrappers out there either are outdated and don't work right away or have license that don't suit a proprietary software.
Said that, I started to think about building my own wrapper. Since most of the wrappers had too much code and are very confusing to understand and use, the idea of making myself the wrapper was growing. Said that, http://www.helyar.net/2009/libvlc-media-player-in-c-part-2/ is a nice place where to start making your own code.
Note that libvlc and libvlccore have changed license to LGPL. And as Jean-Baptiste Kempf said in one videolan forum thread: "You may grab the dlls (libVLC and libVLCcore) that come along with VLC installation >= 2.0.0."
Now to get it working, you have to put libvlc.dll and libvlccore.dll in the same directory as your exe file as some of the code is pointing to local dir...
To interop with one function from libvlc do the following:
Create a class that will hold the functions you'd like to interop with:
static class LibVlc
{
[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr libvlc_new(int argc, [MarshalAs(UnmanagedType.LPArray,
ArraySubType = UnmanagedType.LPStr)] string[] argv);
[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
public static extern void libvlc_release(IntPtr instance);
}
With help from vlc docs, libvlc.html">http://www.videolan.org/developers/vlc/doc/doxygen/html/group_libvlc.html, you can have only the functions you need and nothing more.
The CallingConvention = CallingConvention.Cdecl is neede for .NET 4.0+. The two above functions won't do anything interesting by themselves. They are just initialising and releasing resources needed by VLC framework.
Careful with file paths (specially when linking to the plugins folder) as they need to have "/" instead of "\" as in "C:/Program Files/..."
© 2022 - 2024 — McMap. All rights reserved.