Commit 9c3c88a0 authored by Martin Finkel's avatar Martin Finkel

mediaplayer: hold callbacks

parent cb31c901
......@@ -1676,16 +1676,42 @@ namespace LibVLCSharp.Shared
LibVLCD3DUpdateOutputCb updateOutputCb, LibVLCSwapCb swapCb, LibVLCD3DStartEndRenderingCb startEndRenderingCb,
LibVLCD3DSelectPlaneCb selectPlaneCb, IntPtr opaque)
{
return Native.LibVLCVideoDirect3DSetCallbacks(NativeReference, engine,
Marshal.GetFunctionPointerForDelegate(setupCb),
Marshal.GetFunctionPointerForDelegate(cleanupCb),
Marshal.GetFunctionPointerForDelegate(resizeCb),
Marshal.GetFunctionPointerForDelegate(updateOutputCb),
Marshal.GetFunctionPointerForDelegate(swapCb),
Marshal.GetFunctionPointerForDelegate(startEndRenderingCb),
Marshal.GetFunctionPointerForDelegate(selectPlaneCb),
setup = setupCb;
cleanup = cleanupCb;
resize = resizeCb;
updateOutput = updateOutputCb;
swap = swapCb;
startEndRendering = startEndRenderingCb;
selectPlane = selectPlaneCb;
var setupPtr = setup == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(setup);
var cleanupPtr = cleanup == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(cleanup);
var resizePtr = resize == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(resize);
var updateOutputPtr = updateOutput == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(updateOutput);
var swapPtr = swap == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(swap);
var startEndRenderingPtr = startEndRendering == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(startEndRendering);
var selectPlanePtr = selectPlane == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(selectPlane);
return Native.LibVLCVideoDirect3DSetCallbacks(NativeReference,
engine,
setupPtr,
cleanupPtr,
resizePtr,
updateOutputPtr,
swapPtr,
startEndRenderingPtr,
selectPlanePtr,
opaque);
}
LibVLCD3DSetupCb setup;
LibVLCD3DCleanupCb cleanup;
LibVLCD3DResize resize;
LibVLCD3DUpdateOutputCb updateOutput;
LibVLCSwapCb swap;
LibVLCD3DStartEndRenderingCb startEndRendering;
LibVLCD3DSelectPlaneCb selectPlane;
/// <summary>Gets the media role.
/// <para/> version LibVLC 3.0.0 and later.
/// </summary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment