From 70ccd884310d8fdf43d015ca7590ce0b28736f76 Mon Sep 17 00:00:00 2001 From: SuRGeoNix Date: Tue, 18 Jan 2022 16:37:01 +0200 Subject: [PATCH] Updating to 3.4.7 / 1.1.20 -= Enriches FlyleafLib with Logging =- * Adds Log Support for both FlyleafLib and FFmpeg (with separate log levels for each) * Organizes the previously Master and renaming it to Engine * Allows runtime/dynamic changes to log configuration * Collects all the Global configuration to one place and allows Load/Save * Controls.WPF: Renames Buffering Tab to Player and adds the new Logging settings * Controls.WPF: Adds Read Timeout to Player Settings * AudioOnly: Prevents the initialization of VideoDecoder and Renderer * Adds a read timeout even on the demuxer (Player.VideoDemuxer.TimedOut) [Breaking/Important Changes] * New way to initialize FlyleafLib with Engine.Start * Master has been renamed to Engine * Master.RegisterFFmpeg and Master.RegisterPlugins have been removed * Master.GPUAdapters transferred to Engine.Video.GPUAdapters * Master.AudioMaster.Devices transferred to Engine.Audio.Devices * Master configuration properties transferred to Engine.Config [Start Engine Example] Engine.Start(new EngineConfig() { UIRefresh = true, // Required for Activity, BufferedDuration and Stats in combination with Config.Player.Stats = true UIRefreshInterval = 250, // How often to update the UI UICurTimePerSecond = false, // Whether to update CurTime only when it's second changed or by UIRefreshInterval HighPerformaceTimers= false, // Forces TimeBeginPeriod(1) always active //LogOutput = ":debug", //LogOutput = ":console", LogOutput = "C:\\logs\\file.log", LogLevel = LogLevel.Debug, FFmpegLogLevel = FFmpegLogLevel.Warning, PluginsPath = "C:\\SomePath\\Plugins", FFmpegPath = "C:\\SomePath\\FFmpeg", }); * FFmpegPath and PluginsPath support both relative and absolute paths and can specify the ":" prefix for any folder below the current [Solution Notes] * FFmpeg libraries for x86 platforms have been removed from the solution * FFmpeg libraries have been transferred to FFmpeg/ folder * All the global classes have been transferred to Engine/ --- {Libs/x64/FFmpeg => FFmpeg}/avcodec-58.dll | Bin {Libs/x64/FFmpeg => FFmpeg}/avdevice-58.dll | Bin {Libs/x64/FFmpeg => FFmpeg}/avformat-58.dll | Bin {Libs/x64/FFmpeg => FFmpeg}/avutil-56.dll | Bin {Libs/x64/FFmpeg => FFmpeg}/postproc-55.dll | Bin {Libs/x64/FFmpeg => FFmpeg}/swresample-3.dll | Bin {Libs/x64/FFmpeg => FFmpeg}/swscale-5.dll | Bin FlyleafLib.Controls.WPF/Flyleaf.xaml.cs | 12 +- .../FlyleafLib.Controls.WPF.csproj | 7 +- FlyleafLib.Controls.WPF/Settings.xaml | 123 ++++++++----- FlyleafLib.Plugins.BitSwarm/BitSwarm.cs | 18 +- .../OpenSubtitlesOrg.cs | 26 +-- .../SubtitlesConverter.cs | 8 +- FlyleafLib.Plugins.YoutubeDL/YoutubeDL.cs | 22 ++- FlyleafLib/Controls/WPF/VideoView.cs | 10 - FlyleafLib/{ => Engine}/Config.cs | 130 ++++++++++++- .../Engine.Audio.cs} | 32 ++-- FlyleafLib/Engine/Engine.FFmpeg.cs | 85 +++++++++ FlyleafLib/Engine/Engine.Plugins.cs | 68 +++++++ FlyleafLib/Engine/Engine.Video.cs | 60 ++++++ FlyleafLib/{Master.cs => Engine/Engine.cs} | 173 +++++++----------- FlyleafLib/{ => Engine}/Globals.cs | 0 FlyleafLib/{ => Engine}/Language.cs | 0 FlyleafLib/Engine/Logger.cs | 125 +++++++++++++ FlyleafLib/{ => Engine}/Utils.cs | 39 ++-- FlyleafLib/FlyleafLib.csproj | 49 +++-- .../MediaContext/DecoderContext.cs | 51 +++--- .../MediaFramework/MediaContext/Downloader.cs | 6 +- .../MediaDecoder/AudioDecoder.cs | 23 +-- .../MediaDecoder/DecoderBase.cs | 12 +- .../MediaDecoder/SubtitlesDecoder.cs | 16 +- .../MediaDecoder/VideoDecoder.cs | 62 +++---- .../MediaDemuxer/CustomIOContext.cs | 4 +- .../MediaFramework/MediaDemuxer/Demuxer.cs | 69 ++++--- .../MediaDemuxer/Interrupter.cs | 21 +-- .../MediaRenderer/Renderer.Static.cs | 73 ++------ .../MediaRenderer/Renderer.VideoProcessor.cs | 99 +++++----- .../MediaFramework/MediaRenderer/Renderer.cs | 34 ++-- .../MediaRenderer/RendererInfo.cs | 6 +- .../MediaFramework/MediaStream/StreamBase.cs | 2 +- .../MediaFramework/MediaStream/VideoStream.cs | 2 +- FlyleafLib/MediaFramework/RunThreadBase.cs | 36 ++-- FlyleafLib/MediaPlayer/Audio.cs | 27 +-- FlyleafLib/MediaPlayer/Player.Extra.cs | 13 +- FlyleafLib/MediaPlayer/Player.Keys.cs | 6 +- FlyleafLib/MediaPlayer/Player.Mouse.cs | 4 - FlyleafLib/MediaPlayer/Player.Open.cs | 5 +- FlyleafLib/MediaPlayer/Player.Playback.cs | 38 ++-- FlyleafLib/MediaPlayer/Player.Screamers.cs | 114 +++++++----- FlyleafLib/MediaPlayer/Player.Swap.cs | 2 + FlyleafLib/MediaPlayer/Player.cs | 56 +++--- FlyleafLib/MediaPlayer/Video.cs | 7 +- FlyleafLib/Plugins/PluginBase.cs | 5 +- FlyleafLib/Plugins/PluginHandler.cs | 65 ++----- FlyleafLib/Plugins/StreamSuggester.cs | 6 +- Libs/x86/FFmpeg/avcodec-58.dll | Bin 36237838 -> 0 bytes Libs/x86/FFmpeg/avdevice-58.dll | Bin 1676814 -> 0 bytes Libs/x86/FFmpeg/avformat-58.dll | Bin 11410958 -> 0 bytes Libs/x86/FFmpeg/avutil-56.dll | Bin 927758 -> 0 bytes Libs/x86/FFmpeg/postproc-55.dll | Bin 129038 -> 0 bytes Libs/x86/FFmpeg/swresample-3.dll | Bin 350222 -> 0 bytes Libs/x86/FFmpeg/swscale-5.dll | Bin 592398 -> 0 bytes .../FrmMain.cs | 17 +- Samples/FlyleafDownloader (WinForms)/Form1.cs | 17 +- Samples/FlyleafExtractor (WinForms)/Form1.cs | 17 +- .../MainWindow.xaml.cs | 27 ++- .../Form1.cs | 14 +- .../FlyleafPlayer (WPF Control) (WPF).csproj | 2 +- .../MainWindow.xaml.cs | 22 ++- .../Form1.cs | 14 +- .../MainWindow.xaml.cs | 13 +- Tests/PlayerDispose/FlyleafWPFControl.xaml.cs | 14 +- Tests/PlayerDispose/MainWindow.xaml.cs | 13 +- Tests/WpfNetFramework/MainWindow.xaml.cs | 14 +- 74 files changed, 1275 insertions(+), 760 deletions(-) rename {Libs/x64/FFmpeg => FFmpeg}/avcodec-58.dll (100%) rename {Libs/x64/FFmpeg => FFmpeg}/avdevice-58.dll (100%) rename {Libs/x64/FFmpeg => FFmpeg}/avformat-58.dll (100%) rename {Libs/x64/FFmpeg => FFmpeg}/avutil-56.dll (100%) rename {Libs/x64/FFmpeg => FFmpeg}/postproc-55.dll (100%) rename {Libs/x64/FFmpeg => FFmpeg}/swresample-3.dll (100%) rename {Libs/x64/FFmpeg => FFmpeg}/swscale-5.dll (100%) rename FlyleafLib/{ => Engine}/Config.cs (82%) rename FlyleafLib/{AudioMaster.cs => Engine/Engine.Audio.cs} (88%) create mode 100644 FlyleafLib/Engine/Engine.FFmpeg.cs create mode 100644 FlyleafLib/Engine/Engine.Plugins.cs create mode 100644 FlyleafLib/Engine/Engine.Video.cs rename FlyleafLib/{Master.cs => Engine/Engine.cs} (55%) rename FlyleafLib/{ => Engine}/Globals.cs (100%) rename FlyleafLib/{ => Engine}/Language.cs (100%) create mode 100644 FlyleafLib/Engine/Logger.cs rename FlyleafLib/{ => Engine}/Utils.cs (95%) delete mode 100644 Libs/x86/FFmpeg/avcodec-58.dll delete mode 100644 Libs/x86/FFmpeg/avdevice-58.dll delete mode 100644 Libs/x86/FFmpeg/avformat-58.dll delete mode 100644 Libs/x86/FFmpeg/avutil-56.dll delete mode 100644 Libs/x86/FFmpeg/postproc-55.dll delete mode 100644 Libs/x86/FFmpeg/swresample-3.dll delete mode 100644 Libs/x86/FFmpeg/swscale-5.dll diff --git a/Libs/x64/FFmpeg/avcodec-58.dll b/FFmpeg/avcodec-58.dll similarity index 100% rename from Libs/x64/FFmpeg/avcodec-58.dll rename to FFmpeg/avcodec-58.dll diff --git a/Libs/x64/FFmpeg/avdevice-58.dll b/FFmpeg/avdevice-58.dll similarity index 100% rename from Libs/x64/FFmpeg/avdevice-58.dll rename to FFmpeg/avdevice-58.dll diff --git a/Libs/x64/FFmpeg/avformat-58.dll b/FFmpeg/avformat-58.dll similarity index 100% rename from Libs/x64/FFmpeg/avformat-58.dll rename to FFmpeg/avformat-58.dll diff --git a/Libs/x64/FFmpeg/avutil-56.dll b/FFmpeg/avutil-56.dll similarity index 100% rename from Libs/x64/FFmpeg/avutil-56.dll rename to FFmpeg/avutil-56.dll diff --git a/Libs/x64/FFmpeg/postproc-55.dll b/FFmpeg/postproc-55.dll similarity index 100% rename from Libs/x64/FFmpeg/postproc-55.dll rename to FFmpeg/postproc-55.dll diff --git a/Libs/x64/FFmpeg/swresample-3.dll b/FFmpeg/swresample-3.dll similarity index 100% rename from Libs/x64/FFmpeg/swresample-3.dll rename to FFmpeg/swresample-3.dll diff --git a/Libs/x64/FFmpeg/swscale-5.dll b/FFmpeg/swscale-5.dll similarity index 100% rename from Libs/x64/FFmpeg/swscale-5.dll rename to FFmpeg/swscale-5.dll diff --git a/FlyleafLib.Controls.WPF/Flyleaf.xaml.cs b/FlyleafLib.Controls.WPF/Flyleaf.xaml.cs index a9f09055..f5d47d1b 100644 --- a/FlyleafLib.Controls.WPF/Flyleaf.xaml.cs +++ b/FlyleafLib.Controls.WPF/Flyleaf.xaml.cs @@ -41,7 +41,8 @@ public Player Player public Config Config => Player?.Config; - public AudioMaster AudioMaster => Master.AudioMaster; + public AudioEngine AudioEngine => Engine.Audio; + public EngineConfig ConfigEngine => Engine.Config; public SerializableDictionary> PluginsConfig => Config?.Plugins; @@ -168,8 +169,6 @@ internal Settings static Flyleaf() { - Master.UIRefresh = true; // Allow UI Refresh for Activity Mode, Buffered Duration on Pause & Stats - Player.SwapCompleted += (o, e) => { var flyleaf1 = (Flyleaf)e.Player1.Tag; @@ -197,6 +196,9 @@ public Flyleaf() if (isDesignMode) return; DataContext = this; + + // Ensure that the engine has been started + Engine.Config.UIRefresh = true; // Allow UI Refresh for Activity Mode, Buffered Duration on Pause & Stats } public override void OnApplyTemplate() { @@ -382,12 +384,12 @@ private void InitializePlayer(Player oldPlayer = null) if (oldPlayer != null) { - Log($"Assigning {Player.PlayerId} | {(oldPlayer != null ? $"Old {oldPlayer.PlayerId}" : "")}"); + //Log($"Assigning {Player.PlayerId} | {(oldPlayer != null ? $"Old {oldPlayer.PlayerId}" : "")}"); return; } UniqueId = Player.PlayerId; - Log($"Assigning {Player.PlayerId} | {(oldPlayer != null ? $"Old {oldPlayer.PlayerId}" : "")}"); + //Log($"Assigning {Player.PlayerId} | {(oldPlayer != null ? $"Old {oldPlayer.PlayerId}" : "")}"); Unloaded += (o, e) => { Dispose(); }; Player.Control.MouseClick += (o, e) => { if (e.Button == System.Windows.Forms.MouseButtons.Right & popUpMenu != null) popUpMenu.IsOpen = true; }; diff --git a/FlyleafLib.Controls.WPF/FlyleafLib.Controls.WPF.csproj b/FlyleafLib.Controls.WPF/FlyleafLib.Controls.WPF.csproj index 3a6775fb..6c4fef5a 100644 --- a/FlyleafLib.Controls.WPF/FlyleafLib.Controls.WPF.csproj +++ b/FlyleafLib.Controls.WPF/FlyleafLib.Controls.WPF.csproj @@ -4,7 +4,7 @@ net6.0-windows;net5.0-windows;net472 true true - 1.1.19 + 1.1.20 SuRGeoNix SuRGeoNix © 2022 LGPL-3.0-or-later @@ -14,8 +14,9 @@ flyleaf flyleaflib video audio media player element control WPF Media Player Control/Element (based on FlyleafLib) - * Updates Settings with Filters/Deinterlace and Speed x8 - * Updates FlyleafLib and MaterialDesign + * Renames Buffering Tab to Player and adds the new Logging settings + * Adds Read Timeout to Player Settings + * Updates FlyleafLib diff --git a/FlyleafLib.Controls.WPF/Settings.xaml b/FlyleafLib.Controls.WPF/Settings.xaml index 34ecb435..1e529ee9 100644 --- a/FlyleafLib.Controls.WPF/Settings.xaml +++ b/FlyleafLib.Controls.WPF/Settings.xaml @@ -120,6 +120,18 @@ + + + + + + + + + + + + @@ -164,12 +176,71 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +