Skip to content

Avalonia rendering crashes #19

@Symbai

Description

@Symbai

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions