summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.Interop
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.Interop')
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs20
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj1
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs6
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/AnamorphicFactory.cs22
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs92
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/EncodeJob.cs552
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs381
7 files changed, 508 insertions, 566 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs
index a36e672ca..4d9b6791b 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs
@@ -292,20 +292,20 @@ namespace HandBrake.Interop
// Creat the Expected Output Geometry details for libhb.
hb_geometry_settings_s uiGeometry = new hb_geometry_settings_s
{
- crop = new[] { job.EncodingProfile.Cropping.Top, job.EncodingProfile.Cropping.Bottom, job.EncodingProfile.Cropping.Left, job.EncodingProfile.Cropping.Right },
+ crop = new[] { job.Cropping.Top, job.Cropping.Bottom, job.Cropping.Left, job.Cropping.Right },
itu_par = 0,
- keep = (int)AnamorphicFactory.KeepSetting.HB_KEEP_WIDTH + (job.EncodingProfile.KeepDisplayAspect ? 0x04 : 0), // TODO Keep Width?
- maxWidth = job.EncodingProfile.MaxWidth,
- maxHeight = job.EncodingProfile.MaxHeight,
- mode = (int)(hb_anamorphic_mode_t)job.EncodingProfile.Anamorphic,
- modulus = job.EncodingProfile.Modulus,
+ keep = (int)AnamorphicFactory.KeepSetting.HB_KEEP_WIDTH + (job.KeepDisplayAspect ? 0x04 : 0), // TODO Keep Width?
+ maxWidth = job.MaxWidth,
+ maxHeight = job.MaxHeight,
+ mode = (int)(hb_anamorphic_mode_t)job.Anamorphic,
+ modulus = job.Modulus,
geometry = new hb_geometry_s
{
- height = job.EncodingProfile.Height,
- width = job.EncodingProfile.Width,
- par = job.EncodingProfile.Anamorphic != Anamorphic.Custom
+ height = job.Height,
+ width = job.Width,
+ par = job.Anamorphic != Anamorphic.Custom
? new hb_rational_t { den = title.ParVal.Height, num = title.ParVal.Width }
- : new hb_rational_t { den = job.EncodingProfile.PixelAspectY, num = job.EncodingProfile.PixelAspectX }
+ : new hb_rational_t { den = job.PixelAspectY, num = job.PixelAspectX }
}
};
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj
index f153d2dca..52939e219 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj
@@ -241,7 +241,6 @@
<Compile Include="Model\Encoding\Deinterlace.cs" />
<Compile Include="Model\Encoding\Denoise.cs" />
<Compile Include="Model\Encoding\Detelecine.cs" />
- <Compile Include="Model\Encoding\EncodingProfile.cs" />
<Compile Include="Model\Encoding\HBContainer.cs" />
<Compile Include="Model\Encoding\HBMixdown.cs" />
<Compile Include="Model\Encoding\HBRate.cs" />
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs
index abb67a074..1d7042ab3 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs
@@ -456,7 +456,7 @@ namespace HandBrake.Interop
{
long availableBytes = ((long)sizeMB) * 1024 * 1024;
- EncodingProfile profile = job.EncodingProfile;
+ EncodeJob profile = job;
double lengthSeconds = overallSelectedLengthSeconds > 0 ? overallSelectedLengthSeconds : GetJobLengthSeconds(job, title);
lengthSeconds += 1.5;
@@ -509,7 +509,7 @@ namespace HandBrake.Interop
{
long totalBytes = 0;
- EncodingProfile profile = job.EncodingProfile;
+ EncodeJob profile = job;
double lengthSeconds = GetJobLengthSeconds(job, title);
lengthSeconds += 1.5;
@@ -579,7 +579,7 @@ namespace HandBrake.Interop
{
var list = new List<Tuple<AudioEncoding, int>>();
- foreach (AudioEncoding encoding in job.EncodingProfile.AudioEncodings)
+ foreach (AudioEncoding encoding in job.AudioEncodings)
{
if (encoding.InputNumber == 0)
{
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/AnamorphicFactory.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/AnamorphicFactory.cs
index 97809c348..1fd16ec5e 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/AnamorphicFactory.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/AnamorphicFactory.cs
@@ -53,7 +53,7 @@ namespace HandBrake.Interop.Json.Factories
/// </returns>
public static Geometry CreateGeometry(EncodeJob job, Title title, KeepSetting keepWidthOrHeight) // Todo remove the need for these objects. Should use simpler objects.
{
- int settingMode = (int)keepWidthOrHeight + (job.EncodingProfile.KeepDisplayAspect ? 0x04 : 0);
+ int settingMode = (int)keepWidthOrHeight + (job.KeepDisplayAspect ? 0x04 : 0);
// Sanatise the Geometry First.
AnamorphicGeometry anamorphicGeometry = new AnamorphicGeometry
@@ -66,27 +66,27 @@ namespace HandBrake.Interop.Json.Factories
},
DestSettings = new DestSettings
{
- AnamorphicMode = (int)job.EncodingProfile.Anamorphic,
+ AnamorphicMode = (int)job.Anamorphic,
Geometry = {
- Width = job.EncodingProfile.Width, Height = job.EncodingProfile.Height,
+ Width = job.Width, Height = job.Height,
PAR = new PAR
{
- Num = job.EncodingProfile.Anamorphic != Anamorphic.Custom ? title.ParVal.Width : job.EncodingProfile.PixelAspectX,
- Den = job.EncodingProfile.Anamorphic != Anamorphic.Custom ? title.ParVal.Height : job.EncodingProfile.PixelAspectY,
+ Num = job.Anamorphic != Anamorphic.Custom ? title.ParVal.Width : job.PixelAspectX,
+ Den = job.Anamorphic != Anamorphic.Custom ? title.ParVal.Height : job.PixelAspectY,
}
},
Keep = settingMode,
- Crop = new List<int> { job.EncodingProfile.Cropping.Top, job.EncodingProfile.Cropping.Bottom, job.EncodingProfile.Cropping.Left, job.EncodingProfile.Cropping.Right },
- Modulus = job.EncodingProfile.Modulus,
- MaxWidth = job.EncodingProfile.MaxWidth,
- MaxHeight = job.EncodingProfile.MaxHeight,
+ Crop = new List<int> { job.Cropping.Top, job.Cropping.Bottom, job.Cropping.Left, job.Cropping.Right },
+ Modulus = job.Modulus,
+ MaxWidth = job.MaxWidth,
+ MaxHeight = job.MaxHeight,
ItuPAR = false
}
};
- if (job.EncodingProfile.Anamorphic == Anamorphic.Custom)
+ if (job.Anamorphic == Anamorphic.Custom)
{
- anamorphicGeometry.DestSettings.Geometry.PAR = new PAR { Num = job.EncodingProfile.PixelAspectX, Den = job.EncodingProfile.PixelAspectY };
+ anamorphicGeometry.DestSettings.Geometry.PAR = new PAR { Num = job.PixelAspectX, Den = job.PixelAspectY };
}
else
{
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs
index 51b29533f..327e5ce9f 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs
@@ -126,11 +126,11 @@ namespace HandBrake.Interop.Json.Factories
File = job.OutputPath,
Mp4Options = new Mp4Options
{
- IpodAtom = job.EncodingProfile.IPod5GSupport,
- Mp4Optimize = job.EncodingProfile.Optimize
+ IpodAtom = job.IPod5GSupport,
+ Mp4Optimize = job.Optimize
},
- ChapterMarkers = job.EncodingProfile.IncludeChapterMarkers,
- Mux = HBFunctions.hb_container_get_from_name(job.EncodingProfile.ContainerName),
+ ChapterMarkers = job.IncludeChapterMarkers,
+ Mux = HBFunctions.hb_container_get_from_name(job.ContainerName),
ChapterList = new List<ChapterList>()
};
@@ -241,23 +241,23 @@ namespace HandBrake.Interop.Json.Factories
{
Video video = new Video();
- HBVideoEncoder videoEncoder = HandBrakeEncoderHelpers.VideoEncoders.FirstOrDefault(e => e.ShortName == job.EncodingProfile.VideoEncoder);
- Validate.NotNull(videoEncoder, "Video encoder " + job.EncodingProfile.VideoEncoder + " not recognized.");
+ HBVideoEncoder videoEncoder = HandBrakeEncoderHelpers.VideoEncoders.FirstOrDefault(e => e.ShortName == job.VideoEncoder);
+ Validate.NotNull(videoEncoder, "Video encoder " + job.VideoEncoder + " not recognized.");
if (videoEncoder != null)
{
video.Codec = videoEncoder.Id;
}
- video.TwoPass = job.EncodingProfile.TwoPass;
- video.Turbo = job.EncodingProfile.TurboFirstPass;
- video.Level = job.EncodingProfile.VideoLevel;
- video.Options = job.EncodingProfile.VideoOptions;
- video.Preset = job.EncodingProfile.VideoPreset;
- video.Profile = job.EncodingProfile.VideoProfile;
- video.Quality = job.EncodingProfile.Quality;
- if (job.EncodingProfile.VideoTunes != null && job.EncodingProfile.VideoTunes.Count > 0)
+ video.TwoPass = job.TwoPass;
+ video.Turbo = job.TurboFirstPass;
+ video.Level = job.VideoLevel;
+ video.Options = job.VideoOptions;
+ video.Preset = job.VideoPreset;
+ video.Profile = job.VideoProfile;
+ video.Quality = job.Quality;
+ if (job.VideoTunes != null && job.VideoTunes.Count > 0)
{
- video.Tune = string.Join(",", job.EncodingProfile.VideoTunes);
+ video.Tune = string.Join(",", job.VideoTunes);
}
return video;
@@ -276,10 +276,10 @@ namespace HandBrake.Interop.Json.Factories
{
Audio audio = new Audio();
- if (!string.IsNullOrEmpty(job.EncodingProfile.AudioEncoderFallback))
+ if (!string.IsNullOrEmpty(job.AudioEncoderFallback))
{
- HBAudioEncoder audioEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(job.EncodingProfile.AudioEncoderFallback);
- Validate.NotNull(audioEncoder, "Unrecognized fallback audio encoder: " + job.EncodingProfile.AudioEncoderFallback);
+ HBAudioEncoder audioEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(job.AudioEncoderFallback);
+ Validate.NotNull(audioEncoder, "Unrecognized fallback audio encoder: " + job.AudioEncoderFallback);
audio.FallbackEncoder = audioEncoder.Id;
}
@@ -287,7 +287,7 @@ namespace HandBrake.Interop.Json.Factories
audio.AudioList = new List<AudioList>();
int numTracks = 0;
- foreach (AudioEncoding item in job.EncodingProfile.AudioEncodings)
+ foreach (AudioEncoding item in job.AudioEncodings)
{
HBAudioEncoder encoder = HandBrakeEncoderHelpers.GetAudioEncoder(item.Encoder);
Validate.NotNull(encoder, "Unrecognized audio encoder:" + item.Encoder);
@@ -348,31 +348,31 @@ namespace HandBrake.Interop.Json.Factories
Filter filter = new Filter
{
FilterList = new List<FilterList>(),
- Grayscale = job.EncodingProfile.Grayscale
+ Grayscale = job.Grayscale
};
// Detelecine
- if (job.EncodingProfile.Detelecine != Detelecine.Off)
+ if (job.Detelecine != Detelecine.Off)
{
- FilterList filterItem = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_DETELECINE, Settings = job.EncodingProfile.CustomDetelecine };
+ FilterList filterItem = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_DETELECINE, Settings = job.CustomDetelecine };
filter.FilterList.Add(filterItem);
}
// Decomb
- if (job.EncodingProfile.Decomb != Decomb.Off)
+ if (job.Decomb != Decomb.Off)
{
string options;
- if (job.EncodingProfile.Decomb == Decomb.Fast)
+ if (job.Decomb == Decomb.Fast)
{
options = "7:2:6:9:1:80";
}
- else if (job.EncodingProfile.Decomb == Decomb.Bob)
+ else if (job.Decomb == Decomb.Bob)
{
options = "455";
}
else
{
- options = job.EncodingProfile.CustomDecomb;
+ options = job.CustomDecomb;
}
FilterList filterItem = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_DECOMB, Settings = options };
@@ -380,28 +380,28 @@ namespace HandBrake.Interop.Json.Factories
}
// Deinterlace
- if (job.EncodingProfile.Deinterlace != Deinterlace.Off)
+ if (job.Deinterlace != Deinterlace.Off)
{
string options;
- if (job.EncodingProfile.Deinterlace == Deinterlace.Fast)
+ if (job.Deinterlace == Deinterlace.Fast)
{
options = "0";
}
- else if (job.EncodingProfile.Deinterlace == Deinterlace.Slow)
+ else if (job.Deinterlace == Deinterlace.Slow)
{
options = "1";
}
- else if (job.EncodingProfile.Deinterlace == Deinterlace.Slower)
+ else if (job.Deinterlace == Deinterlace.Slower)
{
options = "3";
}
- else if (job.EncodingProfile.Deinterlace == Deinterlace.Bob)
+ else if (job.Deinterlace == Deinterlace.Bob)
{
options = "15";
}
else
{
- options = job.EncodingProfile.CustomDeinterlace;
+ options = job.CustomDeinterlace;
}
FilterList filterItem = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_DEINTERLACE, Settings = options };
@@ -409,8 +409,8 @@ namespace HandBrake.Interop.Json.Factories
}
// VFR / CFR
- int fm = job.EncodingProfile.ConstantFramerate ? 1 : job.EncodingProfile.PeakFramerate ? 2 : 0;
- IntPtr frameratePrt = Marshal.StringToHGlobalAnsi(job.EncodingProfile.Framerate.ToString(CultureInfo.InvariantCulture));
+ int fm = job.ConstantFramerate ? 1 : job.PeakFramerate ? 2 : 0;
+ IntPtr frameratePrt = Marshal.StringToHGlobalAnsi(job.Framerate.ToString(CultureInfo.InvariantCulture));
int vrate = HBFunctions.hb_video_framerate_get_from_name(frameratePrt);
int num;
@@ -433,28 +433,28 @@ namespace HandBrake.Interop.Json.Factories
filter.FilterList.Add(framerateShaper);
// Deblock
- if (job.EncodingProfile.Deblock >= 5)
+ if (job.Deblock >= 5)
{
- FilterList filterItem = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_DEBLOCK, Settings = job.EncodingProfile.Deblock.ToString() };
+ FilterList filterItem = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_DEBLOCK, Settings = job.Deblock.ToString() };
filter.FilterList.Add(filterItem);
}
// Denoise
- if (job.EncodingProfile.Denoise != Denoise.Off)
+ if (job.Denoise != Denoise.Off)
{
- hb_filter_ids id = job.EncodingProfile.Denoise == Denoise.hqdn3d
+ hb_filter_ids id = job.Denoise == Denoise.hqdn3d
? hb_filter_ids.HB_FILTER_HQDN3D
: hb_filter_ids.HB_FILTER_NLMEANS;
string settings;
- if (job.EncodingProfile.Denoise == Denoise.hqdn3d
- && !string.IsNullOrEmpty(job.EncodingProfile.CustomDenoise))
+ if (job.Denoise == Denoise.hqdn3d
+ && !string.IsNullOrEmpty(job.CustomDenoise))
{
- settings = job.EncodingProfile.CustomDenoise;
+ settings = job.CustomDenoise;
}
else
{
- IntPtr settingsPtr = HBFunctions.hb_generate_filter_settings((int)id, job.EncodingProfile.DenoisePreset, job.EncodingProfile.DenoiseTune);
+ IntPtr settingsPtr = HBFunctions.hb_generate_filter_settings((int)id, job.DenoisePreset, job.DenoiseTune);
settings = Marshal.PtrToStringAnsi(settingsPtr);
}
@@ -472,10 +472,10 @@ namespace HandBrake.Interop.Json.Factories
"{0}:{1}:{2}:{3}:{4}:{5}",
resultGeometry.Width,
resultGeometry.Height,
- job.EncodingProfile.Cropping.Top,
- job.EncodingProfile.Cropping.Bottom,
- job.EncodingProfile.Cropping.Left,
- job.EncodingProfile.Cropping.Right)
+ job.Cropping.Top,
+ job.Cropping.Bottom,
+ job.Cropping.Left,
+ job.Cropping.Right)
};
filter.FilterList.Add(cropScale);
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/EncodeJob.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/EncodeJob.cs
index cd54342a7..ce7209948 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/EncodeJob.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/EncodeJob.cs
@@ -9,147 +9,416 @@
namespace HandBrake.Interop.Model
{
- using System;
- using System.Collections.Generic;
- using System.Xml.Serialization;
+ using System.Collections.Generic;
- using HandBrake.Interop.Model.Encoding;
+ using HandBrake.Interop.Model.Encoding;
- /// <summary>
+ /// <summary>
/// The encode job.
/// </summary>
public class EncodeJob
{
- #region Properties
+ /// <summary>
+ /// Initializes a new instance of the <see cref="EncodeJob"/> class.
+ /// </summary>
+ public EncodeJob()
+ {
+ this.Cropping = new Cropping();
+ }
- /// <summary>
- /// Gets or sets the angle to encode. 0 for default, 1+ for specified angle.
- /// </summary>
- public int Angle { get; set; }
+ #region Source
- /// <summary>
- /// Gets or sets the chapter end.
- /// </summary>
- public int ChapterEnd { get; set; }
+ /// <summary>
+ /// Gets or sets the source path.
+ /// </summary>
+ public string SourcePath { get; set; }
- /// <summary>
- /// Gets or sets the chapter start.
- /// </summary>
- public int ChapterStart { get; set; }
+ /// <summary>
+ /// Gets or sets the 1-based index of the title to encode.
+ /// </summary>
+ public int Title { get; set; }
- /// <summary>
- /// Gets or sets the list of chosen audio tracks (1-based)
- /// </summary>
- public List<int> ChosenAudioTracks { get; set; }
+ /// <summary>
+ /// Gets or sets the range type.
+ /// </summary>
+ public VideoRangeType RangeType { get; set; }
- /// <summary>
- /// Gets or sets the custom chapter names.
- /// </summary>
- public List<string> CustomChapterNames { get; set; }
+ /// <summary>
+ /// Gets or sets the seek points.
+ /// This is the number of preview points.
+ /// </summary>
+ public int SeekPoints { get; set; }
- /// <summary>
- /// Gets or sets the encoding profile.
- /// </summary>
- public EncodingProfile EncodingProfile { get; set; }
+ /// <summary>
+ /// Gets or sets the start at preview.
+ /// </summary>
+ public int StartAtPreview { get; set; }
- /// <summary>
- /// Gets or sets the frames end.
- /// </summary>
- public int FramesEnd { get; set; }
+ /// <summary>
+ /// Gets or sets the seconds end.
+ /// </summary>
+ public int SecondsEnd { get; set; }
- /// <summary>
- /// Gets or sets the frames start.
- /// </summary>
- public int FramesStart { get; set; }
+ /// <summary>
+ /// Gets or sets the seconds start.
+ /// </summary>
+ public double SecondsStart { get; set; }
- /// <summary>
- /// Gets or sets the length. The length of video to encode.
- /// </summary>
- [XmlIgnore]
- public TimeSpan Length { get; set; }
+ /// <summary>
+ /// Gets or sets the angle to encode. 0 for default, 1+ for specified angle.
+ /// </summary>
+ public int Angle { get; set; }
- /// <summary>
- /// Gets or sets the output path.
- /// </summary>
- public string OutputPath { get; set; }
+ /// <summary>
+ /// Gets or sets the chapter end.
+ /// </summary>
+ public int ChapterEnd { get; set; }
- /// <summary>
- /// Gets or sets the range type.
- /// </summary>
- public VideoRangeType RangeType { get; set; }
+ /// <summary>
+ /// Gets or sets the chapter start.
+ /// </summary>
+ public int ChapterStart { get; set; }
- /// <summary>
- /// Gets or sets the seek points.
- /// This is the number of preview points.
- /// </summary>
- public int SeekPoints { get; set; }
+ /// <summary>
+ /// Gets or sets the frames end.
+ /// </summary>
+ public int FramesEnd { get; set; }
- /// <summary>
- /// Gets or sets the start at preview.
- /// </summary>
- public int StartAtPreview { get; set; }
+ /// <summary>
+ /// Gets or sets the frames start.
+ /// </summary>
+ public int FramesStart { get; set; }
- /// <summary>
- /// Gets or sets the seconds end.
- /// </summary>
- public int SecondsEnd { get; set; }
+ /// <summary>
+ /// Gets or sets the source type.
+ /// </summary>
+ public SourceType SourceType { get; set; }
- /// <summary>
- /// Gets or sets the seconds start.
- /// </summary>
- public double SecondsStart { get; set; }
+ #endregion
- /// <summary>
- /// Gets or sets the source path.
- /// </summary>
- public string SourcePath { get; set; }
+ #region Destination and Output Settings
- /// <summary>
- /// Gets or sets the source type.
- /// </summary>
- public SourceType SourceType { get; set; }
+ /// <summary>
+ /// Gets or sets the output path.
+ /// </summary>
+ public string OutputPath { get; set; }
- /// <summary>
- /// Gets or sets the subtitles.
- /// </summary>
- public Subtitles Subtitles { get; set; }
+ /// <summary>
+ /// Gets or sets the container name.
+ /// </summary>
+ public string ContainerName { get; set; }
- /// <summary>
- /// Gets or sets the 1-based index of the title to encode.
- /// </summary>
- public int Title { get; set; }
+ /// <summary>
+ /// Gets or sets the preferred extension.
+ /// </summary>
+ public OutputExtension PreferredExtension { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether use default chapter names.
- /// </summary>
- public bool UseDefaultChapterNames { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether include chapter markers.
+ /// </summary>
+ public bool IncludeChapterMarkers { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether to use DXVA hardware decoding.
- /// </summary>
- public bool DxvaDecoding { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether optimize.
+ /// </summary>
+ public bool Optimize { get; set; }
- /// <summary>
- /// Gets or sets the xml length.
- /// </summary>
- [XmlElement("Length")]
- public string XmlLength
- {
- get
- {
- return this.Length.ToString();
- }
- set
- {
- this.Length = TimeSpan.Parse(value);
- }
- }
+ /// <summary>
+ /// Gets or sets a value indicating whether i pod 5 g support.
+ /// </summary>
+ public bool IPod5GSupport { get; set; }
+ #endregion
- #endregion
+ #region Picture Settings
+
+ /// <summary>
+ /// Gets or sets the width.
+ /// </summary>
+ public int Width { get; set; }
+
+ /// <summary>
+ /// Gets or sets the height.
+ /// </summary>
+ public int Height { get; set; }
+
+ /// <summary>
+ /// Gets or sets the max width.
+ /// </summary>
+ public int MaxWidth { get; set; }
+
+ /// <summary>
+ /// Gets or sets the max height.
+ /// </summary>
+ public int MaxHeight { get; set; }
+
+ /// <summary>
+ /// Gets or sets the scale method.
+ /// </summary>
+ public ScaleMethod ScaleMethod { get; set; }
+
+ /// <summary>
+ /// Gets or sets the cropping type.
+ /// </summary>
+ public CroppingType CroppingType { get; set; }
+
+ /// <summary>
+ /// Gets or sets the cropping.
+ /// </summary>
+ public Cropping Cropping { get; set; }
+
+ /// <summary>
+ /// Gets or sets the anamorphic.
+ /// </summary>
+ public Anamorphic Anamorphic { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether use display width.
+ /// </summary>
+ public bool UseDisplayWidth { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display width.
+ /// </summary>
+ public int DisplayWidth { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether keep display aspect.
+ /// </summary>
+ public bool KeepDisplayAspect { get; set; }
+
+ /// <summary>
+ /// Gets or sets the pixel aspect x.
+ /// </summary>
+ public int PixelAspectX { get; set; }
+
+ /// <summary>
+ /// Gets or sets the pixel aspect y.
+ /// </summary>
+ public int PixelAspectY { get; set; }
+
+ /// <summary>
+ /// Gets or sets the modulus.
+ /// </summary>
+ public int Modulus { get; set; }
+
+ /// <summary>
+ /// Gets or sets the rotation.
+ /// </summary>
+ public PictureRotation Rotation { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the picture should be flipped horizontally.
+ /// </summary>
+ public bool FlipHorizontal { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the picture should be flipped vertically.
+ /// </summary>
+ public bool FlipVertical { get; set; }
+ #endregion
+
+ #region Filters
- #region Public Methods
+ /// <summary>
+ /// Gets or sets the deinterlace.
+ /// </summary>
+ public Deinterlace Deinterlace { get; set; }
- /// <summary>
+ /// <summary>
+ /// Gets or sets the custom deinterlace.
+ /// </summary>
+ public string CustomDeinterlace { get; set; }
+
+ /// <summary>
+ /// Gets or sets the decomb.
+ /// </summary>
+ public Decomb Decomb { get; set; }
+
+ /// <summary>
+ /// Gets or sets the custom decomb.
+ /// </summary>
+ public string CustomDecomb { get; set; }
+
+ /// <summary>
+ /// Gets or sets the detelecine.
+ /// </summary>
+ public Detelecine Detelecine { get; set; }
+
+ /// <summary>
+ /// Gets or sets the custom detelecine.
+ /// </summary>
+ public string CustomDetelecine { get; set; }
+
+ /// <summary>
+ /// Gets or sets the denoise.
+ /// </summary>
+ public Denoise Denoise { get; set; }
+
+ /// <summary>
+ /// Gets or sets the denoise preset name.
+ /// </summary>
+ public string DenoisePreset { get; set; }
+
+ /// <summary>
+ /// Gets or sets the denoise tune name.
+ /// </summary>
+ public string DenoiseTune { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether we should use the provided
+ /// custom denoise string or we should use the preset and tune.
+ /// </summary>
+ public bool UseCustomDenoise { get; set; }
+
+ /// <summary>
+ /// Gets or sets the custom denoise.
+ /// </summary>
+ public string CustomDenoise { get; set; }
+
+ /// <summary>
+ /// Gets or sets the deblock.
+ /// </summary>
+ public int Deblock { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the grayscale filter will be applied.
+ /// </summary>
+ public bool Grayscale { get; set; }
+ #endregion
+
+ #region Video
+
+ /// <summary>
+ /// Gets or sets the video encoder.
+ /// </summary>
+ public string VideoEncoder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video encoder options.
+ /// </summary>
+ public string VideoOptions { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video encoder profile name.
+ /// </summary>
+ public string VideoProfile { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video encoder preset name.
+ /// </summary>
+ public string VideoPreset { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video encoder tunes.
+ /// </summary>
+ public List<string> VideoTunes { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video encoder level.
+ /// </summary>
+ public string VideoLevel { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to use QSV decoding.
+ /// </summary>
+ public bool QsvDecode { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video encode rate type.
+ /// </summary>
+ public VideoEncodeRateType VideoEncodeRateType { get; set; }
+
+ /// <summary>
+ /// Gets or sets the quality.
+ /// </summary>
+ public double Quality { get; set; }
+
+ /// <summary>
+ /// Gets or sets the target size.
+ /// </summary>
+ public int TargetSize { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video bitrate.
+ /// </summary>
+ public int VideoBitrate { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether two pass.
+ /// </summary>
+ public bool TwoPass { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether turbo first pass.
+ /// </summary>
+ public bool TurboFirstPass { get; set; }
+
+ /// <summary>
+ /// Gets or sets the framerate.
+ /// </summary>
+ public double Framerate { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether constant framerate.
+ /// </summary>
+ public bool ConstantFramerate { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether peak framerate.
+ /// </summary>
+ public bool PeakFramerate { get; set; }
+ #endregion
+
+ #region Audio
+
+ /// <summary>
+ /// Gets or sets the audio encodings.
+ /// </summary>
+ public List<AudioEncoding> AudioEncodings { get; set; }
+
+ /// <summary>
+ /// Gets or sets the list of chosen audio tracks (1-based)
+ /// </summary>
+ public List<int> ChosenAudioTracks { get; set; }
+
+ /// <summary>
+ /// Gets or sets the audio encoder fallback.
+ /// </summary>
+ public string AudioEncoderFallback { get; set; }
+ #endregion
+
+ #region Chapter Markers
+
+ /// <summary>
+ /// Gets or sets a value indicating whether use default chapter names.
+ /// </summary>
+ public bool UseDefaultChapterNames { get; set; }
+
+ /// <summary>
+ /// Gets or sets the custom chapter names.
+ /// </summary>
+ public List<string> CustomChapterNames { get; set; }
+ #endregion
+
+ #region Subtitles
+
+ /// <summary>
+ /// Gets or sets the subtitles.
+ /// </summary>
+ public Subtitles Subtitles { get; set; }
+ #endregion
+
+ #region Additional Args
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to use DXVA hardware decoding.
+ /// </summary>
+ public bool DxvaDecoding { get; set; }
+ #endregion
+
+ #region Public Methods
+
+ /// <summary>
/// The clone.
/// </summary>
/// <returns>
@@ -172,11 +441,66 @@ namespace HandBrake.Interop.Model
FramesEnd = this.FramesEnd,
ChosenAudioTracks = new List<int>(this.ChosenAudioTracks),
Subtitles = this.Subtitles,
- UseDefaultChapterNames = this.UseDefaultChapterNames,
- DxvaDecoding = this.DxvaDecoding,
+ UseDefaultChapterNames = this.UseDefaultChapterNames,
+ DxvaDecoding = this.DxvaDecoding,
OutputPath = this.OutputPath,
- EncodingProfile = this.EncodingProfile,
- Length = this.Length
+
+ ContainerName = this.ContainerName,
+ PreferredExtension = this.PreferredExtension,
+ IncludeChapterMarkers = this.IncludeChapterMarkers,
+ Optimize = this.Optimize,
+ IPod5GSupport = this.IPod5GSupport,
+
+ Width = this.Width,
+ Height = this.Height,
+ MaxWidth = this.MaxWidth,
+ MaxHeight = this.MaxHeight,
+ ScaleMethod = this.ScaleMethod,
+ CroppingType = this.CroppingType,
+ Cropping = this.Cropping.Clone(),
+ Anamorphic = this.Anamorphic,
+ UseDisplayWidth = this.UseDisplayWidth,
+ DisplayWidth = this.DisplayWidth,
+ KeepDisplayAspect = this.KeepDisplayAspect,
+ PixelAspectX = this.PixelAspectX,
+ PixelAspectY = this.PixelAspectY,
+ Modulus = this.Modulus,
+ Rotation = this.Rotation,
+ FlipHorizontal = this.FlipHorizontal,
+ FlipVertical = this.FlipVertical,
+
+ Deinterlace = this.Deinterlace,
+ CustomDeinterlace = this.CustomDeinterlace,
+ Decomb = this.Decomb,
+ CustomDecomb = this.CustomDecomb,
+ Detelecine = this.Detelecine,
+ CustomDetelecine = this.CustomDetelecine,
+ Denoise = this.Denoise,
+ DenoisePreset = this.DenoisePreset,
+ DenoiseTune = this.DenoiseTune,
+ UseCustomDenoise = this.UseCustomDenoise,
+ CustomDenoise = this.CustomDenoise,
+ Deblock = this.Deblock,
+ Grayscale = this.Grayscale,
+
+ VideoEncoder = this.VideoEncoder,
+ VideoOptions = this.VideoOptions,
+ VideoProfile = this.VideoProfile,
+ VideoPreset = this.VideoPreset,
+ VideoTunes = this.VideoTunes,
+ VideoLevel = this.VideoLevel,
+ QsvDecode = this.QsvDecode,
+ VideoEncodeRateType = this.VideoEncodeRateType,
+ Quality = this.Quality,
+ TargetSize = this.TargetSize,
+ VideoBitrate = this.VideoBitrate,
+ TwoPass = this.TwoPass,
+ TurboFirstPass = this.TurboFirstPass,
+ Framerate = this.Framerate,
+ ConstantFramerate = this.ConstantFramerate,
+
+ AudioEncodings = new List<AudioEncoding>(this.AudioEncodings),
+ AudioEncoderFallback = this.AudioEncoderFallback
};
return clone;
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs
deleted file mode 100644
index 581b9364a..000000000
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs
+++ /dev/null
@@ -1,381 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="EncodingProfile.cs" company="HandBrake Project (http://handbrake.fr)">
-// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
-// </copyright>
-// <summary>
-// Defines the EncodingProfile type.
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrake.Interop.Model.Encoding
-{
- using System.Collections.Generic;
-
- using HandBrake.Interop.Model;
-
- /// <summary>
- /// The encoding profile.
- /// </summary>
- public class EncodingProfile
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="EncodingProfile"/> class.
- /// </summary>
- public EncodingProfile()
- {
- this.Cropping = new Cropping();
- }
-
- #region Destination and Output Settings
-
- /// <summary>
- /// Gets or sets the container name.
- /// </summary>
- public string ContainerName { get; set; }
-
- /// <summary>
- /// Gets or sets the preferred extension.
- /// </summary>
- public OutputExtension PreferredExtension { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether include chapter markers.
- /// </summary>
- public bool IncludeChapterMarkers { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether optimize.
- /// </summary>
- public bool Optimize { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether i pod 5 g support.
- /// </summary>
- public bool IPod5GSupport { get; set; }
- #endregion
-
- #region Picture Settings
-
- /// <summary>
- /// Gets or sets the width.
- /// </summary>
- public int Width { get; set; }
-
- /// <summary>
- /// Gets or sets the height.
- /// </summary>
- public int Height { get; set; }
-
- /// <summary>
- /// Gets or sets the max width.
- /// </summary>
- public int MaxWidth { get; set; }
-
- /// <summary>
- /// Gets or sets the max height.
- /// </summary>
- public int MaxHeight { get; set; }
-
- /// <summary>
- /// Gets or sets the scale method.
- /// </summary>
- public ScaleMethod ScaleMethod { get; set; }
-
- /// <summary>
- /// Gets or sets the cropping type.
- /// </summary>
- public CroppingType CroppingType { get; set; }
-
- /// <summary>
- /// Gets or sets the cropping.
- /// </summary>
- public Cropping Cropping { get; set; }
-
- /// <summary>
- /// Gets or sets the anamorphic.
- /// </summary>
- public Anamorphic Anamorphic { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether use display width.
- /// </summary>
- public bool UseDisplayWidth { get; set; }
-
- /// <summary>
- /// Gets or sets the display width.
- /// </summary>
- public int DisplayWidth { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether keep display aspect.
- /// </summary>
- public bool KeepDisplayAspect { get; set; }
-
- /// <summary>
- /// Gets or sets the pixel aspect x.
- /// </summary>
- public int PixelAspectX { get; set; }
-
- /// <summary>
- /// Gets or sets the pixel aspect y.
- /// </summary>
- public int PixelAspectY { get; set; }
-
- /// <summary>
- /// Gets or sets the modulus.
- /// </summary>
- public int Modulus { get; set; }
-
- /// <summary>
- /// Gets or sets the rotation.
- /// </summary>
- public PictureRotation Rotation { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the picture should be flipped horizontally.
- /// </summary>
- public bool FlipHorizontal { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the picture should be flipped vertically.
- /// </summary>
- public bool FlipVertical { get; set; }
- #endregion
-
- #region Filters
-
- /// <summary>
- /// Gets or sets the deinterlace.
- /// </summary>
- public Deinterlace Deinterlace { get; set; }
-
- /// <summary>
- /// Gets or sets the custom deinterlace.
- /// </summary>
- public string CustomDeinterlace { get; set; }
-
- /// <summary>
- /// Gets or sets the decomb.
- /// </summary>
- public Decomb Decomb { get; set; }
-
- /// <summary>
- /// Gets or sets the custom decomb.
- /// </summary>
- public string CustomDecomb { get; set; }
-
- /// <summary>
- /// Gets or sets the detelecine.
- /// </summary>
- public Detelecine Detelecine { get; set; }
-
- /// <summary>
- /// Gets or sets the custom detelecine.
- /// </summary>
- public string CustomDetelecine { get; set; }
-
- /// <summary>
- /// Gets or sets the denoise.
- /// </summary>
- public Denoise Denoise { get; set; }
-
- /// <summary>
- /// Gets or sets the denoise preset name.
- /// </summary>
- public string DenoisePreset { get; set; }
-
- /// <summary>
- /// Gets or sets the denoise tune name.
- /// </summary>
- public string DenoiseTune { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether we should use the provided
- /// custom denoise string or we should use the preset and tune.
- /// </summary>
- public bool UseCustomDenoise { get; set; }
-
- /// <summary>
- /// Gets or sets the custom denoise.
- /// </summary>
- public string CustomDenoise { get; set; }
-
- /// <summary>
- /// Gets or sets the deblock.
- /// </summary>
- public int Deblock { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the grayscale filter will be applied.
- /// </summary>
- public bool Grayscale { get; set; }
- #endregion
-
- #region Video
-
- /// <summary>
- /// Gets or sets the video encoder.
- /// </summary>
- public string VideoEncoder { get; set; }
-
- /// <summary>
- /// Gets or sets the video encoder options.
- /// </summary>
- public string VideoOptions { get; set; }
-
- /// <summary>
- /// Gets or sets the video encoder profile name.
- /// </summary>
- public string VideoProfile { get; set; }
-
- /// <summary>
- /// Gets or sets the video encoder preset name.
- /// </summary>
- public string VideoPreset { get; set; }
-
- /// <summary>
- /// Gets or sets the video encoder tunes.
- /// </summary>
- public List<string> VideoTunes { get; set; }
-
- /// <summary>
- /// Gets or sets the video encoder level.
- /// </summary>
- public string VideoLevel { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to use QSV decoding.
- /// </summary>
- public bool QsvDecode { get; set; }
-
- /// <summary>
- /// Gets or sets the video encode rate type.
- /// </summary>
- public VideoEncodeRateType VideoEncodeRateType { get; set; }
-
- /// <summary>
- /// Gets or sets the quality.
- /// </summary>
- public double Quality { get; set; }
-
- /// <summary>
- /// Gets or sets the target size.
- /// </summary>
- public int TargetSize { get; set; }
-
- /// <summary>
- /// Gets or sets the video bitrate.
- /// </summary>
- public int VideoBitrate { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether two pass.
- /// </summary>
- public bool TwoPass { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether turbo first pass.
- /// </summary>
- public bool TurboFirstPass { get; set; }
-
- /// <summary>
- /// Gets or sets the framerate.
- /// </summary>
- public double Framerate { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether constant framerate.
- /// </summary>
- public bool ConstantFramerate { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether peak framerate.
- /// </summary>
- public bool PeakFramerate { get; set; }
- #endregion
-
- #region Audio
-
- /// <summary>
- /// Gets or sets the audio encodings.
- /// </summary>
- public List<AudioEncoding> AudioEncodings { get; set; }
-
- /// <summary>
- /// Gets or sets the audio encoder fallback.
- /// </summary>
- public string AudioEncoderFallback { get; set; }
- #endregion
-
- /// <summary>
- /// The clone.
- /// </summary>
- /// <returns>
- /// The <see cref="EncodingProfile"/>.
- /// </returns>
- public EncodingProfile Clone()
- {
- var profile = new EncodingProfile
- {
- ContainerName = this.ContainerName,
- PreferredExtension = this.PreferredExtension,
- IncludeChapterMarkers = this.IncludeChapterMarkers,
- Optimize = this.Optimize,
- IPod5GSupport = this.IPod5GSupport,
-
- Width = this.Width,
- Height = this.Height,
- MaxWidth = this.MaxWidth,
- MaxHeight = this.MaxHeight,
- ScaleMethod = this.ScaleMethod,
- CroppingType = this.CroppingType,
- Cropping = this.Cropping.Clone(),
- Anamorphic = this.Anamorphic,
- UseDisplayWidth = this.UseDisplayWidth,
- DisplayWidth = this.DisplayWidth,
- KeepDisplayAspect = this.KeepDisplayAspect,
- PixelAspectX = this.PixelAspectX,
- PixelAspectY = this.PixelAspectY,
- Modulus = this.Modulus,
- Rotation = this.Rotation,
- FlipHorizontal = this.FlipHorizontal,
- FlipVertical = this.FlipVertical,
-
- Deinterlace = this.Deinterlace,
- CustomDeinterlace = this.CustomDeinterlace,
- Decomb = this.Decomb,
- CustomDecomb = this.CustomDecomb,
- Detelecine = this.Detelecine,
- CustomDetelecine = this.CustomDetelecine,
- Denoise = this.Denoise,
- DenoisePreset = this.DenoisePreset,
- DenoiseTune = this.DenoiseTune,
- UseCustomDenoise = this.UseCustomDenoise,
- CustomDenoise = this.CustomDenoise,
- Deblock = this.Deblock,
- Grayscale = this.Grayscale,
-
- VideoEncoder = this.VideoEncoder,
- VideoOptions = this.VideoOptions,
- VideoProfile = this.VideoProfile,
- VideoPreset = this.VideoPreset,
- VideoTunes = this.VideoTunes,
- VideoLevel = this.VideoLevel,
- QsvDecode = this.QsvDecode,
- VideoEncodeRateType = this.VideoEncodeRateType,
- Quality = this.Quality,
- TargetSize = this.TargetSize,
- VideoBitrate = this.VideoBitrate,
- TwoPass = this.TwoPass,
- TurboFirstPass = this.TurboFirstPass,
- Framerate = this.Framerate,
- ConstantFramerate = this.ConstantFramerate,
-
- AudioEncodings = new List<AudioEncoding>(this.AudioEncodings),
- AudioEncoderFallback = this.AudioEncoderFallback
- };
-
- return profile;
- }
- }
-}