Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Integrated changes from upstream

Merge remote-tracking branch 'upstream/master'

Conflicts:
	Source/Zencoder/Output.cs
  • Loading branch information...
commit 42e721c93933fa708119d10bd00f56bc3431c0fb 2 parents 199d346 + 81e5e15
@CurryEleison authored
View
4 Source/SolutionInfo.cs
@@ -17,5 +17,5 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
-[assembly: AssemblyVersion("1.1.5.1")]
-[assembly: AssemblyFileVersion("1.1.5.1")]
+[assembly: AssemblyVersion("1.2.0.0")]
+[assembly: AssemblyFileVersion("1.2.0.0")]
View
9 Source/Zencoder.Test/OutputTests.cs
@@ -195,6 +195,7 @@ public void OutputSegmentedStreamsToJson()
public void OutputThumbnailsToJson()
{
const string One = @"{{""input"":""http://example.com/file-name.avi"",""outputs"":[{{""thumbnails"":[{{""base_url"":""s3://bucket/directory"",""height"":120,""label"":null,""number"":6,""prefix"":""custom"",""width"":160}}]}}],""api_key"":""{0}""}}";
+ const string Two = @"{{""input"":""http://example.com/file-name.avi"",""outputs"":[{{""thumbnails"":[{{""headers"":{{""x-amz-acl"":""public-read-write""}},""base_url"":""s3://bucket/directory"",""filename"":""{{{{number}}}}_{{{{width}}}}x{{{{height}}}}-thumbnail"",""height"":120,""interval_in_frames"":10,""label"":null,""prefix"":""custom"",""width"":160}}]}}],""api_key"":""{0}""}}";
Thumbnails thumbs = new Thumbnails()
{
@@ -214,6 +215,14 @@ public void OutputThumbnailsToJson()
};
Assert.AreEqual(string.Format(CultureInfo.InvariantCulture, One, ApiKey), request.ToJson());
+
+ thumbs = thumbs.WithIntervalInFrames(10);
+ thumbs.FileName = "{{number}}_{{width}}x{{height}}-thumbnail";
+ thumbs.Headers["x-amz-acl"] = "public-read-write";
+
+ output.Thumbnails = new Thumbnails[] { thumbs };
+
+ Assert.AreEqual(string.Format(CultureInfo.InvariantCulture, Two, ApiKey), request.ToJson());
}
/// <summary>
View
5 Source/Zencoder/AudioCodec.cs
@@ -21,6 +21,11 @@ public enum AudioCodec
Aac = 0,
/// <summary>
+ /// Identifies the AMR audio codec.
+ /// </summary>
+ Amr,
+
+ /// <summary>
/// Identifies that MP3 audio codec.
/// </summary>
Mp3,
View
38 Source/Zencoder/DenoiseFilter.cs
@@ -0,0 +1,38 @@
+//-----------------------------------------------------------------------
+// <copyright file="DenoiseFilter.cs" company="Tasty Codes">
+// Copyright (c) 2010 Chad Burggraf.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace Zencoder
+{
+ using System;
+ using Newtonsoft.Json;
+
+ /// <summary>
+ /// Defins the possible denoise filter values.
+ /// </summary>
+ [JsonConverter(typeof(EnumLowercaseJsonConverter))]
+ public enum DenoiseFilter
+ {
+ /// <summary>
+ /// Identifies the weak denoise filter.
+ /// </summary>
+ Weak,
+
+ /// <summary>
+ /// Identifies the medium denoise filter.
+ /// </summary>
+ Medium,
+
+ /// <summary>
+ /// Identifies the strong denoise filter.
+ /// </summary>
+ Strong,
+
+ /// <summary>
+ /// Identifies the strongest denoise filter.
+ /// </summary>
+ Strongest
+ }
+}
View
59 Source/Zencoder/DeviceProfile.cs
@@ -0,0 +1,59 @@
+//-----------------------------------------------------------------------
+// <copyright file="DeviceProfile.cs" company="Tasty Codes">
+// Copyright (c) 2011 Chad Burggraf.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace Zencoder
+{
+ using System;
+ using System.ComponentModel;
+
+ /// <summary>
+ /// Defines the possible output device profile shortcuts.
+ /// </summary>
+ public enum DeviceProfile
+ {
+ /// <summary>
+ /// Identifies the mobile/advanced profile.
+ /// </summary>
+ [Description("mobile/advanced")]
+ MobileAdvanced,
+
+ /// <summary>
+ /// Identifies the mobile/baseline profile.
+ /// </summary>
+ [Description("mobile/baseline")]
+ MobileBaseline,
+
+ /// <summary>
+ /// Identifies the mobile/legacy profile.
+ /// </summary>
+ [Description("mobile/legacy")]
+ MobileLegacy,
+
+ /// <summary>
+ /// Identifies the v1/mobile/advanced profile.
+ /// </summary>
+ [Description("v1/mobile/advanced")]
+ V1MobileAdvanced,
+
+ /// <summary>
+ /// Identifies the v1/mobile/baseline profile.
+ /// </summary>
+ [Description("v1/mobile/baseline")]
+ V1MobileBaseline,
+
+ /// <summary>
+ /// Identifies the v1/mobile/legacy profile.
+ /// </summary>
+ [Description("v1/mobile/legacy")]
+ V1MobileLegacy,
+
+ /// <summary>
+ /// Identifies the v2/mobile/legacy profile.
+ /// </summary>
+ [Description("v2/mobile/legacy")]
+ V2MobileLegacy
+ }
+}
View
2  Source/Zencoder/EnumDescriptionConverter.cs
@@ -23,7 +23,7 @@ public class EnumDescriptionConverter : JsonConverter
/// <returns>True if this instance can convert the specified object type, otherwise false.</returns>
public override bool CanConvert(Type objectType)
{
- return objectType.IsEnum;
+ return objectType.IsEnum || objectType.IsNullableEnum();
}
/// <summary>
View
2  Source/Zencoder/EnumIntJsonConverter.cs
@@ -23,7 +23,7 @@ public class EnumIntJsonConverter : JsonConverter
/// <returns>True if this instance can convert the specified object type, otherwise false.</returns>
public override bool CanConvert(Type objectType)
{
- return objectType.IsEnum;
+ return objectType.IsEnum || objectType.IsNullableEnum();
}
/// <summary>
View
2  Source/Zencoder/EnumLowercaseJsonConverter.cs
@@ -21,7 +21,7 @@ public class EnumLowercaseJsonConverter : JsonConverter
/// <returns>True if this instance can convert the specified object type, otherwise false.</returns>
public override bool CanConvert(Type objectType)
{
- return objectType.IsEnum;
+ return objectType.IsEnum || objectType.IsNullableEnum();
}
/// <summary>
View
2  Source/Zencoder/EnumLowercaseUnderscoreJsonConverter.cs
@@ -21,7 +21,7 @@ public class EnumLowercaseUnderscoreJsonConverter : JsonConverter
/// <returns>True if this instance can convert the specified object type, otherwise false.</returns>
public override bool CanConvert(Type objectType)
{
- return objectType.IsEnum;
+ return objectType.IsEnum || objectType.IsNullableEnum();
}
/// <summary>
View
11 Source/Zencoder/Enums.cs
@@ -81,6 +81,17 @@ public static object EnumFromDescription(this string value, Type enumType)
}
/// <summary>
+ /// Gets a value indicating whether the type is a nullable enum.
+ /// </summary>
+ /// <param name="objectType">The object type to check.</param>
+ /// <returns>True if the type is a nullable enum, false otherwise.</returns>
+ public static bool IsNullableEnum(this Type objectType)
+ {
+ Type ut = Nullable.GetUnderlyingType(objectType);
+ return ut != null && ut.IsEnum;
+ }
+
+ /// <summary>
/// Gets the string representation of the enum value, substituting its
/// description attribute value if set.
/// </summary>
View
43 Source/Zencoder/Job.cs
@@ -27,6 +27,14 @@ public class Job
public DateTime CreatedAt { get; set; }
/// <summary>
+ /// Gets or sets the number of simultaneous connections for Zencoder to use when
+ /// downloading in input file. When not specified, defaults to 5. Valid values range
+ /// from 0 to 25.
+ /// </summary>
+ [JsonProperty("download_connections", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public int? DownloadConnections { get; set; }
+
+ /// <summary>
/// Gets or sets the date the job was finished.
/// </summary>
[JsonProperty("finished_at")]
@@ -34,6 +42,12 @@ public class Job
public DateTime? FinishedAt { get; set; }
/// <summary>
+ /// Gets or sets an arbtrary string value to create a grouping for reporting purposes.
+ /// </summary>
+ [JsonProperty("grouping", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)]
+ public string Grouping { get; set; }
+
+ /// <summary>
/// Gets or sets the job ID.
/// </summary>
[JsonProperty("id")]
@@ -46,6 +60,14 @@ public class Job
public InputMediaFile InputMediaFile { get; set; }
/// <summary>
+ /// Gets or sets a value indicating whether to mock the job,
+ /// returning the normal response without actually creating a job.
+ /// </summary>
+ [JsonProperty("mock", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ [JsonConverter(typeof(BooleanConverter))]
+ public bool? Mock { get; set; }
+
+ /// <summary>
/// Gets or sets the job's output media files.
/// </summary>
[JsonProperty("output_media_files")]
@@ -56,11 +78,17 @@ public OutputMediaFile[] OutputMediaFiles
}
/// <summary>
- /// Gets or sets the date the job was submitted.
+ /// Gets or sets an optional arbitrary string value to stor alongside the job.
/// </summary>
- [JsonProperty("submitted_at")]
- [JsonConverter(typeof(IsoDateTimeConverter))]
- public DateTime SubmittedAt { get; set; }
+ [JsonProperty("pass_through", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)]
+ public string PassThrough { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether privacy mode is enabled for the job.
+ /// </summary>
+ [JsonProperty("private", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ [JsonConverter(typeof(BooleanConverter))]
+ public bool? Private { get; set; }
/// <summary>
/// Gets or sets the current job state.
@@ -69,6 +97,13 @@ public OutputMediaFile[] OutputMediaFiles
public JobState State { get; set; }
/// <summary>
+ /// Gets or sets the date the job was submitted.
+ /// </summary>
+ [JsonProperty("submitted_at")]
+ [JsonConverter(typeof(IsoDateTimeConverter))]
+ public DateTime SubmittedAt { get; set; }
+
+ /// <summary>
/// Gets or sets a value indicating whether the job is in test mode.
/// </summary>
[JsonProperty("test")]
View
71 Source/Zencoder/Output.cs
@@ -18,6 +18,9 @@ namespace Zencoder
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class Output
{
+ [JsonProperty("headers", NullValueHandling = NullValueHandling.Ignore)]
+ private IDictionary<string, string> headers;
+
/// <summary>
/// Gets or sets the collection of custom S3 access grants to apply to the output
/// if its destination is S3.
@@ -70,6 +73,13 @@ public class Output
public int? AudioSampleRate { get; set; }
/// <summary>
+ /// Gets or sets a value indicating whether to apply an auto-level filter to the output video.
+ /// </summary>
+ [JsonProperty("auto_level", NullValueHandling = NullValueHandling.Ignore)]
+ [JsonConverter(typeof(BooleanConverter))]
+ public bool? AutoLevel { get; set; }
+
+ /// <summary>
/// Gets or sets a directory to place the output file in, but not the file name.
/// If no <see cref="FileName"/> is specified, a random one will be generated with the appropriate extension.
/// </summary>
@@ -105,11 +115,11 @@ public class Output
public bool? ConstantBitrate { get; set; }
/// <summary>
- /// Get or sets a value indicating whether to deblock in video processing
+ /// Gets or sets a value indicating whether to apply a deblocking filter to the output video.
/// </summary>
[JsonProperty("deblock", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(BooleanConverter))]
- public bool? DeBlock { get; set; }
+ public bool? Deblock { get; set; }
/// <summary>
/// Gets or sets a value that acts as a divisor for the input frame rate.
@@ -125,6 +135,21 @@ public class Output
public Deinterlace? Deinterlace { get; set; }
/// <summary>
+ /// Gets or sets the denoise filter to apply to the output video, if applicable.
+ /// </summary>
+ [JsonProperty("denoise", NullValueHandling = NullValueHandling.Ignore)]
+ public DenoiseFilter? Denoise { get; set; }
+
+ /// <summary>
+ /// Gets or sets a shortcut device profile to use for the output.
+ /// See https://app.zencoder.com/docs/api/encoding/general-output-settings/device-profile
+ /// for more details on device profiles.
+ /// </summary>
+ [JsonProperty("device_profile", NullValueHandling = NullValueHandling.Ignore)]
+ [JsonConverter(typeof(EnumDescriptionConverter))]
+ public DeviceProfile? DeviceProfile { get; set; }
+
+ /// <summary>
/// Gets or sets the file name of the finished file. If supplied and <see cref="BaseUrl"/>
/// is empty, Zencoder will store a file with this name in an S3 bucket for download.
/// </summary>
@@ -132,6 +157,15 @@ public class Output
public string FileName { get; set; }
/// <summary>
+ /// Gets or sets a value indicating whether to enable or disable variability in keyframe
+ /// generation when using <see cref="KeyframeInterval"/>. When not set, defaults to false,
+ /// allowing variability.
+ /// </summary>
+ [JsonProperty("fixed_keyframe_interval", NullValueHandling = NullValueHandling.Ignore)]
+ [JsonConverter(typeof(BooleanConverter))]
+ public bool? FixedKeyframeInterval { get; set; }
+
+ /// <summary>
/// Gets or sets the format of the output container to use. Only set this value if not inferring
/// the format from the output file name.
/// </summary>
@@ -163,6 +197,16 @@ public class Output
public int? H264ReferenceFrames { get; set; }
/// <summary>
+ /// Gets the custom header dictionary to send to Amazon S3, if applicable. Zencoder supports
+ /// the following subset of headers: Cache-Control, Content-Disposition, Content-Encoding,
+ /// Content-Type, Expires, x-amz-acl, x-amz-storage-class and x-amz-meta-*.
+ /// </summary>
+ public IDictionary<string, string> Headers
+ {
+ get { return this.headers ?? (this.headers = new Dictionary<string, string>()); }
+ }
+
+ /// <summary>
/// Gets or sets the height of the output video, if applicable.
/// </summary>
[JsonProperty("height", NullValueHandling = NullValueHandling.Ignore)]
@@ -176,6 +220,15 @@ public class Output
public int? KeyframeInterval { get; set; }
/// <summary>
+ /// Gets or sets the number of keyframes per second. A value of 0.5 would result
+ /// in one keyframe every two seconds, a value of 3 would result in three keyframes
+ /// per second. Use this instead of <see cref="KeyframeInterval"/> if desired, althouth
+ /// <see cref="KeyframeInterval"/> takes precedence if both are set.
+ /// </summary>
+ [JsonProperty("keyframe_rate", NullValueHandling = NullValueHandling.Ignore)]
+ public float? KeyframeRate { get; set; }
+
+ /// <summary>
/// Gets or sets a nickname to use for the output, if applicable.
/// </summary>
[JsonProperty("label", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)]
@@ -261,6 +314,13 @@ public class Output
public int? SegmentSeconds { get; set; }
/// <summary>
+ /// Gets or sets a value indicating whether to apply a sharpen filter to the output video.
+ /// </summary>
+ [JsonProperty("sharpet", NullValueHandling = NullValueHandling.Ignore)]
+ [JsonConverter(typeof(BooleanConverter))]
+ public bool? Sharpen { get; set; }
+
+ /// <summary>
/// Gets or sets a value indicating whether to skip the input audio track, if one is present.
/// </summary>
[JsonProperty("skip_audio", NullValueHandling = NullValueHandling.Ignore)]
@@ -268,6 +328,13 @@ public class Output
public bool? SkipAudio { get; set; }
/// <summary>
+ /// Gets or sets a value indicating whether to skip the input video track, if one is present.
+ /// </summary>
+ [JsonProperty("skip_video", NullValueHandling = NullValueHandling.Ignore)]
+ [JsonConverter(typeof(BooleanConverter))]
+ public bool? SkipVideo { get; set; }
+
+ /// <summary>
/// Gets or sets the target transcoding speed, from 1 to 5.
/// 1 is the slowest, resulting in the smallest file.
/// </summary>
View
105 Source/Zencoder/Thumbnails.cs
@@ -18,6 +18,9 @@ namespace Zencoder
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class Thumbnails
{
+ [JsonProperty("headers", NullValueHandling = NullValueHandling.Ignore)]
+ private IDictionary<string, string> headers;
+
/// <summary>
/// Gets or sets the collection of custom S3 access grants to apply to the thumbnails
/// if their destination is S3.
@@ -39,18 +42,52 @@ public class Thumbnails
public string BaseUrl { get; set; }
/// <summary>
+ /// Gets or sets the interpolated filename to use for thumbnails. The attributes available for interpolation include
+ /// number, padded-number, width, height and size. No file extension is necessary. Each attribute should be surrounded
+ /// by double curly-braces, e.g., {{number}}_{{width}}x{{height}}-thumbnail.
+ /// </summary>
+ [JsonProperty("filename", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)]
+ public string FileName { get; set; }
+
+ /// <summary>
/// Gets or sets the format to use for thumbnail images.
/// </summary>
[JsonProperty("format", NullValueHandling = NullValueHandling.Ignore)]
public ThumbnailFormat? Format { get; set; }
/// <summary>
+ /// Gets the custom header dictionary to send to Amazon S3, if applicable. Zencoder supports
+ /// the following subset of headers: Cache-Control, Content-Disposition, Content-Encoding,
+ /// Content-Type, Expires, x-amz-acl, x-amz-storage-class and x-amz-meta-*.
+ /// </summary>
+ public IDictionary<string, string> Headers
+ {
+ get { return this.headers ?? (this.headers = new Dictionary<string, string>()); }
+ }
+
+ /// <summary>
/// Gets or sets the height of the thumbnails, if applicable.
/// </summary>
[JsonProperty("height", NullValueHandling = NullValueHandling.Ignore)]
public int? Height { get; set; }
/// <summary>
+ /// Gets or sets a thumbnail interval in seconds. A thumbnail will be generated
+ /// for every N seconds of the file. Should be exclusive of <see cref="Number"/>,
+ /// <see cref="Times"/> and <see cref="IntervalInFrames"/>.
+ /// </summary>
+ [JsonProperty("interval", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public int? Interval { get; set; }
+
+ /// <summary>
+ /// Gets or sets the thumbnail interval in frames. A thumbnail will be generated for every N
+ /// frames of the file. Should be exclusive of <see cref="Number"/>, <see cref="Times"/>
+ /// and <see cref="Interval"/>.
+ /// </summary>
+ [JsonProperty("interval_in_frames", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public int? IntervalInFrames { get; set; }
+
+ /// <summary>
/// Gets or sets the name for the thumbnail set. Required when creating multiple thumbnail sets from an output.
/// </summary>
[JsonProperty("label")]
@@ -59,20 +96,12 @@ public class Thumbnails
/// <summary>
/// Gets or sets the number of thumbnails to generate. The thumbnails will
/// be grabbed evenly across the duration of the file. Should be exclusive of
- /// <see cref="Interval"/> and <see cref="Times"/>.
+ /// <see cref="Interval"/>, <see cref="Times"/> and <see cref="IntervalInFrames"/>.
/// </summary>
[JsonProperty("number", DefaultValueHandling = DefaultValueHandling.Ignore)]
public int? Number { get; set; }
/// <summary>
- /// Gets or sets a thumbnail interval in seconds. A thumbnail will be generated
- /// for every N seconds of the file. Should be exclusive of <see cref="Number"/>
- /// and <see cref="Times"/>.
- /// </summary>
- [JsonProperty("interval", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public int? Interval { get; set; }
-
- /// <summary>
/// Gets or sets the output file name prefix. The default is "frame", resulting in thumbnails named
/// "frame_0000.png", "frame_0001.png", etc.
/// </summary>
@@ -106,7 +135,8 @@ public class Thumbnails
/// <summary>
/// Gets or sets a collection of times, in fractional seconds, to generate
- /// thumbnails for. Should be exclusive of <see cref="Number"/> and <see cref="Interval"/>.
+ /// thumbnails for. Should be exclusive of
+ /// <see cref="Interval"/>, <see cref="Times"/> and <see cref="IntervalInFrames"/>.
/// </summary>
[JsonProperty("times", DefaultValueHandling = DefaultValueHandling.Ignore)]
public float[] Times { get; set; }
@@ -143,38 +173,63 @@ public Thumbnails WithAccessControls(IEnumerable<S3Access> accessControls)
}
/// <summary>
- /// Sets the <see cref="Number"/> property, reseting <see cref="Interval"/> and <see cref="Times"/>.
+ /// Sets the <see cref="Interval"/> property, resetting <see cref="Number"/>, <see cref="Times"/>
+ /// and <see cref="IntervalInFrames"/>.
/// </summary>
- /// <param name="number">The number of thumbnails to generate.</param>
+ /// <param name="seconds">The thumbnail interval in seconds.</param>
/// <returns>This instance.</returns>
- public Thumbnails WithNumber(int number)
+ public Thumbnails WithInterval(int seconds)
{
- if (number < 1)
+ if (seconds < 1)
{
- throw new ArgumentException("number should be greater than or equal to 1.", "number");
+ throw new ArgumentException("seconds should be greater than or equal to 1.", "seconds");
}
- this.Number = number;
- this.Interval = null;
+ this.Number = null;
+ this.Interval = seconds;
+ this.IntervalInFrames = null;
this.Times = null;
return this;
}
/// <summary>
- /// Sets the <see cref="Interval"/> property, resetting <see cref="Number"/> and <see cref="Times"/>.
+ /// Sets the <see cref="IntervalInFrames"/> property, resetting <see cref="Number"/>, <see cref="Times"/>
+ /// and <see cref="Interval"/>.
/// </summary>
- /// <param name="seconds">The thumbnail interval in seconds.</param>
+ /// <param name="frames">The thumbnail interval in frames.</param>
/// <returns>This instance.</returns>
- public Thumbnails WithInterval(int seconds)
+ public Thumbnails WithIntervalInFrames(int frames)
{
- if (seconds < 1)
+ if (frames < 1)
{
- throw new ArgumentException("seconds should be greater than or equal to 1.", "seconds");
+ throw new ArgumentException("frames should be greater than or equal to 1.", "frames");
}
+ this.Interval = null;
+ this.IntervalInFrames = frames;
this.Number = null;
- this.Interval = seconds;
+ this.Times = null;
+
+ return this;
+ }
+
+ /// <summary>
+ /// Sets the <see cref="Number"/> property, reseting <see cref="Interval"/>, <see cref="Times"/>
+ /// and <see cref="IntervalInFrames"/>.
+ /// </summary>
+ /// <param name="number">The number of thumbnails to generate.</param>
+ /// <returns>This instance.</returns>
+ public Thumbnails WithNumber(int number)
+ {
+ if (number < 1)
+ {
+ throw new ArgumentException("number should be greater than or equal to 1.", "number");
+ }
+
+ this.Number = number;
+ this.Interval = null;
+ this.IntervalInFrames = null;
this.Times = null;
return this;
@@ -204,7 +259,8 @@ public Thumbnails WithSize(int width, int height)
}
/// <summary>
- /// Sets the <see cref="Times"/> property, resetting <see cref="Number"/> and <see cref="Interval"/>.
+ /// Sets the <see cref="Times"/> property, resetting <see cref="Number"/>, <see cref="Interval"/>
+ /// and <see cref="IntervalInFrames"/>.
/// </summary>
/// <param name="times">A collection of thumbnail times, in fractional seconds.</param>
/// <returns>This instance.</returns>
@@ -222,6 +278,7 @@ public Thumbnails WithTimes(IEnumerable<float> times)
this.Number = null;
this.Interval = null;
+ this.IntervalInFrames = null;
this.Times = times.ToArray();
return this;
View
6 Source/Zencoder/Watermark.cs
@@ -26,6 +26,12 @@ public class Watermark
public string Height { get; set; }
/// <summary>
+ /// Gets or sets the origin type to use for watermark generation.
+ /// </summary>
+ [JsonProperty("origin", NullValueHandling = NullValueHandling.Ignore)]
+ public WatermarkOrigin? Origin { get; set; }
+
+ /// <summary>
/// Gets or sets the URL of the remote file to use as a watermark.
/// </summary>
[JsonProperty("url", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)]
View
30 Source/Zencoder/WatermarkOrigin.cs
@@ -0,0 +1,30 @@
+//-----------------------------------------------------------------------
+// <copyright file="WatermarkOrigin.cs" company="Tasty Codes">
+// Copyright (c) 2010 Chad Burggraf.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace Zencoder
+{
+ using System;
+ using Newtonsoft.Json;
+
+ /// <summary>
+ /// Defines the possible watermark origin values.
+ /// </summary>
+ [JsonConverter(typeof(EnumLowercaseJsonConverter))]
+ public enum WatermarkOrigin
+ {
+ /// <summary>
+ /// Identifies that a watermark placement is based on the visible content
+ /// area of an output, not including padding.
+ /// </summary>
+ Content = 0,
+
+ /// <summary>
+ /// Identifies that watermark placement is based on the full resolution
+ /// of an output, including any padding.
+ /// </summary>
+ Frame
+ }
+}
View
2  Source/Zencoder/Zencoder.cs
@@ -23,7 +23,7 @@ public class Zencoder
/// <summary>
/// Gets the default API base URL.
/// </summary>
- public static readonly Uri ServiceUrl = new Uri("https://app.zencoder.com/api");
+ public static readonly Uri ServiceUrl = new Uri("https://app.zencoder.com/api/v1");
/// <summary>
/// Initializes a new instance of the Zencoder class.
View
3  Source/Zencoder/Zencoder.csproj
@@ -70,6 +70,8 @@
<Compile Include="Deinterlace.cs" />
<Compile Include="DeleteJobRequest.cs" />
<Compile Include="DeleteJobResponse.cs" />
+ <Compile Include="DenoiseFilter.cs" />
+ <Compile Include="DeviceProfile.cs" />
<Compile Include="EmailNotification.cs" />
<Compile Include="EmailNotificationJsonConverter.cs" />
<Compile Include="EnumDescriptionConverter.cs" />
@@ -127,6 +129,7 @@
<Compile Include="Uris.cs" />
<Compile Include="VideoCodec.cs" />
<Compile Include="Watermark.cs" />
+ <Compile Include="WatermarkOrigin.cs" />
<Compile Include="Zencoder.cs" />
<Compile Include="NotificationHandler.cs" />
<Compile Include="ZencoderSettings.cs" />
Please sign in to comment.
Something went wrong with that request. Please try again.