Example 2 -> Switch from native to Avalonia and try to play a file, it simply crashes. Same for AvaloniaCustomDrawingOperation
//edit: Running in VS debug throws this exception: An unhandled exception of type 'System.ExecutionEngineException' occurred in Unknown Module.
Steps to repro:
- Download master branch code
dotnet build
dotnet run -p .\samples\LibVLCSharp.Avalonia.Sample\
- Example 2
- Switch to Avalonia rendering
- Click play or open a local video file
Issue appears to be something wrong with the callback:
|
private uint VideoFormatCallback(ref IntPtr opaque, IntPtr chroma, ref uint width, ref uint height, ref uint pitches, ref uint lines) |
|
{ |
|
_pixelFormat = PixelFormat.Bgra8888; |
|
_pixelFormatPixelSize = 4; |
|
_formatSize = new PixelSize((int)width, (int)height); |
|
|
|
ToFourCC("BGRA", chroma); |
|
//or ToFourCC("RV32", chroma); |
|
|
|
pitches = GetAlignedDimension(width * _pixelFormatPixelSize, 32); |
|
lines = GetAlignedDimension(height, 32); |
|
|
|
var size = pitches * lines; |
|
|
|
opaque = _buffer = Marshal.AllocHGlobal((int)size); |
|
return 1; |
|
} |
Example 2 -> Switch from native to
Avaloniaand try to play a file, it simply crashes. Same forAvaloniaCustomDrawingOperation//edit: Running in VS debug throws this exception:
An unhandled exception of type 'System.ExecutionEngineException' occurred in Unknown Module.Steps to repro:
dotnet builddotnet run -p .\samples\LibVLCSharp.Avalonia.Sample\Issue appears to be something wrong with the callback:
vlcsharpavalonia/src/LibVLCSharp.Avalonia/VlcVideoSourceProvider.cs
Lines 213 to 229 in 4eae8fc