diff options
author | sr55 <[email protected]> | 2011-10-30 17:58:53 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-10-30 17:58:53 +0000 |
commit | 8b8ebd1f417c6ef65ab431a36fad0bbf0e2daf58 (patch) | |
tree | 37637e767ceac63a4bb48b8a99c17b196128b846 /win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding | |
parent | 2f0f372b09897e703a8d01fe9774aa59c936a013 (diff) |
Interop: Updates to the Interop Library to use the new methods to get at the Audio/Video encoder information from libhb. Patch by RandomEngy.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4329 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding')
10 files changed, 170 insertions, 17 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Anamorphic.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Anamorphic.cs index 2051c2b63..2d20c4376 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Anamorphic.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Anamorphic.cs @@ -9,9 +9,9 @@ namespace HandBrake.Interop.Model.Encoding
{
- using System.ComponentModel.DataAnnotations;
+ using System.ComponentModel.DataAnnotations;
- public enum Anamorphic
+ public enum Anamorphic
{
[Display(Name = "None")]
None = 0,
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncodeRateType.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncodeRateType.cs new file mode 100644 index 000000000..ca162a47f --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncodeRateType.cs @@ -0,0 +1,19 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="AudioEncodeRateType.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> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Model.Encoding +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + + public enum AudioEncodeRateType + { + Bitrate, + Quality + } +} diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs index b5ab3b4bc..492d51d9a 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs @@ -2,9 +2,6 @@ // <copyright file="AudioEncoder.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 AudioEncoder type.
-// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.Interop.Model.Encoding
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoding.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoding.cs index ea11d182e..c6ac28ea5 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoding.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoding.cs @@ -17,6 +17,15 @@ namespace HandBrake.Interop.Model.Encoding public class AudioEncoding
{
/// <summary>
+ /// Initializes a new instance of the AudioEncoding class.
+ /// </summary>
+ public AudioEncoding()
+ {
+ // Initialize to -1 to differentiate a compression of 0 from uninitialized.
+ this.Compression = -1;
+ }
+
+ /// <summary>
/// Gets or sets the chosen track to apply the encoding to.
/// </summary>
/// <remarks>1-based index. 0 means apply to all tracks.</remarks>
@@ -25,7 +34,12 @@ namespace HandBrake.Interop.Model.Encoding /// <summary>
/// Gets or sets the encoder to use.
/// </summary>
- public AudioEncoder Encoder { get; set; }
+ public string Encoder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the encode rate type (bitrate or quality).
+ /// </summary>
+ public AudioEncodeRateType EncodeRateType { get; set; }
/// <summary>
/// Gets or sets the bitrate (in kbps) of this track.
@@ -33,9 +47,19 @@ namespace HandBrake.Interop.Model.Encoding public int Bitrate { get; set; }
/// <summary>
+ /// Gets or sets the target audio quality for this track.
+ /// </summary>
+ public float Quality { get; set; }
+
+ /// <summary>
+ /// Gets or sets the target audio compression for this track.
+ /// </summary>
+ public float Compression { get; set; }
+
+ /// <summary>
/// Gets or sets the mixdown.
/// </summary>
- public Mixdown Mixdown { get; set; }
+ public string Mixdown { get; set; }
/// <summary>
/// Gets or sets the sample rate. Obsolete. Use SampleRateRaw instead.
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Container.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Container.cs new file mode 100644 index 000000000..2a526170e --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/Container.cs @@ -0,0 +1,22 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="Container.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> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Model.Encoding +{ + using System; + using System.ComponentModel.DataAnnotations; + + [Flags] + public enum Container + { + None = 0x0, + + [Display(Name = "MP4")] + Mp4, + [Display(Name = "MKV")] + Mkv + } +} diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs index d4f85ca81..25da728ef 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs @@ -20,7 +20,7 @@ namespace HandBrake.Interop.Model.Encoding this.Cropping = new Cropping();
}
- public OutputFormat OutputFormat { get; set; }
+ public Container OutputFormat { get; set; }
public OutputExtension PreferredExtension { get; set; }
public bool IncludeChapterMarkers { get; set; }
public bool LargeFile { get; set; }
@@ -52,7 +52,7 @@ namespace HandBrake.Interop.Model.Encoding public int Deblock { get; set; }
public bool Grayscale { get; set; }
- public VideoEncoder VideoEncoder { get; set; }
+ public string VideoEncoder { get; set; }
public string X264Options { get; set; }
public string X264Profile { get; set; }
public string X264Preset { get; set; }
@@ -67,7 +67,7 @@ namespace HandBrake.Interop.Model.Encoding public bool PeakFramerate { get; set; }
public List<AudioEncoding> AudioEncodings { get; set; }
- public AudioEncoder AudioEncoderFallback { get; set; }
+ public string AudioEncoderFallback { get; set; }
public EncodingProfile Clone()
{
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBAudioEncoder.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBAudioEncoder.cs new file mode 100644 index 000000000..19645a70b --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBAudioEncoder.cs @@ -0,0 +1,53 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="HBAudioEncoder.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> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Model.Encoding +{ + using HandBrake.Interop.HbLib; + + public class HBAudioEncoder + { + public string ShortName { get; set; } + + public string DisplayName { get; set; } + + public int Id { get; set; } + + public Container CompatibleContainers { get; set; } + + public bool SupportsQuality + { + get + { + return this.QualityLimits.High >= 0; + } + } + + public RangeLimits QualityLimits { get; set; } + + public float DefaultQuality { get; set; } + + public bool SupportsCompression + { + get + { + return this.CompressionLimits.High >= 0; + } + } + + public RangeLimits CompressionLimits { get; set; } + + public float DefaultCompression { get; set; } + + public bool IsPassthrough + { + get + { + return (this.Id & NativeConstants.HB_ACODEC_PASS_FLAG) > 0; + } + } + } +} diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBMixdown.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBMixdown.cs new file mode 100644 index 000000000..493beb9fa --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBMixdown.cs @@ -0,0 +1,22 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="HBMixdown.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> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Model.Encoding +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + + public class HBMixdown + { + public string ShortName { get; set; } + + public string DisplayName { get; set; } + + public int Id { get; set; } + } +} diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBVideoEncoder.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBVideoEncoder.cs new file mode 100644 index 000000000..9e04252aa --- /dev/null +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/HBVideoEncoder.cs @@ -0,0 +1,19 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="HBVideoEncoder.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> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Model.Encoding +{ + public class HBVideoEncoder + { + public string ShortName { get; set; } + + public string DisplayName { get; set; } + + public int Id { get; set; } + + public Container CompatibleContainers { get; set; } + } +} diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/VideoEncoder.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/VideoEncoder.cs index 1e7b8005c..31cc3d599 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/VideoEncoder.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/VideoEncoder.cs @@ -2,16 +2,13 @@ // <copyright file="VideoEncoder.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 VideoEncoder type.
-// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.Interop.Model.Encoding
{
- using System.ComponentModel.DataAnnotations;
+ using System.ComponentModel.DataAnnotations;
- public enum VideoEncoder
+ public enum VideoEncoder
{
[Display(Name = "H.264 (x264)")]
X264 = 0,
@@ -19,8 +16,8 @@ namespace HandBrake.Interop.Model.Encoding [Display(Name = "MPEG-4 (FFmpeg)")]
FFMpeg,
- [Display(Name = "MPEG-2 (FFmpeg)")]
- FFMpeg2,
+ [Display(Name = "MPEG-2 (FFmpeg)")]
+ FFMpeg2,
[Display(Name = "VP3 (Theora)")]
Theora
|