From 3a6df857da2a65d6ebfb4c9fc2f2b61ec4c6a9be Mon Sep 17 00:00:00 2001 From: hooke007 Date: Fri, 20 Jan 2023 15:35:59 +0000 Subject: [PATCH] relink to libmpv-2 --- src/Misc/App.cs | 2 +- src/Native/libmpv.cs | 44 ++++++++++++++--------------- src/Package/mpv.net.package.wapproj | 4 +-- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/Misc/App.cs b/src/Misc/App.cs index 8e6b07f..485ffbd 100644 --- a/src/Misc/App.cs +++ b/src/Misc/App.cs @@ -141,7 +141,7 @@ namespace mpvnet public static string Version => "Copyright (C) 2000-2022 mpv.net/mpv/mplayer\n" + $"mpv.net {Application.ProductVersion}" + GetLastWriteTime(Application.ExecutablePath) + "\n" + - $"{Core.GetPropertyString("mpv-version")}" + GetLastWriteTime(Folder.Startup + "mpv-2.dll") + "\n" + + $"{Core.GetPropertyString("mpv-version")}" + GetLastWriteTime(Folder.Startup + "libmpv-2.dll") + "\n" + $"ffmpeg {Core.GetPropertyString("ffmpeg-version")}\n" + $"MediaInfo {FileVersionInfo.GetVersionInfo(Path.Combine(Application.StartupPath, "MediaInfo.dll")).FileVersion}" + GetLastWriteTime(Path.Combine(Application.StartupPath , "MediaInfo.dll")) + "\nGPL v2 License"; diff --git a/src/Native/libmpv.cs b/src/Native/libmpv.cs index c036532..9c13a2b 100644 --- a/src/Native/libmpv.cs +++ b/src/Native/libmpv.cs @@ -5,70 +5,70 @@ using System.Text; public class libmpv { - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr mpv_create(); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr mpv_create_client(IntPtr mpvHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string command); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern mpv_error mpv_initialize(IntPtr mpvHandle); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void mpv_destroy(IntPtr mpvHandle); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern mpv_error mpv_command(IntPtr mpvHandle, IntPtr strings); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern mpv_error mpv_command_string(IntPtr mpvHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string command); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern mpv_error mpv_command_ret(IntPtr mpvHandle, IntPtr strings, IntPtr node); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void mpv_free_node_contents(IntPtr node); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr mpv_error_string(mpv_error error); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern mpv_error mpv_request_log_messages(IntPtr mpvHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string min_level); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int mpv_set_option(IntPtr mpvHandle, byte[] name, mpv_format format, ref long data); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int mpv_set_option_string(IntPtr mpvHandle, byte[] name, byte[] value); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern mpv_error mpv_get_property(IntPtr mpvHandle, byte[] name, mpv_format format, out IntPtr data); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern mpv_error mpv_get_property(IntPtr mpvHandle, byte[] name, mpv_format format, out double data); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern mpv_error mpv_set_property(IntPtr mpvHandle, byte[] name, mpv_format format, ref byte[] data); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern mpv_error mpv_set_property(IntPtr mpvHandle, byte[] name, mpv_format format, ref long data); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern mpv_error mpv_set_property(IntPtr mpvHandle, byte[] name, mpv_format format, ref double data); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern mpv_error mpv_observe_property(IntPtr mpvHandle, ulong reply_userdata, [MarshalAs(UnmanagedType.LPUTF8Str)] string name, mpv_format format); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int mpv_unobserve_property(IntPtr mpvHandle, ulong registered_reply_userdata); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void mpv_free(IntPtr data); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr mpv_wait_event(IntPtr mpvHandle, double timeout); - [DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport("libmpv-2.dll", CallingConvention = CallingConvention.Cdecl)] public static extern mpv_error mpv_request_event(IntPtr mpvHandle, mpv_event_id id, int enable); public enum mpv_error diff --git a/src/Package/mpv.net.package.wapproj b/src/Package/mpv.net.package.wapproj index 9bc3b86..4ef7cbc 100644 --- a/src/Package/mpv.net.package.wapproj +++ b/src/Package/mpv.net.package.wapproj @@ -51,8 +51,8 @@ mpv.net\Microsoft.Management.Infrastructure.dll PreserveNewest - - mpv.net\mpv-2.dll + + mpv.net\libmpv-2.dll PreserveNewest