summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
diff options
context:
space:
mode:
authorRodeo <[email protected]>2013-11-08 23:04:44 +0000
committerRodeo <[email protected]>2013-11-08 23:04:44 +0000
commit2068e877b79fb5513704a6a0c12764e55e65af6e (patch)
tree7420f1cd9a7d467ad29355df39f2723573f99720 /win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
parent6b27b0d868d030992cf50d2c0f9369ecfd8916d2 (diff)
WinGui: use libhb presets for QSV.
This replaces the built-in QSV presets. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5889 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs88
1 files changed, 27 insertions, 61 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
index 13be72527..5dee88426 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
@@ -957,12 +957,24 @@ namespace HandBrake.ApplicationServices.Utilities
{
query += string.Format(" -x {0}", task.ExtraAdvancedArguments);
}
- }
- }
-
- // Options that apply to both x264 and QuickSync
- if (task.VideoEncoder == VideoEncoder.QuickSync || task.VideoEncoder == VideoEncoder.X264)
- {
+ }
+ }
+
+ // QSV Only
+ if (task.VideoEncoder == VideoEncoder.QuickSync)
+ {
+ query += string.Format(" --qsv-preset={0}", task.QsvPreset.ToString().ToLower());
+ }
+
+ // options that apply to all encoders
+ if (!string.IsNullOrEmpty(task.AdvancedEncoderOptions))
+ {
+ query += string.Format(" -x {0}", task.AdvancedEncoderOptions);
+ }
+
+ // Options that apply to both x264 and QuickSync
+ if (task.VideoEncoder == VideoEncoder.QuickSync || task.VideoEncoder == VideoEncoder.X264)
+ {
// when using x264 with the advanced panel, the H.264 profile/level widgets are disabled
if (!(task.VideoEncoder == VideoEncoder.X264 && task.ShowAdvancedTab))
{
@@ -973,61 +985,15 @@ namespace HandBrake.ApplicationServices.Utilities
if (task.H264Profile != x264Profile.None)
{
query += string.Format(
- " --h264-profile={0} ", task.H264Profile.ToString().ToLower().Replace(" ", string.Empty));
- }
- }
-
- if (task.VideoEncoder == VideoEncoder.QuickSync)
- {
- string qsvPreset;
-
- if (SystemInfo.IsHswOrNewer)
- {
- switch (task.QsvPreset)
- {
- case QsvPreset.Speed:
- qsvPreset = "6";
- break;
- case QsvPreset.Balanced:
- qsvPreset = "4";
- break;
- default:
- qsvPreset = "2";
- break;
- }
- }
- else
- {
- switch (task.QsvPreset)
- {
- case QsvPreset.Speed:
- qsvPreset = "4";
- break;
- case QsvPreset.Balanced:
- qsvPreset = "2";
- break;
- default:
- qsvPreset = "2";
- break;
- }
- }
-
- query += string.IsNullOrEmpty(task.AdvancedEncoderOptions)
- ? string.Format(" -x target-usage={0}", qsvPreset)
- : string.Format(" -x target-usage={0}:{1}", qsvPreset, task.AdvancedEncoderOptions);
- }
- else if (!string.IsNullOrEmpty(task.AdvancedEncoderOptions)) // Not a H.264 encode
- {
- query += string.Format(" -x {0}", task.AdvancedEncoderOptions);
- }
-
- return query;
- }
-
- return string.IsNullOrEmpty(task.AdvancedEncoderOptions) ? string.Empty : string.Format(" -x {0}", task.AdvancedEncoderOptions);
- }
-
- /// <summary>
+ " --h264-profile={0} ", task.H264Profile.ToString().ToLower().Replace(" ", string.Empty));
+ }
+ }
+ }
+
+ return query;
+ }
+
+ /// <summary>
/// Generate the Command Line Arguments for any additional advanced options.
/// </summary>
/// <param name="verbosity">