]> granicus.if.org Git - handbrake/commitdiff
WinGui: New Setting to allow the QSV decoder to be used with Non QSV encoders. (Was...
authorsr55 <sr55.hb@outlook.com>
Mon, 26 Dec 2016 14:49:34 +0000 (14:49 +0000)
committersr55 <sr55.hb@outlook.com>
Mon, 26 Dec 2016 14:49:34 +0000 (14:49 +0000)
win/CS/HandBrake.ApplicationServices/Model/HBConfiguration.cs
win/CS/HandBrakeWPF/Factories/HBConfigurationFactory.cs
win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
win/CS/HandBrakeWPF/UserSettingConstants.cs
win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
win/CS/HandBrakeWPF/Views/OptionsView.xaml
win/CS/HandBrakeWPF/defaultsettings.xml

index a27eae1bec84a22dac4736f57601f0fc058d2fc2..6290004c8f64a47e92248393d728320bf7ba809b 100644 (file)
@@ -24,6 +24,11 @@ namespace HandBrake.ApplicationServices.Model
         /// </summary>\r
         public bool DisableQuickSyncDecoding { get; set; }\r
 \r
+        /// <summary>\r
+        /// Gets or sets a value indicating whether use qsv decode for non qsv enc.\r
+        /// </summary>\r
+        public bool UseQSVDecodeForNonQSVEnc { get; set; }\r
+\r
         /// <summary>\r
         /// Gets or sets the scaling mode.\r
         /// </summary>\r
index 6c702e8b0e9534deea5beda2dafc5c8ca1fd751a..dc3fa198358b5fcce2d6deb2749573c21312f2c5 100644 (file)
@@ -37,6 +37,7 @@ namespace HandBrakeWPF.Factories
                                          {\r
                                              IsDvdNavDisabled = UserSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibDvdNav), \r
                                              DisableQuickSyncDecoding = UserSettingService.GetUserSetting<bool>(UserSettingConstants.DisableQuickSyncDecoding), \r
+                                             UseQSVDecodeForNonQSVEnc = UserSettingService.GetUserSetting<bool>(UserSettingConstants.UseQSVDecodeForNonQSVEnc),\r
                                              ScalingMode = UserSettingService.GetUserSetting<VideoScaler>(UserSettingConstants.ScalingMode), \r
                                              PreviewScanCount = UserSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount), \r
                                              Verbosity = UserSettingService.GetUserSetting<int>(UserSettingConstants.Verbosity), \r
index f5b473e784de921cc58958759ac243d5465422b7..28dd1e6b0c774126dbdec779f5b5d8806700b3d2 100644 (file)
@@ -1302,6 +1302,15 @@ namespace HandBrakeWPF.Properties {
             }\r
         }\r
         \r
+        /// <summary>\r
+        ///   Looks up a localized string similar to Use QSV Decoding for non QSV encoders..\r
+        /// </summary>\r
+        public static string Options_QsvDecodeForNonFullPath {\r
+            get {\r
+                return ResourceManager.GetString("Options_QsvDecodeForNonFullPath", resourceCulture);\r
+            }\r
+        }\r
+        \r
         /// <summary>\r
         ///   Looks up a localized string similar to Remove common punctuation.\r
         /// </summary>\r
index 6e0be7892c78804b87f18ee1e615d6c20e405384..fa92316257f1fc14481afd6350b21b6d241c12a4 100644 (file)
@@ -887,4 +887,7 @@ This will not affect your current settings in the Subtitle tab.</value>
   <data name="ManagePresetView_ManagePreset" xml:space="preserve">\r
     <value>Manage Preset</value>\r
   </data>\r
+  <data name="Options_QsvDecodeForNonFullPath" xml:space="preserve">\r
+    <value>Use QSV Decoding for non QSV encoders.</value>\r
+  </data>\r
 </root>
\ No newline at end of file
index a390db6fb55a2d6b43d2bada101dc0a31d53655f..31f315f7e4e1146a5cc6f067b2f6d14e23ecb0d6 100644 (file)
@@ -305,6 +305,12 @@ namespace HandBrakeWPF.Services.Encode.Factories
 
             video.QSV.Decode = SystemInfo.IsQsvAvailable && !configuration.DisableQuickSyncDecoding;
 
+            // The use of the QSV decoder is configurable for non QSV encoders.
+            if (video.QSV.Decode && job.VideoEncoder != VideoEncoder.QuickSync && job.VideoEncoder != VideoEncoder.QuickSyncH265)
+            {
+                video.QSV.Decode = configuration.UseQSVDecodeForNonQSVEnc;
+            }
+
             return video;
         }
 
index fabd5ee9db01c741b342b147ca4dcaa9ccc448a1..80b740b90e5ef5b95d4aff49ffc85c52eb4ceb4b 100644 (file)
@@ -166,6 +166,11 @@ namespace HandBrakeWPF
         /// </summary>\r
         public const string DisableQuickSyncDecoding = "DisableQuickSyncDecoding";\r
 \r
