Commit a927af51 authored by Jérémy VIGNELLES's avatar Jérémy VIGNELLES Committed by Martin Finkel

Add GTK# support

This commit contains a LibVLCSharp integration with GTK with optional
Xamarin.Forms support. It works on Linux and Windows only
(see https://github.com/mono/gtk-sharp/issues/257 as to why).

(cherry picked from commit baf5d7c0bf505f3b797fc13f6a08e575db833add)
parent c954cad1
......@@ -6,7 +6,10 @@
<DefineConstants>$(DefineConstants);NETSTANDARD1_1;NETSTANDARD</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net40'">
<DefineConstants>$(DefineConstants);NET40</DefineConstants>
<DefineConstants>$(DefineConstants);NET40;NET</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net471'">
<DefineConstants>$(DefineConstants);NET471;NET</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.StartsWith('Xamarin.iOS'))">
<DefineConstants>$(DefineConstants);MONO;IOS;COCOA</DefineConstants>
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Title>LibVLCSharp.Forms.GTK</Title>
<Summary>GTK integration for LibVLCSharp.Forms</Summary>
<Description>LibVLCSharp is a cross-platform audio and video API for .NET platforms based on VideoLAN's LibVLC Library.
It provides a comprehensive multimedia API that can be used across mobile, server and desktop to render video and output audio. Mono, .NET Framework and .NET Core runtimes are supported.
Supported platforms:
- Xamarin.Android
- Xamarin.iOS
- Xamarin.Mac
- Windows (WPF/WinForms)
- Xamarin.Forms
- .NET Standard 1.1
- .NET Core
Features:
- Network browsing for distant filesystems (SMB, FTP, SFTP, NFS...).
- HDMI passthrough for Audio HD codecs, like E-AC3, TrueHD or DTS-HD.
- Stream to distant renderers, like Chromecast.
- 360 video and 3D audio playback with viewpoint change.
- Support for Ambisonics audio and more than 8 audio channels.
- Subtitles size modification live.
- Hardware decoding and display on all platforms.
- DVD playback and menu navigation.
</Description>
<TargetFramework>net47</TargetFramework>
<RootNamespace>LibVLCSharp.Forms.GTK</RootNamespace>
<PackageVersion>0.0.1</PackageVersion>
<PackageId>LibVLCSharp.Forms.GTK</PackageId>
<Authors>VideoLAN</Authors>
<Owners>VideoLAN</Owners>
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
<GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>
<PackageLicenseExpression>LGPL-2.1-or-later</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://code.videolan.org/videolan/LibVLCSharp</RepositoryUrl>
<PackageIconUrl>https://code.videolan.org/videolan/LibVLCSharp/raw/master/Assets/icon.png</PackageIconUrl>
<PackageReleaseNotes>https://code.videolan.org/videolan/LibVLCSharp/blob/master/NEWS</PackageReleaseNotes>
<PackageTags>libvlc;vlc;videolan;native;c/c++;video;audio;player;media;mediaplayer;codec;ffmpeg;xamarin;graphics;ios;android;linux;windows;macos;cross-platform</PackageTags>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms.Platform.GTK" Version="3.2.0.871581" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LibVLCSharp.Forms\LibVLCSharp.Forms.csproj" />
<ProjectReference Include="..\LibVLCSharp.GTK\LibVLCSharp.GTK.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="gdk-sharp">
<HintPath Condition="$([MSBuild]::IsOsPlatform('Windows'))">C:\Program Files (x86)\GtkSharp\2.12\lib\gtk-sharp-2.0\gdk-sharp.dll</HintPath>
<HintPath Condition="$([MSBuild]::IsOsPlatform('Linux'))">/usr/lib/cli/gdk-sharp-2.0/gdk-sharp.dll</HintPath>
<HintPath Condition="$([MSBuild]::IsOsPlatform('OSX'))">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/gtk-sharp-2.0/gdk-sharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="glib-sharp">
<Private>False</Private>
<HintPath Condition="$([MSBuild]::IsOsPlatform('Windows'))">C:\Program Files (x86)\GtkSharp\2.12\lib\gtk-sharp-2.0\glib-sharp.dll</HintPath>
<HintPath Condition="$([MSBuild]::IsOsPlatform('Linux'))">/usr/lib/cli/glib-sharp-2.0/glib-sharp.dll</HintPath>
<HintPath Condition="$([MSBuild]::IsOsPlatform('OSX'))">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/gtk-sharp-2.0/glib-sharp.dll</HintPath>
</Reference>
<Reference Include="gtk-sharp">
<Private>False</Private>
<HintPath Condition="$([MSBuild]::IsOsPlatform('Windows'))">C:\Program Files (x86)\GtkSharp\2.12\lib\gtk-sharp-2.0\gtk-sharp.dll</HintPath>
<HintPath Condition="$([MSBuild]::IsOsPlatform('Linux'))">/usr/lib/cli/gtk-sharp-2.0/gtk-sharp.dll</HintPath>
<HintPath Condition="$([MSBuild]::IsOsPlatform('OSX'))">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/gtk-sharp-2.0/gtk-sharp.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
\ No newline at end of file
using LibVLCSharp.Forms.Platforms.GTK;
using LibVLCSharp.Forms.Shared;
using LibVLCSharp.Shared;
using Xamarin.Forms;
using Xamarin.Forms.Platform.GTK;
[assembly: ExportRenderer(typeof(LibVLCSharp.Forms.Shared.VideoView), typeof(VideoViewRenderer))]
namespace LibVLCSharp.Forms.Platforms.GTK
{
public class VideoViewRenderer : ViewRenderer<LibVLCSharp.Forms.Shared.VideoView, LibVLCSharp.GTK.VideoView>
{
LibVLCSharp.GTK.VideoView _videoView;
protected override void OnElementChanged(ElementChangedEventArgs<VideoView> e)
{
base.OnElementChanged(e);
if (Control == null)
{
_videoView = new LibVLCSharp.GTK.VideoView();
SetNativeControl(_videoView);
}
if (e.OldElement != null)
{
e.OldElement.MediaPlayerChanged -= OnMediaPlayerChanged;
}
if (e.NewElement != null)
{
e.NewElement.MediaPlayerChanged += OnMediaPlayerChanged;
}
}
private void OnMediaPlayerChanged(object sender, MediaPlayerChangedEventArgs e)
{
if (Control == null)
{
return;
}
Control.MediaPlayer = e.NewMediaPlayer;
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
_videoView?.Dispose();
}
}
}
\ No newline at end of file
......@@ -24,8 +24,9 @@ Features:
- Subtitles size modification live.
- Hardware decoding and display on all platforms.
- DVD playback and menu navigation.
</Description>
<TargetFrameworks>netstandard2.0;MonoAndroid81;Xamarin.iOS10;Xamarin.Mac20</TargetFrameworks>
</Description>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="!$([MSBuild]::IsOsPlatform('Linux'))">$(TargetFrameworks);MonoAndroid81;Xamarin.iOS10;Xamarin.Mac20</TargetFrameworks>
<RootNamespace>LibVLCSharp.Forms</RootNamespace>
<NeutralLanguage>en</NeutralLanguage>
<LangVersion>7.3</LangVersion>
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Title>LibVLCSharp.GTK</Title>
<Summary>GTK integration for LibVLCSharp</Summary>
<Description>LibVLCSharp is a cross-platform audio and video API for .NET platforms based on VideoLAN's LibVLC Library.
It provides a comprehensive multimedia API that can be used across mobile, server and desktop to render video and output audio. Mono, .NET Framework and .NET Core runtimes are supported.
Supported platforms:
- Xamarin.Android
- Xamarin.iOS
- Xamarin.Mac
- Windows (WPF/WinForms)
- Xamarin.Forms
- .NET Standard 1.1
- .NET Core
Features:
- Network browsing for distant filesystems (SMB, FTP, SFTP, NFS...).
- HDMI passthrough for Audio HD codecs, like E-AC3, TrueHD or DTS-HD.
- Stream to distant renderers, like Chromecast.
- 360 video and 3D audio playback with viewpoint change.
- Support for Ambisonics audio and more than 8 audio channels.
- Subtitles size modification live.
- Hardware decoding and display on all platforms.
- DVD playback and menu navigation.
</Description>
<TargetFramework>net47</TargetFramework>
<RootNamespace>LibVLCSharp.GTK</RootNamespace>
<Version>0.0.1</Version>
<PackageId>LibVLCSharp.GTK</PackageId>
<Authors>VideoLAN</Authors>
<Owners>VideoLAN</Owners>
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
<GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>
<UseFullSemVerForNuGet>false</UseFullSemVerForNuGet>
<PackageLicenseExpression>LGPL-2.1-or-later</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://code.videolan.org/videolan/LibVLCSharp</RepositoryUrl>
<PackageIconUrl>https://code.videolan.org/videolan/LibVLCSharp/raw/master/Assets/icon.png</PackageIconUrl>
<PackageReleaseNotes>https://code.videolan.org/videolan/LibVLCSharp/blob/master/NEWS</PackageReleaseNotes>
<PackageTags>libvlc;vlc;videolan;native;c/c++;video;audio;player;media;mediaplayer;codec;ffmpeg;xamarin;graphics;ios;android;linux;windows;macos;cross-platform</PackageTags>
</PropertyGroup>
<ItemGroup>
<Reference Include="gdk-sharp">
<HintPath Condition="$([MSBuild]::IsOsPlatform('Windows'))">C:\Program Files (x86)\GtkSharp\2.12\lib\gtk-sharp-2.0\gdk-sharp.dll</HintPath>
<HintPath Condition="$([MSBuild]::IsOsPlatform('Linux'))">/usr/lib/cli/gdk-sharp-2.0/gdk-sharp.dll</HintPath>
<HintPath Condition="$([MSBuild]::IsOsPlatform('OSX'))">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/gtk-sharp-2.0/gdk-sharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="glib-sharp">
<Private>False</Private>
<HintPath Condition="$([MSBuild]::IsOsPlatform('Windows'))">C:\Program Files (x86)\GtkSharp\2.12\lib\gtk-sharp-2.0\glib-sharp.dll</HintPath>
<HintPath Condition="$([MSBuild]::IsOsPlatform('Linux'))">/usr/lib/cli/glib-sharp-2.0/glib-sharp.dll</HintPath>
<HintPath Condition="$([MSBuild]::IsOsPlatform('OSX'))">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/gtk-sharp-2.0/glib-sharp.dll</HintPath>
</Reference>
<Reference Include="gtk-sharp">
<Private>False</Private>
<HintPath Condition="$([MSBuild]::IsOsPlatform('Windows'))">C:\Program Files (x86)\GtkSharp\2.12\lib\gtk-sharp-2.0\gtk-sharp.dll</HintPath>
<HintPath Condition="$([MSBuild]::IsOsPlatform('Linux'))">/usr/lib/cli/gtk-sharp-2.0/gtk-sharp.dll</HintPath>
<HintPath Condition="$([MSBuild]::IsOsPlatform('OSX'))">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/gtk-sharp-2.0/gtk-sharp.dll</HintPath>
</Reference>
<ProjectReference Include="..\LibVLCSharp\LibVLCSharp.csproj" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
</ItemGroup>
</Project>
\ No newline at end of file
using System;
using System.Runtime.InteropServices;
using Gdk;
using Gtk;
using LibVLCSharp.Shared;
namespace LibVLCSharp.GTK
{
/// <summary>
/// GTK VideoView for Windows, Linux and Mac.
/// Mac is currently unsupported (see https://github.com/mono/gtk-sharp/issues/257)
/// </summary>
public class VideoView : DrawingArea, IVideoView
{
struct Native
{
/// <summary>
/// Gets the window's HWND
/// </summary>
/// <remarks>Window only</remarks>
/// <param name="gdkWindow">The pointer to the GdkWindow object</param>
/// <returns>The window's HWND</returns>
[DllImport("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr gdk_win32_drawable_get_handle(IntPtr gdkWindow);
/// <summary>
/// Gets the window's XID
/// </summary>
/// <remarks>Linux X11 only</remarks>
/// <param name="gdkWindow">The pointer to the GdkWindow object</param>
/// <returns>The window's XID</returns>
[DllImport("libgdk-x11-2.0.so.0", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint gdk_x11_drawable_get_xid(IntPtr gdkWindow);
/// <summary>
/// Gets the nsview's handle
/// </summary>
/// <remarks>Mac only</remarks>
/// <param name="gdkWindow">The pointer to the GdkWindow object</param>
/// <returns>The nsview's handle</returns>
[DllImport("libgdk-quartz-2.0.0.dylib")]
internal static extern IntPtr gdk_quartz_window_get_nsview(IntPtr gdkWindow);
}
private MediaPlayer _mediaPlayer;
public VideoView()
{
Color black = Color.Zero;
Color.Parse("black", ref black);
ModifyBg(StateType.Normal, black);
Realized += (s, e) => Attach();
}
public MediaPlayer MediaPlayer
{
get
{
return _mediaPlayer;
}
set
{
if (ReferenceEquals(_mediaPlayer, value))
{
return;
}
Detach();
_mediaPlayer = value;
Attach();
}
}
void Attach()
{
if (!IsRealized || _mediaPlayer == null)
{
return;
}
if (PlatformHelper.IsWindows)
{
MediaPlayer.Hwnd = Native.gdk_win32_drawable_get_handle(GdkWindow.Handle);
}
else if (PlatformHelper.IsLinux)
{
MediaPlayer.XWindow = Native.gdk_x11_drawable_get_xid(GdkWindow.Handle);
}
else if (PlatformHelper.IsMac)
{
MediaPlayer.NsObject = Native.gdk_quartz_window_get_nsview(GdkWindow.Handle);
}
else
{
throw new PlatformNotSupportedException();
}
}
void Detach()
{
if (!IsRealized || _mediaPlayer == null)
{
return;
}
if (PlatformHelper.IsWindows)
{
MediaPlayer.Hwnd = IntPtr.Zero;
}
else if (PlatformHelper.IsLinux)
{
MediaPlayer.XWindow = 0;
}
else if (PlatformHelper.IsMac)
{
MediaPlayer.NsObject = IntPtr.Zero;
}
else
{
throw new PlatformNotSupportedException();
}
}
public override void Dispose()
{
Detach();
base.Dispose();
}
}
}
......@@ -50,6 +50,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibVLCSharp.WPF", "LibVLCSh
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "LibVLCSharp.VB.Sample", "Samples\LibVLCSharp.VB.Sample\LibVLCSharp.VB.Sample.vbproj", "{7022409B-0FE6-470F-9781-211DCA0E87D7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibVLCSharp.Forms.Platforms.GTK", "LibVLCSharp.Forms.Platforms.GTK\LibVLCSharp.Forms.Platforms.GTK.csproj", "{3F958392-C1A0-407C-AC76-0926F8D0BCCA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibVLCSharp.GTK.Sample", "Samples\LibVLCSharp.GTK.Sample\LibVLCSharp.GTK.Sample.csproj", "{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibVLCSharp.GTK", "LibVLCSharp.GTK\LibVLCSharp.GTK.csproj", "{9012B90D-A997-4E1B-B541-C824E4E6540F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.Forms.Sample.GTK", "Samples\Forms\LibVLCSharp.Forms.Sample.GTK\LibVLCSharp.Forms.Sample.GTK.csproj", "{FBBF3364-2581-48FD-A6F8-68319640E785}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
......@@ -848,6 +856,166 @@ Global
{7022409B-0FE6-470F-9781-211DCA0E87D7}.Release|x64.Build.0 = Release|Any CPU
{7022409B-0FE6-470F-9781-211DCA0E87D7}.Release|x86.ActiveCfg = Release|Any CPU
{7022409B-0FE6-470F-9781-211DCA0E87D7}.Release|x86.Build.0 = Release|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.AppStore|iPhone.Build.0 = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.AppStore|x64.ActiveCfg = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.AppStore|x64.Build.0 = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.AppStore|x86.ActiveCfg = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.AppStore|x86.Build.0 = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Debug|iPhone.Build.0 = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Debug|x64.ActiveCfg = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Debug|x64.Build.0 = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Debug|x86.ActiveCfg = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Debug|x86.Build.0 = Debug|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Release|Any CPU.Build.0 = Release|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Release|iPhone.ActiveCfg = Release|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Release|iPhone.Build.0 = Release|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Release|x64.ActiveCfg = Release|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Release|x64.Build.0 = Release|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Release|x86.ActiveCfg = Release|Any CPU
{3F958392-C1A0-407C-AC76-0926F8D0BCCA}.Release|x86.Build.0 = Release|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.AppStore|iPhone.Build.0 = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.AppStore|x64.ActiveCfg = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.AppStore|x64.Build.0 = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.AppStore|x86.ActiveCfg = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.AppStore|x86.Build.0 = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Debug|iPhone.Build.0 = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Debug|x64.ActiveCfg = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Debug|x64.Build.0 = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Debug|x86.ActiveCfg = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Debug|x86.Build.0 = Debug|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Release|Any CPU.Build.0 = Release|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Release|iPhone.ActiveCfg = Release|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Release|iPhone.Build.0 = Release|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Release|x64.ActiveCfg = Release|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Release|x64.Build.0 = Release|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Release|x86.ActiveCfg = Release|Any CPU
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E}.Release|x86.Build.0 = Release|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.AppStore|iPhone.Build.0 = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.AppStore|x64.ActiveCfg = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.AppStore|x64.Build.0 = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.AppStore|x86.ActiveCfg = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.AppStore|x86.Build.0 = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Debug|iPhone.Build.0 = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Debug|x64.ActiveCfg = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Debug|x64.Build.0 = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Debug|x86.ActiveCfg = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Debug|x86.Build.0 = Debug|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Release|Any CPU.Build.0 = Release|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Release|iPhone.ActiveCfg = Release|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Release|iPhone.Build.0 = Release|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Release|x64.ActiveCfg = Release|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Release|x64.Build.0 = Release|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Release|x86.ActiveCfg = Release|Any CPU
{9012B90D-A997-4E1B-B541-C824E4E6540F}.Release|x86.Build.0 = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.AppStore|Any CPU.Build.0 = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.AppStore|iPhone.ActiveCfg = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.AppStore|iPhone.Build.0 = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.AppStore|x64.ActiveCfg = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.AppStore|x64.Build.0 = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.AppStore|x86.ActiveCfg = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.AppStore|x86.Build.0 = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Debug|iPhone.Build.0 = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Debug|x64.ActiveCfg = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Debug|x64.Build.0 = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Debug|x86.ActiveCfg = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Debug|x86.Build.0 = Debug|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Release|Any CPU.Build.0 = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Release|iPhone.ActiveCfg = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Release|iPhone.Build.0 = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Release|x64.ActiveCfg = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Release|x64.Build.0 = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Release|x86.ActiveCfg = Release|Any CPU
{FBBF3364-2581-48FD-A6F8-68319640E785}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -867,6 +1035,8 @@ Global
{8771EDCF-0DA5-4AF8-80CE-5D3DC4999C7B} = {FC68D8B7-758E-4164-945B-9F922FA883F6}
{256C7141-442B-43DC-9321-0BCFE81E2421} = {FC68D8B7-758E-4164-945B-9F922FA883F6}
{7022409B-0FE6-470F-9781-211DCA0E87D7} = {799A84A2-2161-4676-878B-5610E3586137}
{94DF9F22-6E0B-4774-9B13-CABC3D3A2E3E} = {799A84A2-2161-4676-878B-5610E3586137}
{FBBF3364-2581-48FD-A6F8-68319640E785} = {FC68D8B7-758E-4164-945B-9F922FA883F6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AB1424F9-871B-444A-9278-18227672889C}
......
......@@ -25,8 +25,10 @@ Features:
- Hardware decoding and display on all platforms.
- DVD playback and menu navigation.
</Description>
<TargetFrameworks>netstandard2.0;netstandard1.1;MonoAndroid81;Xamarin.iOS10;Xamarin.Mac20;net40</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard1.1;net40;net471</TargetFrameworks>
<TargetFrameworks Condition="!$([MSBuild]::IsOsPlatform('Linux'))">$(TargetFrameworks);MonoAndroid81;Xamarin.iOS10;Xamarin.Mac20</TargetFrameworks>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);IncludeAWindow</TargetsForTfmSpecificBuildOutput>
<RootNamespace>LibVLCSharp</RootNamespace>
<NeutralLanguage>en</NeutralLanguage>
<LangVersion>7.3</LangVersion>
......
......@@ -24,6 +24,14 @@ namespace LibVLCSharp.Shared
[DllImport(Constants.LibraryName, EntryPoint = "JNI_OnLoad")]
internal static extern int JniOnLoad(IntPtr javaVm, IntPtr reserved = default(IntPtr));
#endif
/// <summary>
/// Initializes the X threading system
/// </summary>
/// <remarks>Linux X11 only</remarks>
/// <returns>non-zero on success, zero on failure</returns>
[DllImport(Constants.libX11, CallingConvention = CallingConvention.Cdecl)]
internal static extern int XInitThreads();
}
static IntPtr _libvlccoreHandle;
......@@ -69,9 +77,9 @@ namespace LibVLCSharp.Shared
#endif
}
if (IsWindows)
if (PlatformHelper.IsWindows)
{
var arch = IsX64BitProcess ? ArchitectureNames.Win64 : ArchitectureNames.Win86;
var arch = PlatformHelper.IsX64BitProcess ? ArchitectureNames.Win64 : ArchitectureNames.Win86;
var librariesFolder = Path.Combine(appExecutionDirectory, Constants.LibrariesRepositoryFolderName, arch);
......@@ -89,7 +97,7 @@ namespace LibVLCSharp.Shared
throw new VLCException($"Failed to load required native library {Constants.LibraryName}.dll");
}
}
else if (IsMac)
else if (PlatformHelper.IsMac)
{
_libvlcHandle = PreloadNativeLibrary(appExecutionDirectory, $"{Constants.LibraryName}.dylib");
if (_libvlcHandle == IntPtr.Zero)
......@@ -97,6 +105,16 @@ namespace LibVLCSharp.Shared
throw new VLCException($"Failed to load required native library {Constants.LibraryName}.dylib");
}
}
else if (PlatformHelper.IsLinux)
{
// Initializes X threads before calling VLC. This is required for vlc plugins like the VDPAU hardware acceleration plugin.
if (Native.XInitThreads() == 0)
{
#if !NETSTANDARD1_1
Trace.WriteLine("XInitThreads failed");
#endif
}
}
}
//TODO: Add dlopen for UWP, Linux
......@@ -112,28 +130,8 @@ namespace LibVLCSharp.Shared
return IntPtr.Zero;
}
#endif
return IsMac ? Native.dlopen(libraryPath) : Native.LoadLibrary(libraryPath);
}
static bool IsWindows
{
#if NET40
get => Environment.OSVersion.Platform == PlatformID.Win32NT;
#else
get => RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
#endif
return PlatformHelper.IsMac ? Native.dlopen(libraryPath) : Native.LoadLibrary(libraryPath);
}
static bool IsMac
{
#if NET40
get => (int)Environment.OSVersion.Platform == 6;
#else
get => RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
#endif
}
static bool IsX64BitProcess => IntPtr.Size == 8;
}
internal static class Constants
......@@ -160,6 +158,7 @@ namespace LibVLCSharp.Shared
internal const string Libc = "libc";
internal const string libSystem = "libSystem";
internal const string Kernel32 = "kernel32";
internal const string libX11 = "libX11";
}
internal static class ArchitectureNames
......
......@@ -60,12 +60,11 @@ namespace LibVLCSharp.Shared
EntryPoint = "libvlc_media_player_pause")]
internal static extern void LibVLCMediaPlayerPause(IntPtr mediaPlayer);
[DllImport(Constants.LibraryName, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_media_player_stop")]
internal static extern void LibVLCMediaPlayerStop(IntPtr mediaPlayer);
#if COCOA || NET40
#if COCOA || NET || NETSTANDARD
[DllImport(Constants.LibraryName, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_media_player_set_nsobject")]
internal static extern void LibVLCMediaPlayerSetNsobject(IntPtr mediaPlayer, IntPtr drawable);
......@@ -74,7 +73,7 @@ namespace LibVLCSharp.Shared
EntryPoint = "libvlc_media_player_get_nsobject")]
internal static extern IntPtr LibVLCMediaPlayerGetNsobject(IntPtr mediaPlayer);
#endif
#if NET || NETSTANDARD
[DllImport(Constants.LibraryName, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_media_player_set_xwindow")]
internal static extern void LibVLCMediaPlayerSetXwindow(IntPtr mediaPlayer, uint drawable);
......@@ -83,7 +82,6 @@ namespace LibVLCSharp.Shared
EntryPoint = "libvlc_media_player_get_xwindow")]
internal static extern uint LibVLCMediaPlayerGetXwindow(IntPtr mediaPlayer);
#if NETSTANDARD || NET40
[DllImport(Constants.LibraryName, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_media_player_set_hwnd")]
internal static extern void LibVLCMediaPlayerSetHwnd(IntPtr mediaPlayer, IntPtr drawable);
......@@ -92,12 +90,10 @@ namespace LibVLCSharp.Shared
EntryPoint = "libvlc_media_player_get_hwnd")]
internal static extern IntPtr LibVLCMediaPlayerGetHwnd(IntPtr mediaPlayer);
#endif
[DllImport(Constants.LibraryName, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_media_player_get_length")]
internal static extern long LibVLCMediaPlayerGetLength(IntPtr mediaPlayer);
[DllImport(Constants.LibraryName, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_media_player_get_time")]
internal static extern long LibVLCMediaPlayerGetTime(IntPtr mediaPlayer);
......@@ -729,7 +725,7 @@ namespace LibVLCSharp.Shared
/// </summary>
public void Stop() => Native.LibVLCMediaPlayerStop(NativeReference);
#if COCOA || NET40
#if COCOA || NET || NETSTANDARD
/// <summary>
/// Get the NSView handler previously set
/// return the NSView handler or 0 if none where set
......@@ -755,7 +751,7 @@ namespace LibVLCSharp.Shared
}
#endif
#if NETSTANDARD || NET40
#if NET || NETSTANDARD
/// <summary>
/// Set an X Window System drawable where the media player should render its video output.
/// The call takes effect when the playback starts. If it is already started, it might need to be stopped before changes apply.
......@@ -1779,7 +1775,7 @@ namespace LibVLCSharp.Shared
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void LibVLCVolumeCb(IntPtr data, float volume, [MarshalAs(UnmanagedType.I1)] bool mute);
#endregion
#endregion
/// <summary>
/// Get the Event Manager from which the media player send event.
......@@ -1797,7 +1793,7 @@ namespace LibVLCSharp.Shared
}
}
#region events
#region events
public event EventHandler<MediaPlayerMediaChangedEventArgs> MediaChanged
{
......@@ -1979,7 +1975,7 @@ namespace LibVLCSharp.Shared
remove => EventManager.DetachEvent(EventType.MediaPlayerAudioVolume, value);
}
#endregion
#endregion
protected override void Dispose(bool disposing)
{
......
using System;
using System.Runtime.InteropServices;
namespace LibVLCSharp.Shared
{
public class PlatformHelper
{
public static bool IsWindows
{
#if NET40
get => Environment.OSVersion.Platform == PlatformID.Win32NT;
#else