diff options
author | sr55 <[email protected]> | 2020-02-26 21:10:04 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2020-02-26 21:10:16 +0000 |
commit | 56aba26a4da0fda058196fcb866e13d35dda538e (patch) | |
tree | 2372ce345a3ae2a6b230e9971bb422a768c28d43 /win/CS/HandBrakeWPF | |
parent | 22cfd6a1ec05a261284554b72109567392b91c9b (diff) |
WinGui: Add an explicit option in preferences to enable additional fixed function hardware on newer Intel CPU's.
Diffstat (limited to 'win/CS/HandBrakeWPF')
8 files changed, 50 insertions, 6 deletions
diff --git a/win/CS/HandBrakeWPF/Factories/HBConfigurationFactory.cs b/win/CS/HandBrakeWPF/Factories/HBConfigurationFactory.cs index b21c2195d..e8ec1fe1d 100644 --- a/win/CS/HandBrakeWPF/Factories/HBConfigurationFactory.cs +++ b/win/CS/HandBrakeWPF/Factories/HBConfigurationFactory.cs @@ -49,8 +49,9 @@ namespace HandBrakeWPF.Factories EnableNvencEncoder = UserSettingService.GetUserSetting<bool>(UserSettingConstants.EnableNvencEncoder),
EnableQsvEncoder = UserSettingService.GetUserSetting<bool>(UserSettingConstants.EnableQuickSyncEncoding),
EnableQuickSyncDecoding = UserSettingService.GetUserSetting<bool>(UserSettingConstants.EnableQuickSyncDecoding),
- UseQSVDecodeForNonQSVEnc = UserSettingService.GetUserSetting<bool>(UserSettingConstants.UseQSVDecodeForNonQSVEnc)
- };
+ UseQSVDecodeForNonQSVEnc = UserSettingService.GetUserSetting<bool>(UserSettingConstants.UseQSVDecodeForNonQSVEnc),
+ EnableQsvLowPower = UserSettingService.GetUserSetting<bool>(UserSettingConstants.EnableQuickSyncLowPower)
+ };
return config;
}
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index 97f49d008..e02fc2910 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -3447,6 +3447,15 @@ namespace HandBrakeWPF.Properties { } /// <summary> + /// Looks up a localized string similar to Enable Low Power QuickSync Hardware.. + /// </summary> + public static string OptionsView_EnableQuicksyncLowPower { + get { + return ResourceManager.GetString("OptionsView_EnableQuicksyncLowPower", resourceCulture); + } + } + + /// <summary> /// Looks up a localized string similar to Allow use of the AMD VCE Encoders. /// </summary> public static string OptionsView_EnableVceEncoding { diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index 5e86870b7..03ac33b5a 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -2209,4 +2209,7 @@ This will also stop any existing running jobs.</value> <data name="QueueService_DuplicatesTitle" xml:space="preserve">
<value>Duplicates Detected</value>
</data>
+ <data name="OptionsView_EnableQuicksyncLowPower" xml:space="preserve">
+ <value>Enable Low Power QuickSync Hardware.</value>
+ </data>
</root>
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs index 5ad0ef13e..ffcf8bb74 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs @@ -287,7 +287,6 @@ namespace HandBrakeWPF.Services.Encode.Factories } video.Level = job.VideoLevel?.ShortName; - video.Options = job.ExtraAdvancedArguments; video.Preset = job.VideoPreset?.ShortName; video.Profile = job.VideoProfile?.ShortName; @@ -319,6 +318,17 @@ namespace HandBrakeWPF.Services.Encode.Factories video.QSV.Decode = configuration.UseQSVDecodeForNonQSVEnc; } + + video.Options = job.ExtraAdvancedArguments; + + if (job.VideoEncoder == VideoEncoder.QuickSync || job.VideoEncoder == VideoEncoder.QuickSyncH265 || job.VideoEncoder == VideoEncoder.QuickSyncH26510b) + { + if (configuration.EnableQsvLowPower && !video.Options.Contains("lowpower")) + { + video.Options = string.IsNullOrEmpty(video.Options) ? "lowpower=1" : ":lowpower=1"; + } + } + return video; } diff --git a/win/CS/HandBrakeWPF/Services/UserSettingService.cs b/win/CS/HandBrakeWPF/Services/UserSettingService.cs index fb7c6185c..7e7b49e4a 100644 --- a/win/CS/HandBrakeWPF/Services/UserSettingService.cs +++ b/win/CS/HandBrakeWPF/Services/UserSettingService.cs @@ -280,7 +280,8 @@ namespace HandBrakeWPF.Services defaults.Add(UserSettingConstants.UseQSVDecodeForNonQSVEnc, false);
defaults.Add(UserSettingConstants.EnableVceEncoder, true);
defaults.Add(UserSettingConstants.EnableNvencEncoder, true);
-
+ defaults.Add(UserSettingConstants.EnableQuickSyncLowPower, true);
+
// Advanced
defaults.Add(UserSettingConstants.PreventSleep, true);
defaults.Add(UserSettingConstants.PauseEncodingOnLowBattery, true);
diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs index e0133c457..7e1e30b8b 100644 --- a/win/CS/HandBrakeWPF/UserSettingConstants.cs +++ b/win/CS/HandBrakeWPF/UserSettingConstants.cs @@ -76,5 +76,6 @@ namespace HandBrakeWPF public const string AlwaysUseDefaultPath = "AlwaysUseDefaultPath";
public const string PauseEncodingOnLowBattery = "PauseEncodingOnLowBattery";
public const string LowBatteryLevel = "LowBatteryLevel";
+ public const string EnableQuickSyncLowPower = "EnableQuickSyncLowPower";
}
}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index 3ceac7714..6796141fd 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -111,12 +111,12 @@ namespace HandBrakeWPF.ViewModels private bool alwaysUseDefaultPath;
private bool pauseOnLowBattery;
private int lowBatteryLevel;
-
+
// Experimental
private int remoteServicePort;
private bool remoteServiceEnabled;
-
+ private bool enableQuickSyncLowPower;
#endregion
@@ -1169,6 +1169,21 @@ namespace HandBrakeWPF.ViewModels }
}
+ public bool EnableQuickSyncLowPower
+ {
+ get => this.enableQuickSyncLowPower;
+ set
+ {
+ if (value == this.enableQuickSyncLowPower)
+ {
+ return;
+ }
+
+ this.enableQuickSyncLowPower = value;
+ this.NotifyOfPropertyChange(() => this.EnableQuickSyncLowPower);
+ }
+ }
+
public VideoScaler SelectedScalingMode { get; set; }
public bool IsQuickSyncAvailable
@@ -1581,6 +1596,7 @@ namespace HandBrakeWPF.ViewModels this.EnableQuickSyncDecoding = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableQuickSyncDecoding);
this.SelectedScalingMode = this.userSettingService.GetUserSetting<VideoScaler>(UserSettingConstants.ScalingMode);
this.UseQSVDecodeForNonQSVEnc = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.UseQSVDecodeForNonQSVEnc);
+ this.EnableQuickSyncLowPower = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableQuickSyncLowPower);
this.EnableQuickSyncEncoding = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableQuickSyncEncoding);
this.EnableVceEncoder = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableVceEncoder);
@@ -1735,6 +1751,7 @@ namespace HandBrakeWPF.ViewModels this.userSettingService.SetUserSetting(UserSettingConstants.EnableQuickSyncEncoding, this.EnableQuickSyncEncoding);
this.userSettingService.SetUserSetting(UserSettingConstants.EnableVceEncoder, this.EnableVceEncoder);
this.userSettingService.SetUserSetting(UserSettingConstants.EnableNvencEncoder, this.EnableNvencEncoder);
+ this.userSettingService.SetUserSetting(UserSettingConstants.EnableQuickSyncLowPower, this.EnableQuickSyncLowPower);
/* System and Logging */
this.userSettingService.SetUserSetting(UserSettingConstants.ProcessPriorityInt, this.SelectedPriority);
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml index 9dc45ff90..92cab3981 100644 --- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml +++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml @@ -316,6 +316,8 @@ <TextBlock Text="{x:Static Properties:Resources.Options_Encoding}" FontSize="14" Margin="0,10,0,10" />
<StackPanel Orientation="Vertical" Margin="20,0,0,0">
<CheckBox Content="{x:Static Properties:Resources.OptionsView_EnableQuicksyncEncoding}" IsEnabled="{Binding IsQuickSyncAvailable}" IsChecked="{Binding EnableQuickSyncEncoding}" />
+ <CheckBox Content="{x:Static Properties:Resources.OptionsView_EnableQuicksyncLowPower}" Margin="25,2,0,10" IsEnabled="{Binding IsQuickSyncAvailable}" IsChecked="{Binding EnableQuickSyncLowPower}" />
+
<CheckBox Content="{x:Static Properties:Resources.OptionsView_EnableVceEncoding}" IsEnabled="{Binding IsVceAvailable}" IsChecked="{Binding EnableVceEncoder}" />
<CheckBox Content="{x:Static Properties:Resources.OptionsView_EnableNvencEncoding}" IsEnabled="{Binding IsNvencAvailable}" IsChecked="{Binding EnableNvencEncoder}" />
|