Commit 64b1350c authored by Martin Finkel's avatar Martin Finkel

Build: Add unity

parent 6c02f636
......@@ -50,9 +50,8 @@ LibVLC needs to be installed separately, see VideoLAN.LibVLC.* packages.</Descri
<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>
<PropertyGroup Condition="$(UNITY_ANDROID)=='true'">
<TargetFramework>netstandard2.0</TargetFramework>
<DefineConstants>$(DefineConstants);UNITY_ANDROID</DefineConstants>
<PropertyGroup Condition="$(UNITY)=='true'">
<DefineConstants>$(DefineConstants);UNITY</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(NETSTANDARD_ONLY)=='true'">
<TargetFrameworks>netstandard2.0;netstandard1.1</TargetFrameworks>
......
......@@ -302,12 +302,12 @@ namespace LibVLCSharp.Shared
{
#if IOS
internal const string LibraryName = "@rpath/DynamicMobileVLCKit.framework/DynamicMobileVLCKit";
#elif UNITY_ANDROID
#elif UNITY
/// <summary>
/// The vlc-unity C++ plugin which handles rendering (opengl/d3d) libvlc callbacks
/// </summary>
internal const string UnityPlugin = "VlcUnityWrapper";
internal const string LibraryName = "libvlcjni";
internal const string UnityPlugin = "RenderingPlugin";
internal const string LibraryName = "libvlc";
#elif TVOS
internal const string LibraryName = "@rpath/DynamicTVVLCKit.framework/DynamicTVVLCKit";
#else
......
......@@ -598,7 +598,7 @@ namespace LibVLCSharp.Shared
internal static extern void LibVLCMediaPlayerSetAndroidContext(IntPtr mediaPlayer, IntPtr aWindow);
#endif
#if UNITY_ANDROID
#if UNITY
[DllImport(Constants.UnityPlugin)]
internal static extern IntPtr CreateAndInitMediaPlayer(IntPtr libvlc);
......@@ -622,10 +622,7 @@ namespace LibVLCSharp.Shared
/// <returns>a new media player object, or NULL on error.</returns>
public MediaPlayer(LibVLC libVLC)
: base(() =>
#if UNITY_ANDROID
/// This is a helper method to ease creating and configuring a MediaPlayer on Unity.Android.
/// By just passing it a LibVLC object, it handles JNI_OnLoad, AWindow creation for off screen HW and setting the
/// Android Context. The C# JNI bindings from Xamarin.Android (Java.Interop) differ from the Unity.Android way.
#if UNITY
Native.CreateAndInitMediaPlayer(libVLC.NativeReference),
#else
Native.LibVLCMediaPlayerNew(libVLC.NativeReference),
......@@ -635,7 +632,7 @@ namespace LibVLCSharp.Shared
_gcHandle = GCHandle.Alloc(this);
}
#if !UNITY_ANDROID
#if !UNITY
/// <summary>Create a Media Player object from a Media</summary>
/// <param name="media">
/// <para>the media. Afterwards the p_md can be safely</para>
......@@ -1780,7 +1777,7 @@ namespace LibVLCSharp.Shared
MediaConfiguration Configuration = new MediaConfiguration();
#if UNITY_ANDROID
#if UNITY
/// <summary>
/// Retrieve a video frame from the Unity plugin.
/// </summary>
......
#!/bin/bash
dotnet build ../LibVLCSharp/LibVLCSharp.csproj /p:UNITY=true -c Release -f netstandard2.0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment