remove allow unsafe blocks
Merged
remove allow unsafe blocks
1 unresolved thread
1 unresolved thread
- Refactor into safe interop AudioOutputDescription, AudioOutputDevice and ModuleDescription,
- Disallow unsafe code
- Move interop helpers in
Helpers
folder/namespace
Fix #32 (closed)
Merge request reports
Activity
Filter activity
/cc @jeremyVignelles r?
6 7 [StructLayout(LayoutKind.Sequential)] 8 internal struct AudioOutputDescriptionStructure 9 { 10 public IntPtr Name; 11 public IntPtr Description; 12 public IntPtr NextAudioOutputDescription; 13 } 14 7 15 /// <summary> 8 /// <para>Description for audio output. It contains</para> 9 /// <para>name, description and pointer to next record.</para> 16 /// Description for audio output. 10 17 /// </summary> 11 public unsafe partial class AudioOutputDescription : IDisposable 18 public class AudioOutputDescription changed this line in version 2 of the diff
added 10 commits
-
cabf7c3e...83fc0ec9 - 5 commits from branch
videolan:master
- 3d5e98ed - Refactor AudioOutputDescription interop
- 493ae7c8 - Refactor AudioOutputDevice and create Helpers folder
- 1ffbfe63 - Refactor ModuleDescription
- 01be5bef - Disable AllowUnsafeBlocks
- ab19c049 - Set to use C# 7.3 and use readonly structs
Toggle commit list-
cabf7c3e...83fc0ec9 - 5 commits from branch
Using
readonly struct
now.Found a marshalling issue. This unit test:
[Test] public void AudioOutputDevices() { var libVLC = new LibVLC(); var outputs = libVLC.AudioOutputs; var name = outputs.Last().Name; var audioOutputDevices = libVLC.AudioOutputDevices(name); foreach (var audioOutputDevice in audioOutputDevices) { Debug.WriteLine(audioOutputDevice.Description); Debug.WriteLine(audioOutputDevice.DeviceIdentifier); } }
Gives me
Microsoft Soundmapper wavemapper Speakers (Realtek High Definiti ($1,$64) Speakers (Realtek High Definiti ($1,$64) VZ249 (NVIDIA High Definition A ($1,$64) VZ249 (NVIDIA High Definition A ($1,$64)
added 1 commit
- 5f6cd9fa - Explicitly look for mmdevice audio output in unit test