LibVLC.AutoGen
2.0.0
dotnet add package LibVLC.AutoGen --version 2.0.0
NuGet\Install-Package LibVLC.AutoGen -Version 2.0.0
<PackageReference Include="LibVLC.AutoGen" Version="2.0.0" />
<PackageVersion Include="LibVLC.AutoGen" Version="2.0.0" />
<PackageReference Include="LibVLC.AutoGen" />
paket add LibVLC.AutoGen --version 2.0.0
#r "nuget: LibVLC.AutoGen, 2.0.0"
#:package LibVLC.AutoGen@2.0.0
#addin nuget:?package=LibVLC.AutoGen&version=2.0.0
#tool nuget:?package=LibVLC.AutoGen&version=2.0.0
LibVLC.AutoGen
!!!!! This is NOT an official libVLC project !!!!!
P/Invoke bindings auto-generated from libvlc headers using ClangSharpPInvokeGenerator and Custom Source Generator.
Quick start
dotnet add package LibVLC.AutoGen
using LibVLCSharp.AutoGen;
using static LibVLCSharp.AutoGen.Interop.libvlc;
using static LibVLCSharp.AutoGen.LibVLC;
internal class Program
{
static unsafe void Main(string[] args)
{
var psz_version = (IntPtr)libvlc_get_version(); // LibVLCSharp.AutoGen.Interop, snake_case
var version1 = psz_version.GetString(); // to utf8 string
var version2 = VlcGetVersion(); // LibVLCSharp.AutoGen, PascalCase
}
}
List
LibVLC.AutoGenis a standard wrapper using[DllImport("libvlc")].LibVLC.AutoGen.Staticusing[DllImport("__Internal")]for static linked libvlc.LibVLC.AutoGen.Dynamicfor runtime loaded libvlc, requires manualInitialize.
Notes
- no
libvlc_printerr, C# has poor compatibility with C variadic arguments. - no
libvlc_role_Last, It is equivalent tolibvlc_role_Test.
What it does?
Via GitHub Action: pull the latest VLC code daily at midnight.
- Check if there are any updates in the
vlc/include/vlcdirectory. - If updates are detected, automatically bump the version number of the current project, create a Git tag, and push it to the remote repository.
Pushing a tag will trigger an automated build process:
- Execute generate.ps1, which uses
ClangSharpPInvokeGeneratorwith the configuration file "@generate.rsp" to automatically generateLibVLC.Interop.cs. - When building the LibVLC.AutoGen project, LibVLC.SourceGenerator runs during the pre-compilation phase to auto-generate a renamed version:
LibVLC.Interop.g.cs, based onLibVLC.Interop.cs. - When building the LibVLC.AutoGen.Dynamic/Static projects, LazyImport.Fody is additionally integrated to modify the assemblies post-compilation, converting methods marked with DllImport into runtime-loaded implementations.
The final compiled assemblies contain two namespaces:
LibVLC.Interop.csuses theLibVLCSharp.AutoGen.Interopnamespace and follows the snake_case naming convention consistent with the C header files, similar to theFFmpeg.AutoGenproject, enabling direct usage of the libvlc C code.LibVLC.Interop.g.csuses theLibVLCSharp.AutoGennamespace and follows C#'s default PascalCase naming convention, similar to theLibVLCSharpproject.
Why this project?
This project started because I needed to use libvlc_video_set_output_callbacks, the new video rendering API from LibVLC 4.0.0.
I believe it provides a cleaner solution to airspace issues in WPF and other UI frameworks.
While LibVLCSharp is very well-designed, the v4 prerelease is not yet officially stable, and its interop layer is not fully automated.
For that reason, I created this fresh project:
It uses GitHub Actions + ClangSharpPInvokeGenerator + Custom Source Generator to automatically generate up-to-date P/Invoke bindings for VLC.
Feedback and contributions are welcome!
TODO
Create a new VLC media control using the video rendering API libvlc_video_set_output_callbacks.
Reference & Thanks
License
This project is licensed under the MIT License.
But the LibVLC is licensed under the GNU LGPLv2.1 License, use and distribution must comply with the LGPL.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.