Skip to content

Commit 70ccd88

Browse files
committed
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/
1 parent d2c1e72 commit 70ccd88

74 files changed

Lines changed: 1275 additions & 760 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

FlyleafLib.Controls.WPF/Flyleaf.xaml.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public Player Player
4141

4242
public Config Config => Player?.Config;
4343

44-
public AudioMaster AudioMaster => Master.AudioMaster;
44+
public AudioEngine AudioEngine => Engine.Audio;
45+
public EngineConfig ConfigEngine => Engine.Config;
4546

4647
public SerializableDictionary<string, SerializableDictionary<string, string>>
4748
PluginsConfig => Config?.Plugins;
@@ -168,8 +169,6 @@ internal Settings
168169

169170
static Flyleaf()
170171
{
171-
Master.UIRefresh = true; // Allow UI Refresh for Activity Mode, Buffered Duration on Pause & Stats
172-
173172
Player.SwapCompleted += (o, e) =>
174173
{
175174
var flyleaf1 = (Flyleaf)e.Player1.Tag;
@@ -197,6 +196,9 @@ public Flyleaf()
197196
if (isDesignMode) return;
198197

199198
DataContext = this;
199+
200+
// Ensure that the engine has been started
201+
Engine.Config.UIRefresh = true; // Allow UI Refresh for Activity Mode, Buffered Duration on Pause & Stats
200202
}
201203
public override void OnApplyTemplate()
202204
{
@@ -382,12 +384,12 @@ private void InitializePlayer(Player oldPlayer = null)
382384

383385
if (oldPlayer != null)
384386
{
385-
Log($"Assigning {Player.PlayerId} | {(oldPlayer != null ? $"Old {oldPlayer.PlayerId}" : "")}");
387+
//Log($"Assigning {Player.PlayerId} | {(oldPlayer != null ? $"Old {oldPlayer.PlayerId}" : "")}");
386388
return;
387389
}
388390

389391
UniqueId = Player.PlayerId;
390-
Log($"Assigning {Player.PlayerId} | {(oldPlayer != null ? $"Old {oldPlayer.PlayerId}" : "")}");
392+
//Log($"Assigning {Player.PlayerId} | {(oldPlayer != null ? $"Old {oldPlayer.PlayerId}" : "")}");
391393

392394
Unloaded += (o, e) => { Dispose(); };
393395
Player.Control.MouseClick += (o, e) => { if (e.Button == System.Windows.Forms.MouseButtons.Right & popUpMenu != null) popUpMenu.IsOpen = true; };

FlyleafLib.Controls.WPF/FlyleafLib.Controls.WPF.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFrameworks>net6.0-windows;net5.0-windows;net472</TargetFrameworks>
55
<UseWindowsForms>true</UseWindowsForms>
66
<UseWPF>true</UseWPF>
7-
<Version>1.1.19</Version>
7+
<Version>1.1.20</Version>
88
<Authors>SuRGeoNix</Authors>
99
<Copyright>SuRGeoNix © 2022</Copyright>
1010
<PackageLicenseExpression>LGPL-3.0-or-later</PackageLicenseExpression>
@@ -14,8 +14,9 @@
1414
<PackageTags>flyleaf flyleaflib video audio media player element control</PackageTags>
1515
<Description>WPF Media Player Control/Element (based on FlyleafLib)</Description>
1616
<PackageReleaseNotes>
17-
* Updates Settings with Filters/Deinterlace and Speed x8
18-
* Updates FlyleafLib and MaterialDesign
17+
* Renames Buffering Tab to Player and adds the new Logging settings
18+
* Adds Read Timeout to Player Settings
19+
* Updates FlyleafLib
1920
</PackageReleaseNotes>
2021
</PropertyGroup>
2122

FlyleafLib.Controls.WPF/Settings.xaml

Lines changed: 77 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,18 @@
120120
</ObjectDataProvider.MethodParameters>
121121
</ObjectDataProvider>
122122

123+
<ObjectDataProvider x:Key="LogLevelEnum" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
124+
<ObjectDataProvider.MethodParameters>
125+
<x:Type TypeName="fl:LogLevel"/>
126+
</ObjectDataProvider.MethodParameters>
127+
</ObjectDataProvider>
128+
129+
<ObjectDataProvider x:Key="FFmpegLogLevelEnum" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
130+
<ObjectDataProvider.MethodParameters>
131+
<x:Type TypeName="fl:FFmpegLogLevel"/>
132+
</ObjectDataProvider.MethodParameters>
133+
</ObjectDataProvider>
134+
123135
</ResourceDictionary>
124136
</UserControl.Resources>
125137

@@ -164,12 +176,71 @@
164176
</StackPanel>
165177
</materialDesign:DialogHost.DialogContent>
166178

167-
<dragablz:TabablzControl Width="525" Height="390" x:Name="tabRoot" FixedHeaderCount="10" Style="{StaticResource mdTabControl}" ItemContainerStyle="{StaticResource NormalTabItemStyle}">
179+
<dragablz:TabablzControl Width="504" Height="390" x:Name="tabRoot" FixedHeaderCount="10" Style="{StaticResource mdTabControl}" ItemContainerStyle="{StaticResource NormalTabItemStyle}">
168180
<TabControl.Resources>
169181
<Style TargetType="TabItem">
170182
<Setter Property="TextElement.Foreground" Value="{DynamicResource MaterialDesignBody}"/>
171183
</Style>
172184
</TabControl.Resources>
185+
<TabItem>
186+
<TabItem.Header>
187+
<StackPanel Orientation="Horizontal" Background="{DynamicResource MaterialDesignPaper}">
188+
<materialDesign:PackIcon Kind="PlayBoxMultipleOutline" Margin="0 6 4 6"/>
189+
<TextBlock Text="Player" VerticalAlignment="Center" Foreground="{DynamicResource PrimaryHueMidBrush}" Padding="0 0 8 0"/>
190+
</StackPanel>
191+
</TabItem.Header>
192+
<Grid>
193+
<Grid Margin="20" VerticalAlignment="Top">
194+
<Grid.ColumnDefinitions>
195+
<ColumnDefinition Width="200"/>
196+
<ColumnDefinition Width="100"/>
197+
<ColumnDefinition Width="*"/>
198+
</Grid.ColumnDefinitions>
199+
<Grid.RowDefinitions>
200+
<RowDefinition Height="30"/>
201+
<RowDefinition Height="30"/>
202+
<RowDefinition Height="30"/>
203+
<RowDefinition Height="30"/>
204+
<RowDefinition Height="30"/>
205+
<RowDefinition Height="30"/>
206+
<RowDefinition Height="30"/>
207+
<RowDefinition Height="30"/>
208+
<RowDefinition Height="30"/>
209+
</Grid.RowDefinitions>
210+
211+
<TextBlock Grid.Row="0" Text="Read Timeout (ms)" VerticalAlignment="Center"/>
212+
<TextBox Grid.Row="0" Grid.Column="1" Style="{StaticResource FLTextboxNP}" Text="{Binding Config.Demuxer.ReadTimeout, UpdateSourceTrigger=Explicit, Converter={StaticResource TicksToMilliSeconds}}"/>
213+
214+
<TextBlock Grid.Row="1" Text="Buffer Duration Min. (ms)" VerticalAlignment="Center"/>
215+
<TextBox Grid.Row="1" Grid.Column="1" Style="{StaticResource FLTextboxNP}" Text="{Binding Config.Player.MinBufferDuration, UpdateSourceTrigger=Explicit, Converter={StaticResource TicksToMilliSeconds}}"/>
216+
217+
<TextBlock Grid.Row="2" Text="Buffer Duration Max. (ms)" VerticalAlignment="Center"/>
218+
<TextBox Grid.Row="2" Grid.Column="1" Style="{StaticResource FLTextboxNP}" Text="{Binding Config.Demuxer.BufferDuration, UpdateSourceTrigger=Explicit, Converter={StaticResource TicksToMilliSeconds}}"/>
219+
220+
<TextBlock Grid.Row="3" Text="Audio Frames Max." VerticalAlignment="Center"/>
221+
<TextBox Grid.Row="3" Grid.Column="1" Style="{StaticResource FLTextboxNP}" Text="{Binding Config.Decoder.MaxAudioFrames, UpdateSourceTrigger=Explicit}"/>
222+
223+
<TextBlock Grid.Row="4" Text="Video Frames Max." VerticalAlignment="Center"/>
224+
<TextBox Grid.Row="4" Grid.Column="1" Style="{StaticResource FLTextboxNP}" Text="{Binding Config.Decoder.MaxVideoFrames, UpdateSourceTrigger=Explicit}"/>
225+
226+
<Separator Grid.Row="5" Grid.ColumnSpan="3"/>
227+
228+
<TextBlock Grid.Row="6" Text="Log File" VerticalAlignment="Center"/>
229+
<TextBox Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2" Width="260" TextAlignment="Left" Style="{StaticResource FLTextbox}" Text="{Binding ConfigEngine.LogOutput, UpdateSourceTrigger=Explicit}"/>
230+
231+
<TextBlock Grid.Row="7" Text="Log Level" VerticalAlignment="Center"/>
232+
<ComboBox Grid.Row="7" Grid.Column="1" ItemsSource="{Binding Source={StaticResource LogLevelEnum}}" SelectedItem="{Binding ConfigEngine.LogLevel}"/>
233+
234+
<TextBlock Grid.Row="8" Text="Log Level (FFmpeg)" VerticalAlignment="Center"/>
235+
<ComboBox Grid.Row="8" Grid.Column="1" ItemsSource="{Binding Source={StaticResource FFmpegLogLevelEnum}}" SelectedItem="{Binding ConfigEngine.FFmpegLogLevel}"/>
236+
</Grid>
237+
<StackPanel Margin="0, 0, 0, 10" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom">
238+
<Button Style="{StaticResource SaveButton}"/>
239+
<Button Content="Apply" FontWeight="ExtraBold" Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" CommandParameter="apply"/>
240+
<Button Margin="10 0" Content="Cancel" Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" CommandParameter="cancel" />
241+
</StackPanel>
242+
</Grid>
243+
</TabItem>
173244
<TabItem>
174245
<TabItem.Header>
175246
<StackPanel Orientation="Horizontal" Background="{DynamicResource MaterialDesignPaper}">
@@ -198,7 +269,7 @@
198269
<TextBox Grid.Row="1" Grid.Column="1" Style="{StaticResource FLTextboxN}" Text="{Binding Config.Audio.Delay, UpdateSourceTrigger=Explicit, Converter={StaticResource TicksToMilliSeconds}}"/>
199270

200271
<TextBlock Grid.Row="2" Text="Device" VerticalAlignment="Center"/>
201-
<ComboBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" x:Name="cmbAudioDevice" Tag="_save" ItemsSource="{Binding AudioMaster.Devices}" SelectedItem="{Binding Player.Audio.Device, UpdateSourceTrigger=Explicit}" />
272+
<ComboBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" x:Name="cmbAudioDevice" Tag="_save" ItemsSource="{Binding AudioEngine.Devices}" SelectedItem="{Binding Player.Audio.Device, UpdateSourceTrigger=Explicit}" />
202273
</Grid>
203274
<StackPanel Margin="0, 0, 0, 10" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom">
204275
<Button Style="{StaticResource SaveButton}"/>
@@ -313,7 +384,7 @@
313384

314385
<TextBlock Grid.Row="2" Text="Deinterlace" VerticalAlignment="Center"/>
315386
<ToggleButton Grid.Row="2" Grid.Column="1" Tag="_save" IsChecked="{Binding Config.Video.Deinterlace, UpdateSourceTrigger=Explicit}" HorizontalAlignment="Left" Style="{StaticResource MaterialDesignSwitchDarkToggleButton}"/>
316-
387+
317388
<TextBlock Grid.Row="3" Text="V. Sync" VerticalAlignment="Center"/>
318389
<ToggleButton Grid.Row="3" Grid.Column="1" Tag="_save" IsChecked="{Binding Config.Video.VSync, UpdateSourceTrigger=Explicit}" HorizontalAlignment="Left" Style="{StaticResource MaterialDesignSwitchDarkToggleButton}"/>
319390

@@ -334,7 +405,7 @@
334405

335406
<TextBlock Grid.Row="9" Text="HDR to SDR Tone" VerticalAlignment="Center"/>
336407
<TextBox Grid.Row="9" Grid.Column="1" Style="{StaticResource FLTextbox}" Text="{Binding Config.Video.HDRtoSDRTone, UpdateSourceTrigger=LostFocus}"/>
337-
408+
338409
<StackPanel Orientation="Vertical" Grid.Row="10" Grid.ColumnSpan="3" Margin="0 10 0 0">
339410
<ItemsControl ItemsSource="{Binding Config.Video.Filters.Values}">
340411
<ItemsControl.ItemTemplate>
@@ -357,46 +428,6 @@
357428
</StackPanel>
358429
</Grid>
359430
</TabItem>
360-
<TabItem>
361-
<TabItem.Header>
362-
<StackPanel Orientation="Horizontal" Background="{DynamicResource MaterialDesignPaper}">
363-
<materialDesign:PackIcon Kind="ProgressDownload" Margin="4 6 4 6"/>
364-
<TextBlock Text="Buffering" VerticalAlignment="Center" Foreground="{DynamicResource PrimaryHueMidBrush}" Padding="0 0 8 0"/>
365-
</StackPanel>
366-
</TabItem.Header>
367-
<Grid>
368-
<Grid Margin="20" VerticalAlignment="Top">
369-
<Grid.ColumnDefinitions>
370-
<ColumnDefinition Width="200"/>
371-
<ColumnDefinition Width="auto"/>
372-
<ColumnDefinition Width="*"/>
373-
</Grid.ColumnDefinitions>
374-
<Grid.RowDefinitions>
375-
<RowDefinition Height="30"/>
376-
<RowDefinition Height="30"/>
377-
<RowDefinition Height="30"/>
378-
<RowDefinition Height="30"/>
379-
</Grid.RowDefinitions>
380-
381-
<TextBlock Grid.Row="0" Text="Buffer Duration Min. (ms)" VerticalAlignment="Center"/>
382-
<TextBox Grid.Row="0" Grid.Column="1" Style="{StaticResource FLTextboxNP}" Text="{Binding Config.Player.MinBufferDuration, UpdateSourceTrigger=Explicit, Converter={StaticResource TicksToMilliSeconds}}"/>
383-
384-
<TextBlock Grid.Row="1" Text="Buffer Duration Max. (ms)" VerticalAlignment="Center"/>
385-
<TextBox Grid.Row="1" Grid.Column="1" Style="{StaticResource FLTextboxNP}" Text="{Binding Config.Demuxer.BufferDuration, UpdateSourceTrigger=Explicit, Converter={StaticResource TicksToMilliSeconds}}"/>
386-
387-
<TextBlock Grid.Row="2" Text="Audio Frames Max." VerticalAlignment="Center"/>
388-
<TextBox Grid.Row="2" Grid.Column="1" Style="{StaticResource FLTextboxNP}" Text="{Binding Config.Decoder.MaxAudioFrames, UpdateSourceTrigger=Explicit}"/>
389-
390-
<TextBlock Grid.Row="3" Text="Video Frames Max." VerticalAlignment="Center"/>
391-
<TextBox Grid.Row="3" Grid.Column="1" Style="{StaticResource FLTextboxNP}" Text="{Binding Config.Decoder.MaxVideoFrames, UpdateSourceTrigger=Explicit}"/>
392-
</Grid>
393-
<StackPanel Margin="0, 0, 0, 10" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom">
394-
<Button Style="{StaticResource SaveButton}"/>
395-
<Button Content="Apply" FontWeight="ExtraBold" Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" CommandParameter="apply"/>
396-
<Button Margin="10 0" Content="Cancel" Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" CommandParameter="cancel" />
397-
</StackPanel>
398-
</Grid>
399-
</TabItem>
400431
<TabItem>
401432
<TabItem.Header>
402433
<StackPanel Orientation="Horizontal" Background="{DynamicResource MaterialDesignPaper}">
@@ -504,7 +535,7 @@
504535
<TabItem>
505536
<TabItem.Header>
506537
<StackPanel Orientation="Horizontal" Background="{DynamicResource MaterialDesignPaper}">
507-
<materialDesign:PackIcon Kind="PluginOutline" Margin="4 6 4 6"/>
538+
<materialDesign:PackIcon Kind="PluginOutline" Margin="0 6 4 6"/>
508539
<TextBlock Text="Plugins" VerticalAlignment="Center" Foreground="{DynamicResource PrimaryHueMidBrush}" Padding="0 0 4 0"/>
509540
</StackPanel>
510541
</TabItem.Header>
@@ -534,7 +565,7 @@
534565
<DataTemplate>
535566
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
536567
<TextBlock Text="{Binding Key, Mode=OneWay}" VerticalAlignment="Center" Width="150"/>
537-
<TextBox Text="{Binding Value, Mode=OneWay}" VerticalAlignment="Center" Width="320" LostFocus="PluginValueChanged"/>
568+
<TextBox Text="{Binding Value, Mode=OneWay}" VerticalAlignment="Center" Width="310" LostFocus="PluginValueChanged"/>
538569
</StackPanel>
539570
</DataTemplate>
540571
</ItemsControl.ItemTemplate>

0 commit comments

Comments
 (0)