Skip to content

fix:multi-plane support#418

Open
ashish-066 wants to merge 8 commits intovideolan:3.xfrom
ashish-066:fix/multi-plane-issue
Open

fix:multi-plane support#418
ashish-066 wants to merge 8 commits intovideolan:3.xfrom
ashish-066:fix/multi-plane-issue

Conversation

@ashish-066
Copy link

No description provided.

@ashish-066
Copy link
Author

@mfkl can you look into this and share your opinion?

@mfkl
Copy link
Member

mfkl commented Mar 4, 2026

it does not build

@mfkl
Copy link
Member

mfkl commented Mar 4, 2026

Multi plane access is actually already possible through the use of Unsafe.Add but we can add your approach as a clearer/convenience method. You need to update VideoFormatCallback to handle both callbacks path and then it should be fine. you could name the callback LibVLCVideoMultiPlaneFormatCb.

Copy link
Member

@mfkl mfkl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approach works, few changes to make before merging. If you want to add a test or sample showing its use, much welcome

@ashish-066 ashish-066 changed the title a minimal fix for multi-plane support fix:multi-plane support Mar 5, 2026
@ashish-066
Copy link
Author

@mfkl can you review the changes

@mfkl
Copy link
Member

mfkl commented Mar 9, 2026

did you use an AI for this?

/// </param>
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void LibVLCVideoCleanupCb(ref IntPtr opaque);
public delegate void LibVLCVideoCleanupCb(IntPtr opaque);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct fix, but API break

Copy link
Author

@ashish-066 ashish-066 Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct fix, but API break

You are right I made this change is that the native libVLC signature for the cleanup callback is void (*cleanup)(void *opaque). According to the libVLC headers, the parameter is passed as void *opaque, which maps to IntPtr in .NET rather than ref IntPtr.

https://code.videolan.org/videolan/vlc/-/blob/master/include/vlc/libvlc_media_player.h

Using ref IntPtr would correspond to void**, which doesn't match the native API.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will change it

@mfkl
Copy link
Member

mfkl commented Mar 9, 2026

did you actually test the interop works? In a sample or unit test?

@ashish-066
Copy link
Author

did you use an AI for this?

no

@ashish-066 ashish-066 force-pushed the fix/multi-plane-issue branch from 984fcc8 to 909178c Compare March 10, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants