diff options
author | randomengy <[email protected]> | 2014-03-31 03:17:42 +0000 |
---|---|---|
committer | randomengy <[email protected]> | 2014-03-31 03:17:42 +0000 |
commit | 6ff517c3741cf3476e035ae3f35ac908d2f79d15 (patch) | |
tree | 2915148929347bb8f35f207333aa62626bbc70dd /win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs | |
parent | 05e6e447df6d66307a2cbcf7be19dc6d67676e07 (diff) |
Interop: Added methods to dynamically pull the preset, profile, level and tune values. Replaced encoder-specific fields on EncodingProfile with general fields. Standardized the InteropUtilities conversion function names.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6142 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs b/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs index 5ff4924eb..9e8bc3c32 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs @@ -181,24 +181,30 @@ namespace HandBrake.ApplicationServices.Utilities profile.VideoEncodeRateType = work.VideoEncodeRateType;
profile.VideoEncoder = Converters.GetVideoEncoder(work.VideoEncoder);
- profile.H264Level = work.H264Level;
- profile.X264Profile = work.H264Profile.ToString().ToLower().Replace(" ", string.Empty); // TODO change these away from strings.
- profile.X264Preset = work.X264Preset.ToString().ToLower().Replace(" ", string.Empty);
- profile.X264Tunes = new List<string>();
-
- if (work.X264Tune != x264Tune.None)
+ if (work.VideoEncoder == VideoEncoder.X264)
{
- profile.X264Tunes.Add(work.X264Tune.ToString().ToLower().Replace(" ", string.Empty));
- }
+ profile.VideoPreset = work.X264Preset.ToString().ToLower().Replace(" ", string.Empty);
+ profile.VideoTunes = new List<string>();
+
+ if (work.X264Tune != x264Tune.None)
+ {
+ profile.VideoTunes.Add(work.X264Tune.ToString().ToLower().Replace(" ", string.Empty));
+ }
- if (work.FastDecode)
+ if (work.FastDecode)
+ {
+ profile.VideoTunes.Add("fastdecode");
+ }
+ }
+ else if (work.VideoEncoder == VideoEncoder.X265)
{
- profile.X264Tunes.Add("fastdecode");
+ profile.VideoPreset = work.X265Preset.ToString().ToLower().Replace(" ", string.Empty);
+ profile.VideoProfile = work.H265Profile.ToString().ToLower().Replace(" ", string.Empty);
+ profile.VideoTunes = new List<string>();
}
- profile.X265Preset = work.X265Preset.ToString().ToLower().Replace(" ", string.Empty);
- profile.X265Profile = work.H265Profile.ToString().ToLower().Replace(" ", string.Empty);
- profile.X265Tunes = new List<string>();
+ profile.VideoLevel = work.H264Level;
+ profile.VideoProfile = work.H264Profile.ToString().ToLower().Replace(" ", string.Empty); // TODO change these away from strings.
// Chapter Markers
profile.IncludeChapterMarkers = work.IncludeChapterMarkers;
@@ -206,7 +212,7 @@ namespace HandBrake.ApplicationServices.Utilities job.UseDefaultChapterNames = work.IncludeChapterMarkers;
// Advanced Settings
- profile.X264Options = work.AdvancedEncoderOptions;
+ profile.VideoOptions = work.AdvancedEncoderOptions;
// Subtitles
job.Subtitles = new Subtitles { SourceSubtitles = new List<SourceSubtitle>(), SrtSubtitles = new List<SrtSubtitle>() };
|