#nullable disable
#pragma warning disable CS1591
using System;
using MediaBrowser.Model.Dto;
namespace MediaBrowser.Model.Dlna
{
///
/// Class AudioOptions.
///
public class AudioOptions
{
public AudioOptions()
{
Context = EncodingContext.Streaming;
EnableDirectPlay = true;
EnableDirectStream = true;
}
public bool EnableDirectPlay { get; set; }
public bool EnableDirectStream { get; set; }
public bool ForceDirectPlay { get; set; }
public bool ForceDirectStream { get; set; }
public Guid ItemId { get; set; }
public MediaSourceInfo[] MediaSources { get; set; }
public DeviceProfile Profile { get; set; }
///
/// Optional. Only needed if a specific AudioStreamIndex or SubtitleStreamIndex are requested.
///
public string MediaSourceId { get; set; }
public string DeviceId { get; set; }
///
/// Allows an override of supported number of audio channels
/// Example: DeviceProfile supports five channel, but user only has stereo speakers
///
public int? MaxAudioChannels { get; set; }
///
/// The application's configured quality setting
///
public long? MaxBitrate { get; set; }
///
/// Gets or sets the context.
///
/// The context.
public EncodingContext Context { get; set; }
///
/// Gets or sets the audio transcoding bitrate.
///
/// The audio transcoding bitrate.
public int? AudioTranscodingBitrate { get; set; }
///
/// Gets the maximum bitrate.
///
/// System.Nullable<System.Int32>.
public long? GetMaxBitrate(bool isAudio)
{
if (MaxBitrate.HasValue)
{
return MaxBitrate;
}
if (Profile == null)
{
return null;
}
if (Context == EncodingContext.Static)
{
if (isAudio && Profile.MaxStaticMusicBitrate.HasValue)
{
return Profile.MaxStaticMusicBitrate;
}
return Profile.MaxStaticBitrate;
}
return Profile.MaxStreamingBitrate;
}
}
}