Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
Update to enum
Browse files Browse the repository at this point in the history
  • Loading branch information
xpouyat committed Nov 16, 2023
1 parent 95836a3 commit 2802c13
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 46 deletions.
2 changes: 1 addition & 1 deletion MK.IO/CsharpDotNet2/Model/LiveEventEncoding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class LiveEventEncoding
/// <value>Live event type. When encodingType is set to PassthroughBasic or PassthroughStandard, the service simply passes through the incoming video and audio layer(s) to the output. When encodingType is set to Standard or Premium1080p, a live encoder transcodes the incoming stream into multiple bitrates or layers</value>
[DataMember(Name = "encodingType", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "encodingType")]
public string EncodingType { get; set; }
public LiveEventEncodingType EncodingType { get; set; }

/// <summary>
/// Use an ISO 8601 time value between 1 and 10 seconds to specify the output fragment length for the video and audio tracks of an encoding live event. For example, use PT2S to indicate 2 seconds. For the video track it also defines the key frame interval, or the length of a GoP (group of pictures). If this value is not set for an encoding live event, the fragment duration defaults to 2 seconds. The value cannot be set for pass-through live events.
Expand Down
2 changes: 1 addition & 1 deletion MK.IO/CsharpDotNet2/Model/LiveEventInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class LiveEventInput
/// <value>The input protocol for the live event. This is specified at creation time and cannot be updated. Must be one of RTMP or SRT. fmp4 smooth input is not supported. </value>
[DataMember(Name = "streamingProtocol", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "streamingProtocol")]
public string StreamingProtocol { get; set; }
public LiveEventInputProtocol StreamingProtocol { get; set; }

/// <summary>
/// The metadata endpoints for the live event.
Expand Down
37 changes: 27 additions & 10 deletions MK.IO/LiveEvent/Models/LiveEventEncodingType.cs
Original file line number Diff line number Diff line change
@@ -1,30 +1,47 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Runtime.Serialization;

namespace MK.IO
{
/// <summary> The encoding types for live event. </summary>
public readonly partial struct LiveEventEncodingType
/// <summary>
/// Live event type. When encodingType is set to PassthroughBasic or PassthroughStandard, the service simply passes through the incoming video and audio layer(s) to the output. When encodingType is set to Standard or Premium1080p, a live encoder transcodes the incoming stream into multiple bitrates or layers
/// </summary>
/// <value>Live event type. When encodingType is set to PassthroughBasic or PassthroughStandard, the service simply passes through the incoming video and audio layer(s) to the output. When encodingType is set to Standard or Premium1080p, a live encoder transcodes the incoming stream into multiple bitrates or layers</value>
[JsonConverter(typeof(StringEnumConverter))]
public enum LiveEventEncodingType
{
/// <summary>
/// Enum None for value: None
/// </summary>
[EnumMember(Value = "None")]
None = 1,

/// <summary>
/// The ingested stream passes through the live event from the contribution encoder.
/// Enum PassthroughBasic for value: PassthroughBasic
/// </summary>
public static readonly string PassthroughBasic = "PassthroughBasic";
[EnumMember(Value = "PassthroughBasic")]
PassthroughBasic = 2,

/// <summary>
/// The ingested stream passes through the live event from the contribution encoder.
/// Enum PassthroughStandard for value: PassthroughStandard
/// </summary>
public static readonly string PassthroughStandard = "PassthroughStandard";
[EnumMember(Value = "PassthroughStandard")]
PassthroughStandard = 3,

/// <summary>
/// A live encoder transcodes the incoming stream into multiple bitrates or layers
/// Enum Premium1080p for value: Premium1080p
/// </summary>
public static readonly string Standard = "Standard ";
[EnumMember(Value = "Premium1080p")]
Premium1080p = 4,

/// <summary>
/// A live encoder transcodes the incoming stream into multiple bitrates or layers
/// Enum Standard for value: Standard
/// </summary>
public static readonly string Premium1080p = "Premium1080p ";
[EnumMember(Value = "Standard")]
Standard = 5
}
}
25 changes: 21 additions & 4 deletions MK.IO/LiveEvent/Models/LiveEventInputProtocol.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Runtime.Serialization;

namespace MK.IO
{
/// <summary> The input protocols for live event. </summary>
public readonly partial struct LiveEventInputProtocol
/// <summary>
/// The input protocol for the live event. This is specified at creation time and cannot be updated. Must be one of RTMP or SRT. fmp4 smooth input is not supported.
/// </summary>
/// <value>The input protocol for the live event. This is specified at creation time and cannot be updated. Must be one of RTMP or SRT. fmp4 smooth input is not supported. </value>
[JsonConverter(typeof(StringEnumConverter))]
public enum LiveEventInputProtocol
{
public static readonly string RTMP = "RTMP";
public static readonly string SRT = "SRT ";
/// <summary>
/// Enum RTMP for value: RTMP
/// </summary>
[EnumMember(Value = "RTMP")]
RTMP = 1,

/// <summary>
/// Enum SRT for value: SRT
/// </summary>
[EnumMember(Value = "SRT")]
SRT = 2
}
}
30 changes: 30 additions & 0 deletions MK.IO/Transform/Models/AudioAnalyzerMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;

