Consider using unsafe C# for perf sensitive APIs
Problem to solve
Performance could likely be improved for LibVLC APIs that have callbacks interop.
To make sure of this, we first need to setup benchmarkdotnet and write some tests to have numbers. #8 Only then could we be assured that it'd provide an improvement, by comparing numbers from both implementations (and by how much).
Some perf sensitive APIs I can think of:
libvlc_audio_set_callbacks libvlc_media_new_callbacks libvlc_video_set_callbacks libvlc_video_set_format_callbacks libvlc_video_set_output_callbacks <- especially this one StreamMediaInput <- especially this one
Have a look on how to integrate the latest improvements from C# 9 and BCL. Would likely be a net5.0 target.
Samples would be a good start.