+        /// <summary>\r
+        /// Setting indicating whether to use qsv decode for non qsv encoders\r
+        /// </summary>\r
+        public const string UseQSVDecodeForNonQSVEnc = "UseQSVDecodeForNonQSVEnc";\r
+\r
         /// <summary>\r
         /// The scaling mode.\r
         /// </summary>\r
index 125939054000c15e2852d472398e2eaecd4ab325..cdf480be6e3c55be49eeefdf5081fc926a87405e 100644 (file)
@@ -93,6 +93,8 @@ namespace HandBrakeWPF.ViewModels
         private bool showQueueInline;\r
         private bool pauseOnLowDiskspace;\r
 \r
+        private bool useQsvDecodeForNonQsvEnc;\r
+\r
         #endregion\r
 \r
         #region Constructors and Destructors\r
@@ -881,6 +883,7 @@ namespace HandBrakeWPF.ViewModels
                 }\r
                 this.disableQuickSyncDecoding = value;\r
                 this.NotifyOfPropertyChange(() => this.DisableQuickSyncDecoding);\r
+                this.NotifyOfPropertyChange(() => this.IsUseQsvDecAvailable);\r
             }\r
         }\r
 \r
@@ -911,6 +914,34 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Gets a value indicating whether is use qsv dec available.\r
+        /// </summary>\r
+        public bool IsUseQsvDecAvailable\r
+        {\r
+            get\r
+            {\r
+                return IsQuickSyncAvailable && !this.DisableQuickSyncDecoding;\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Gets or sets a value indicating whether to use qsv decode for non qsv encoders\r
+        /// </summary>\r
+        public bool UseQSVDecodeForNonQSVEnc\r
+        {\r
+            get\r
+            {\r
+                return this.useQsvDecodeForNonQsvEnc;\r
+            }\r
+            set\r
+            {\r
+                if (value == this.useQsvDecodeForNonQsvEnc) return;\r
+                this.useQsvDecodeForNonQsvEnc = value;\r
+                this.NotifyOfPropertyChange(() => this.UseQSVDecodeForNonQSVEnc);\r
+            }\r
+        }\r
+\r
         /// <summary>\r
         /// Gets the scaling options.\r
         /// </summary>\r
@@ -1216,6 +1247,7 @@ namespace HandBrakeWPF.ViewModels
             // #############################\r
             this.DisableQuickSyncDecoding = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableQuickSyncDecoding);\r
             this.SelectedScalingMode = this.userSettingService.GetUserSetting<VideoScaler>(UserSettingConstants.ScalingMode);\r
+            this.UseQSVDecodeForNonQSVEnc = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.UseQSVDecodeForNonQSVEnc);\r
 \r
             // #############################\r
             // CLI\r
@@ -1317,6 +1349,7 @@ namespace HandBrakeWPF.ViewModels
             /* Video */\r
             this.userSettingService.SetUserSetting(UserSettingConstants.DisableQuickSyncDecoding, this.DisableQuickSyncDecoding);\r
             this.userSettingService.SetUserSetting(UserSettingConstants.ScalingMode, this.SelectedScalingMode);\r
+            this.userSettingService.SetUserSetting(UserSettingConstants.UseQSVDecodeForNonQSVEnc, this.UseQSVDecodeForNonQSVEnc);\r
 \r
             /* System and Logging */\r
             userSettingService.SetUserSetting(UserSettingConstants.ProcessPriority, this.SelectedPriority);\r
index 66ef363182ad46f56ee5454c149a0bd9bb1dc404..da8bd67c71e16dd6ad83b068a1e3cdc081428a62 100644 (file)
 \r
                         <StackPanel Orientation="Vertical" Margin="20,10,0,0">\r
                             <CheckBox Content="{x:Static Properties:ResourcesUI.Options_QsvDecode}" IsEnabled="{Binding IsQuickSyncAvailable}" IsChecked="{Binding DisableQuickSyncDecoding}" />\r
+                            <CheckBox Content="{x:Static Properties:ResourcesUI.Options_QsvDecodeForNonFullPath}" IsEnabled="{Binding IsUseQsvDecAvailable}" IsChecked="{Binding UseQSVDecodeForNonQSVEnc}" />\r
                             <TextBlock Text="{x:Static Properties:Resources.Video_QuickSyncNotAvailable}" Margin="17,2,0,0" TextWrapping="Wrap"\r
                                         Visibility="{Binding IsQuickSyncAvailable, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />\r
                         </StackPanel>\r
index 42c662ac1edccb5776ad60c10d35e359a00bf553..f28f8b9cba41a9d6cf67f78c6091e58cb605e476 100644 (file)
       <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:int" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">3</anyType>\r
     </value>\r
   </item>\r
+  <item>\r
+    <key>\r
+      <string>UseQSVDecodeForNonQSVEnc</string>\r
+    </key>\r
+    <value>\r
+      <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>\r
+    </value>\r
+  </item> \r
 </dictionary>
\ No newline at end of file