namespace MK.IO
{
/// <summary>
/// Determines the set of audio analysis operations to be performed. If unspecified, the Standard AudioAnalysisMode would be chosen.
/// </summary>
/// <value>Determines the set of audio analysis operations to be performed. If unspecified, the Standard AudioAnalysisMode would be chosen.</value>
[JsonConverter(typeof(StringEnumConverter))]
public enum AudioAnalyzerMode
{
/// <summary>
/// Enum Basic for value: Basic
/// </summary>
[EnumMember(Value = "Basic")]
Basic = 1,

/// <summary>
/// Enum Standard for value: Standard
/// </summary>
[EnumMember(Value = "Standard")]
Standard = 2
}
}
3 changes: 1 addition & 2 deletions MK.IO/Transform/Models/AudioAnalyzerPreset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ public class AudioAnalyzerPreset : TransformOutputPreset

/// <summary>
/// Determines the set of audio analysis operations to be performed. If unspecified, the Standard AudioAnalysisMode would be chosen.
/// Use AudioAnalyzerPresetMode to list values.
/// </summary>
/// <value>Determines the set of audio analysis operations to be performed. If unspecified, the Standard AudioAnalysisMode would be chosen.</value>
[DataMember(Name = "mode", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "mode")]
public string Mode { get; set; }
public AudioAnalyzerMode Mode { get; set; }

/// <summary>
/// Get the string presentation of the object
Expand Down
12 changes: 0 additions & 12 deletions MK.IO/Transform/Models/AudioAnalyzerPresetMode.cs

This file was deleted.

5 changes: 2 additions & 3 deletions MK.IO/Transform/Models/BuiltInStandardEncoderPreset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ namespace MK.IO
public class BuiltInStandardEncoderPreset : TransformOutputPreset
{

public BuiltInStandardEncoderPreset(string presetName)
public BuiltInStandardEncoderPreset(EncoderNamedPreset presetName)
{
PresetName = presetName;
}

[JsonProperty("@odata.type")]
internal string OdataType => "#Microsoft.Media.BuiltInStandardEncoderPreset";

// Use EncoderNamedPreset to list possible values for this property
[JsonProperty("presetName")]
public string PresetName { get; set; }
public EncoderNamedPreset PresetName { get; set; }
}
}
78 changes: 65 additions & 13 deletions MK.IO/Transform/Models/EncoderNamedPreset.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,74 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Runtime.Serialization;

namespace MK.IO
{
/// <summary> The built-in preset to be used for encoding videos. </summary>
public readonly partial struct EncoderNamedPreset
[JsonConverter(typeof(StringEnumConverter))]
public enum EncoderNamedPreset
{
public static readonly string H264SingleBitrateSD = "H264SingleBitrateSD";
public static readonly string H264SingleBitrate720p = "H264SingleBitrate720p";
public static readonly string H264SingleBitrate1080p = "H264SingleBitrate1080p";
public static readonly string H264MultipleBitrate1080p = "H264MultipleBitrate1080p";
public static readonly string H264MultipleBitrate720p = "H264MultipleBitrate720p";
public static readonly string H264MultipleBitrateSD = "H264MultipleBitrateSD";

public static readonly string H265SingleBitrate720p = "H265SingleBitrate720p";
public static readonly string H265SingleBitrate1080p = "H265SingleBitrate1080p";
public static readonly string H265SingleBitrate4K = "H265SingleBitrate4K";

public static readonly string AACGoodQualityAudio = "AACGoodQualityAudio";
/// <summary>
/// Enum H264SingleBitrateSD for value: H264SingleBitrateSD
/// </summary>
[EnumMember(Value = "H264SingleBitrateSD")]
H264SingleBitrateSD = 1,

/// <summary>
/// Enum H264SingleBitrate720p for value: H264SingleBitrate720p
/// </summary>
[EnumMember(Value = "H264SingleBitrate720p")]
H264SingleBitrate720p = 2,

/// <summary>
/// Enum H264SingleBitrate1080p for value: H264SingleBitrate1080p
/// </summary>
[EnumMember(Value = "H264SingleBitrate1080p")]
H264SingleBitrate1080p = 3,

/// <summary>
/// Enum H264MultipleBitrateSD for value: H264MultipleBitrateSD
/// </summary>
[EnumMember(Value = "H264MultipleBitrateSD")]
H264MultipleBitrateSD = 4,

/// <summary>
/// Enum H264MultipleBitrate720p for value: H264MultipleBitrate720p
/// </summary>
[EnumMember(Value = "H264MultipleBitrate720p")]
H264MultipleBitrate720p = 5,

/// <summary>
/// Enum H264MultipleBitrate1080p for value: H264MultipleBitrate1080p
/// </summary>
[EnumMember(Value = "H264MultipleBitrate1080p")]
H264MultipleBitrate1080p = 6,

/// <summary>
/// Enum H265SingleBitrate720p for value: H265SingleBitrate720p
/// </summary>
[EnumMember(Value = "H265SingleBitrate720p")]
H265SingleBitrate720p = 7,

/// <summary>
/// Enum H265SingleBitrate1080p for value: H265SingleBitrate1080p
/// </summary>
[EnumMember(Value = "H265SingleBitrate1080p")]
H265SingleBitrate1080p = 8,

/// <summary>
/// Enum H265SingleBitrate4K for value: H265SingleBitrate4K
/// </summary>
[EnumMember(Value = "H265SingleBitrate4K")]
H265SingleBitrate4K = 9,

/// <summary>
/// Enum AACGoodQualityAudio for value: AACGoodQualityAudio
/// </summary>
[EnumMember(Value = "AACGoodQualityAudio")]
AACGoodQualityAudio = 10
}
}

0 comments on commit 2802c13

Please sign in to comment.