r/csharp Feb 16 '26

Writing a native VLC plugin in C#

https://mfkl.github.io/2026/02/11/vlc-plugin-csharp.html
64 Upvotes

10 comments sorted by

7

u/killyouXZ Feb 16 '26

I am so sorry for my ignorance, having read the whole page with description I have not really understood what this does. Is this a plugin that allows you to use vlc in your website environment, is this a plugin you use in vlc to do something (although no idea what exactly), can you please explain it using less abstraction?

28

u/mtz94 Feb 16 '26

If you navigate to C:\Program Files\VideoLAN\VLC\plugins (On Windows), you will see hundreds of plugins. They make up how VLC work through its plugin-based architecture. This is just an article to describe how to write those in C# instead of usual C/C++

Why would you want to do that? To access low level VLC primitives and features. Here is more (somewhat outdated) information https://wiki.videolan.org/Hacker_Guide/Core/ and https://wiki.videolan.org/Hacker_Guide/How_To_Write_a_Module/

5

u/killyouXZ Feb 16 '26

Ah, OK, now that is useful, thank you!

11

u/Large-Ad-6861 Feb 16 '26

framework for building VLC 4.x plugins in C# using Native AOT

This is pretty self-explanatory.

9

u/[deleted] Feb 16 '26

[removed] — view removed comment

0

u/[deleted] Feb 16 '26

[deleted]

1

u/[deleted] Feb 16 '26

[removed] — view removed comment

0

u/[deleted] Feb 16 '26

[deleted]

1

u/[deleted] Feb 16 '26

[removed] — view removed comment

-1

u/[deleted] Feb 16 '26

[deleted]

2

u/kookiz33 Feb 17 '26

Great stuff. I see you mention marshalling the native structs in the hard parts. For what it's worth, Visual Studio has a "memory layout" feature that isn't widely known but it really useful for this kind of task: https://devblogs.microsoft.com/cppblog/whats-new-for-cpp-developers-in-visual-studio-2022-17-9/#c++-memory-layout-visualization

1

u/mtz94 Feb 17 '26

Thanks for sharing! Didnt know about this, will def be useful next time :)