public void SetAudioChannel(VlcMediaPlayerInstance mediaPlayerInstance, int channel) { if (mediaPlayerInstance == IntPtr.Zero) { throw new ArgumentException("Media player instance is not initialized."); } GetInteropDelegate <SetAudioChannel>().Invoke(mediaPlayerInstance, channel); }
public void ToggleMute(VlcMediaPlayerInstance mediaPlayerInstance) { if (mediaPlayerInstance == IntPtr.Zero) { throw new ArgumentException("Media player instance is not initialized."); } GetInteropDelegate <ToggleMute>().Invoke(mediaPlayerInstance); }
public IntPtr GetVideoTracksDescriptions(VlcMediaPlayerInstance mediaPlayerInstance) { if (mediaPlayerInstance == IntPtr.Zero) { throw new ArgumentException("Media player instance is not initialized."); } return(GetInteropDelegate <GetVideoTracksDescriptions>().Invoke(mediaPlayerInstance)); }
public int GetAudioTrack(VlcMediaPlayerInstance mediaPlayerInstance) { if (mediaPlayerInstance == IntPtr.Zero) { throw new ArgumentException("Media player instance is not initialized."); } return(GetInteropDelegate <GetAudioTrack>().Invoke(mediaPlayerInstance)); }
public string GetVideoCropGeometry(VlcMediaPlayerInstance mediaPlayerInstance) { if (mediaPlayerInstance == IntPtr.Zero) { throw new ArgumentException("Media player instance is not initialized."); } return(Utf8InteropStringConverter.Utf8InteropToString(GetInteropDelegate <GetVideoCropGeometry>().Invoke(mediaPlayerInstance))); }
public void SetVideoLogoFile(VlcMediaPlayerInstance mediaPlayerInstance, string value) { if (mediaPlayerInstance == IntPtr.Zero) { throw new ArgumentException("Media player instance is not initialized."); } using (var valueInterop = Utf8InteropStringConverter.ToUtf8StringHandle(value)) { GetInteropDelegate <SetVideoLogoString>().Invoke(mediaPlayerInstance, VideoLogoOptions.File, valueInterop); } }
public void SetVideoDeinterlace(VlcMediaPlayerInstance mediaPlayerInstance, string deinterlaceMode) { if (mediaPlayerInstance == IntPtr.Zero) { throw new ArgumentException("Media player instance is not initialized."); } using (var deinterlaceModeInterop = Utf8InteropStringConverter.ToUtf8StringHandle(deinterlaceMode)) { GetInteropDelegate <SetVideoDeinterlace>().Invoke(mediaPlayerInstance, deinterlaceModeInterop); } }
public void TakeSnapshot(VlcMediaPlayerInstance mediaPlayerInstance, FileInfo file, uint width, uint height) { if (mediaPlayerInstance == IntPtr.Zero) { throw new ArgumentException("Media player instance is not initialized."); } if (file == null) { throw new ArgumentNullException("file"); } GetInteropDelegate <TakeSnapshot>().Invoke(mediaPlayerInstance, 0, file.FullName, width, height); }
public void SetVideoAspectRatio(VlcMediaPlayerInstance mediaPlayerInstance, string aspectRatio) { if (mediaPlayerInstance == IntPtr.Zero) { throw new ArgumentException("Media player instance is not initialized."); } using (var aspectRatioInterop = Utf8InteropStringConverter.ToUtf8StringHandle(aspectRatio)) { GetInteropDelegate <SetVideoAspectRatio>().Invoke(mediaPlayerInstance, aspectRatioInterop); } }
public void SetMediaToMediaPlayer(VlcMediaPlayerInstance mediaPlayerInstance, VlcMediaInstance mediaInstance) { if (mediaPlayerInstance == IntPtr.Zero) { throw new ArgumentException("Media player instance is not initialized."); } if (mediaInstance == IntPtr.Zero) { throw new ArgumentException("Media instance is not initialized."); } GetInteropDelegate <SetMediaToMediaPlayer>().Invoke(mediaPlayerInstance, mediaInstance); }
public void SetVideoCropGeometry(VlcMediaPlayerInstance mediaPlayerInstance, string cropGeometry) { if (mediaPlayerInstance == IntPtr.Zero) { throw new ArgumentException("Media player instance is not initialized."); } using (var cropGeometryInterop = Utf8InteropStringConverter.ToUtf8StringHandle(cropGeometry)) { GetInteropDelegate <SetVideoCropGeometry>() .Invoke(mediaPlayerInstance, cropGeometryInterop); } }
public bool IsPlaying(VlcMediaPlayerInstance mediaPlayerInstance) { if (mediaPlayerInstance == IntPtr.Zero) { return(false); } //This seems to be called multiple time //Eventually throwing an uncaught exception on close //An unhandled exception of type 'System.ArgumentException' occurred in Vlc.DotNet.Core.Interops.dll //Additional information: Media player instance is not initialized. //if (mediaPlayerInstance == IntPtr.Zero) // throw new ArgumentException("Media player instance is not initialized."); return(GetInteropDelegate <IsPlaying>().Invoke(mediaPlayerInstance) == 1); }
public void ReleaseMediaPlayer(VlcMediaPlayerInstance mediaPlayerInstance) { if (mediaPlayerInstance == IntPtr.Zero) { return; } try { GetInteropDelegate <ReleaseMediaPlayer>().Invoke(mediaPlayerInstance); } finally { mediaPlayerInstance.Pointer = IntPtr.Zero; } }