|
@@ -1,6 +1,6 @@
|
|
-#nullable disable
|
|
|
|
#pragma warning disable CA1819 // Properties should not return arrays
|
|
#pragma warning disable CA1819 // Properties should not return arrays
|
|
using System;
|
|
using System;
|
|
|
|
+using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
using System.Xml.Serialization;
|
|
using System.Xml.Serialization;
|
|
using MediaBrowser.Model.MediaInfo;
|
|
using MediaBrowser.Model.MediaInfo;
|
|
@@ -13,121 +13,104 @@ namespace MediaBrowser.Model.Dlna
|
|
[XmlRoot("Profile")]
|
|
[XmlRoot("Profile")]
|
|
public class DeviceProfile
|
|
public class DeviceProfile
|
|
{
|
|
{
|
|
- /// <summary>
|
|
|
|
- /// Initializes a new instance of the <see cref="DeviceProfile"/> class.
|
|
|
|
- /// </summary>
|
|
|
|
- public DeviceProfile()
|
|
|
|
- {
|
|
|
|
- DirectPlayProfiles = Array.Empty<DirectPlayProfile>();
|
|
|
|
- TranscodingProfiles = Array.Empty<TranscodingProfile>();
|
|
|
|
- ResponseProfiles = Array.Empty<ResponseProfile>();
|
|
|
|
- CodecProfiles = Array.Empty<CodecProfile>();
|
|
|
|
- ContainerProfiles = Array.Empty<ContainerProfile>();
|
|
|
|
- SubtitleProfiles = Array.Empty<SubtitleProfile>();
|
|
|
|
-
|
|
|
|
- XmlRootAttributes = Array.Empty<XmlAttribute>();
|
|
|
|
-
|
|
|
|
- SupportedMediaTypes = "Audio,Photo,Video";
|
|
|
|
- MaxStreamingBitrate = 8000000;
|
|
|
|
- MaxStaticBitrate = 8000000;
|
|
|
|
- MusicStreamingTranscodingBitrate = 128000;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the Name.
|
|
/// Gets or sets the Name.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public string Name { get; set; }
|
|
|
|
|
|
+ public string? Name { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the Id.
|
|
/// Gets or sets the Id.
|
|
/// </summary>
|
|
/// </summary>
|
|
[XmlIgnore]
|
|
[XmlIgnore]
|
|
- public string Id { get; set; }
|
|
|
|
|
|
+ public string? Id { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the Identification.
|
|
/// Gets or sets the Identification.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public DeviceIdentification Identification { get; set; }
|
|
|
|
|
|
+ public DeviceIdentification? Identification { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the FriendlyName.
|
|
/// Gets or sets the FriendlyName.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public string FriendlyName { get; set; }
|
|
|
|
|
|
+ public string? FriendlyName { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the Manufacturer.
|
|
/// Gets or sets the Manufacturer.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public string Manufacturer { get; set; }
|
|
|
|
|
|
+ public string? Manufacturer { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the ManufacturerUrl.
|
|
/// Gets or sets the ManufacturerUrl.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public string ManufacturerUrl { get; set; }
|
|
|
|
|
|
+ public string? ManufacturerUrl { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the ModelName.
|
|
/// Gets or sets the ModelName.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public string ModelName { get; set; }
|
|
|
|
|
|
+ public string? ModelName { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the ModelDescription.
|
|
/// Gets or sets the ModelDescription.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public string ModelDescription { get; set; }
|
|
|
|
|
|
+ public string? ModelDescription { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the ModelNumber.
|
|
/// Gets or sets the ModelNumber.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public string ModelNumber { get; set; }
|
|
|
|
|
|
+ public string? ModelNumber { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the ModelUrl.
|
|
/// Gets or sets the ModelUrl.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public string ModelUrl { get; set; }
|
|
|
|
|
|
+ public string? ModelUrl { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the SerialNumber.
|
|
/// Gets or sets the SerialNumber.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public string SerialNumber { get; set; }
|
|
|
|
|
|
+ public string? SerialNumber { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether EnableAlbumArtInDidl.
|
|
/// Gets or sets a value indicating whether EnableAlbumArtInDidl.
|
|
/// </summary>
|
|
/// </summary>
|
|
|
|
+ [DefaultValue(false)]
|
|
public bool EnableAlbumArtInDidl { get; set; }
|
|
public bool EnableAlbumArtInDidl { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether EnableSingleAlbumArtLimit.
|
|
/// Gets or sets a value indicating whether EnableSingleAlbumArtLimit.
|
|
/// </summary>
|
|
/// </summary>
|
|
|
|
+ [DefaultValue(false)]
|
|
public bool EnableSingleAlbumArtLimit { get; set; }
|
|
public bool EnableSingleAlbumArtLimit { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether EnableSingleSubtitleLimit.
|
|
/// Gets or sets a value indicating whether EnableSingleSubtitleLimit.
|
|
/// </summary>
|
|
/// </summary>
|
|
|
|
+ [DefaultValue(false)]
|
|
public bool EnableSingleSubtitleLimit { get; set; }
|
|
public bool EnableSingleSubtitleLimit { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the SupportedMediaTypes.
|
|
/// Gets or sets the SupportedMediaTypes.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public string SupportedMediaTypes { get; set; }
|
|
|
|
|
|
+ public string SupportedMediaTypes { get; set; } = "Audio,Photo,Video";
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the UserId.
|
|
/// Gets or sets the UserId.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public string UserId { get; set; }
|
|
|
|
|
|
+ public string? UserId { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the AlbumArtPn.
|
|
/// Gets or sets the AlbumArtPn.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public string AlbumArtPn { get; set; }
|
|
|
|
|
|
+ public string? AlbumArtPn { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the MaxAlbumArtWidth.
|
|
/// Gets or sets the MaxAlbumArtWidth.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public int MaxAlbumArtWidth { get; set; }
|
|
|
|
|
|
+ public int? MaxAlbumArtWidth { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the MaxAlbumArtHeight.
|
|
/// Gets or sets the MaxAlbumArtHeight.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public int MaxAlbumArtHeight { get; set; }
|
|
|
|
|
|
+ public int? MaxAlbumArtHeight { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the MaxIconWidth.
|
|
/// Gets or sets the MaxIconWidth.
|
|
@@ -142,92 +125,97 @@ namespace MediaBrowser.Model.Dlna
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the MaxStreamingBitrate.
|
|
/// Gets or sets the MaxStreamingBitrate.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public int? MaxStreamingBitrate { get; set; }
|
|
|
|
|
|
+ public int? MaxStreamingBitrate { get; set; } = 8000000;
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the MaxStaticBitrate.
|
|
/// Gets or sets the MaxStaticBitrate.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public int? MaxStaticBitrate { get; set; }
|
|
|
|
|
|
+ public int? MaxStaticBitrate { get; set; } = 8000000;
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the MusicStreamingTranscodingBitrate.
|
|
/// Gets or sets the MusicStreamingTranscodingBitrate.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public int? MusicStreamingTranscodingBitrate { get; set; }
|
|
|
|
|
|
+ public int? MusicStreamingTranscodingBitrate { get; set; } = 128000;
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the MaxStaticMusicBitrate.
|
|
/// Gets or sets the MaxStaticMusicBitrate.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public int? MaxStaticMusicBitrate { get; set; }
|
|
|
|
|
|
+ public int? MaxStaticMusicBitrate { get; set; } = 8000000;
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the content of the aggregationFlags element in the urn:schemas-sonycom:av namespace.
|
|
/// Gets or sets the content of the aggregationFlags element in the urn:schemas-sonycom:av namespace.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public string SonyAggregationFlags { get; set; }
|
|
|
|
|
|
+ public string? SonyAggregationFlags { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the ProtocolInfo.
|
|
/// Gets or sets the ProtocolInfo.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public string ProtocolInfo { get; set; }
|
|
|
|
|
|
+ public string? ProtocolInfo { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the TimelineOffsetSeconds.
|
|
/// Gets or sets the TimelineOffsetSeconds.
|
|
/// </summary>
|
|
/// </summary>
|
|
|
|
+ [DefaultValue(0)]
|
|
public int TimelineOffsetSeconds { get; set; }
|
|
public int TimelineOffsetSeconds { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether RequiresPlainVideoItems.
|
|
/// Gets or sets a value indicating whether RequiresPlainVideoItems.
|
|
/// </summary>
|
|
/// </summary>
|
|
|
|
+ [DefaultValue(false)]
|
|
public bool RequiresPlainVideoItems { get; set; }
|
|
public bool RequiresPlainVideoItems { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether RequiresPlainFolders.
|
|
/// Gets or sets a value indicating whether RequiresPlainFolders.
|
|
/// </summary>
|
|
/// </summary>
|
|
|
|
+ [DefaultValue(false)]
|
|
public bool RequiresPlainFolders { get; set; }
|
|
public bool RequiresPlainFolders { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether EnableMSMediaReceiverRegistrar.
|
|
/// Gets or sets a value indicating whether EnableMSMediaReceiverRegistrar.
|
|
/// </summary>
|
|
/// </summary>
|
|
|
|
+ [DefaultValue(false)]
|
|
public bool EnableMSMediaReceiverRegistrar { get; set; }
|
|
public bool EnableMSMediaReceiverRegistrar { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether IgnoreTranscodeByteRangeRequests.
|
|
/// Gets or sets a value indicating whether IgnoreTranscodeByteRangeRequests.
|
|
/// </summary>
|
|
/// </summary>
|
|
|
|
+ [DefaultValue(false)]
|
|
public bool IgnoreTranscodeByteRangeRequests { get; set; }
|
|
public bool IgnoreTranscodeByteRangeRequests { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the XmlRootAttributes.
|
|
/// Gets or sets the XmlRootAttributes.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public XmlAttribute[] XmlRootAttributes { get; set; }
|
|
|
|
|
|
+ public XmlAttribute[] XmlRootAttributes { get; set; } = Array.Empty<XmlAttribute>();
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the direct play profiles.
|
|
/// Gets or sets the direct play profiles.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public DirectPlayProfile[] DirectPlayProfiles { get; set; }
|
|
|
|
|
|
+ public DirectPlayProfile[] DirectPlayProfiles { get; set; } = Array.Empty<DirectPlayProfile>();
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the transcoding profiles.
|
|
/// Gets or sets the transcoding profiles.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public TranscodingProfile[] TranscodingProfiles { get; set; }
|
|
|
|
|
|
+ public TranscodingProfile[] TranscodingProfiles { get; set; } = Array.Empty<TranscodingProfile>();
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the ContainerProfiles.
|
|
/// Gets or sets the ContainerProfiles.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public ContainerProfile[] ContainerProfiles { get; set; }
|
|
|
|
|
|
+ public ContainerProfile[] ContainerProfiles { get; set; } = Array.Empty<ContainerProfile>();
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the CodecProfiles.
|
|
/// Gets or sets the CodecProfiles.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public CodecProfile[] CodecProfiles { get; set; }
|
|
|
|
|
|
+ public CodecProfile[] CodecProfiles { get; set; } = Array.Empty<CodecProfile>();
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the ResponseProfiles.
|
|
/// Gets or sets the ResponseProfiles.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public ResponseProfile[] ResponseProfiles { get; set; }
|
|
|
|
|
|
+ public ResponseProfile[] ResponseProfiles { get; set; } = Array.Empty<ResponseProfile>();
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the SubtitleProfiles.
|
|
/// Gets or sets the SubtitleProfiles.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public SubtitleProfile[] SubtitleProfiles { get; set; }
|
|
|
|
|
|
+ public SubtitleProfile[] SubtitleProfiles { get; set; } = Array.Empty<SubtitleProfile>();
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// The GetSupportedMediaTypes.
|
|
/// The GetSupportedMediaTypes.
|
|
@@ -244,13 +232,13 @@ namespace MediaBrowser.Model.Dlna
|
|
/// <param name="container">The container.</param>
|
|
/// <param name="container">The container.</param>
|
|
/// <param name="audioCodec">The audio Codec.</param>
|
|
/// <param name="audioCodec">The audio Codec.</param>
|
|
/// <returns>A <see cref="TranscodingProfile"/>.</returns>
|
|
/// <returns>A <see cref="TranscodingProfile"/>.</returns>
|
|
- public TranscodingProfile GetAudioTranscodingProfile(string container, string audioCodec)
|
|
|
|
|
|
+ public TranscodingProfile? GetAudioTranscodingProfile(string? container, string? audioCodec)
|
|
{
|
|
{
|
|
container = (container ?? string.Empty).TrimStart('.');
|
|
container = (container ?? string.Empty).TrimStart('.');
|
|
|
|
|
|
foreach (var i in TranscodingProfiles)
|
|
foreach (var i in TranscodingProfiles)
|
|
{
|
|
{
|
|
- if (i.Type != MediaBrowser.Model.Dlna.DlnaProfileType.Audio)
|
|
|
|
|
|
+ if (i.Type != DlnaProfileType.Audio)
|
|
{
|
|
{
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
@@ -278,13 +266,13 @@ namespace MediaBrowser.Model.Dlna
|
|
/// <param name="audioCodec">The audio Codec.</param>
|
|
/// <param name="audioCodec">The audio Codec.</param>
|
|
/// <param name="videoCodec">The video Codec.</param>
|
|
/// <param name="videoCodec">The video Codec.</param>
|
|
/// <returns>The <see cref="TranscodingProfile"/>.</returns>
|
|
/// <returns>The <see cref="TranscodingProfile"/>.</returns>
|
|
- public TranscodingProfile GetVideoTranscodingProfile(string container, string audioCodec, string videoCodec)
|
|
|
|
|
|
+ public TranscodingProfile? GetVideoTranscodingProfile(string? container, string? audioCodec, string? videoCodec)
|
|
{
|
|
{
|
|
container = (container ?? string.Empty).TrimStart('.');
|
|
container = (container ?? string.Empty).TrimStart('.');
|
|
|
|
|
|
foreach (var i in TranscodingProfiles)
|
|
foreach (var i in TranscodingProfiles)
|
|
{
|
|
{
|
|
- if (i.Type != MediaBrowser.Model.Dlna.DlnaProfileType.Video)
|
|
|
|
|
|
+ if (i.Type != DlnaProfileType.Video)
|
|
{
|
|
{
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
@@ -299,7 +287,7 @@ namespace MediaBrowser.Model.Dlna
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
- if (!string.Equals(videoCodec, i.VideoCodec ?? string.Empty, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
+ if (!string.Equals(videoCodec, i.VideoCodec, StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
{
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
@@ -320,7 +308,7 @@ namespace MediaBrowser.Model.Dlna
|
|
/// <param name="audioSampleRate">The audio sample rate.</param>
|
|
/// <param name="audioSampleRate">The audio sample rate.</param>
|
|
/// <param name="audioBitDepth">The audio bit depth.</param>
|
|
/// <param name="audioBitDepth">The audio bit depth.</param>
|
|
/// <returns>The <see cref="ResponseProfile"/>.</returns>
|
|
/// <returns>The <see cref="ResponseProfile"/>.</returns>
|
|
- public ResponseProfile GetAudioMediaProfile(string container, string audioCodec, int? audioChannels, int? audioBitrate, int? audioSampleRate, int? audioBitDepth)
|
|
|
|
|
|
+ public ResponseProfile? GetAudioMediaProfile(string container, string? audioCodec, int? audioChannels, int? audioBitrate, int? audioSampleRate, int? audioBitDepth)
|
|
{
|
|
{
|
|
foreach (var i in ResponseProfiles)
|
|
foreach (var i in ResponseProfiles)
|
|
{
|
|
{
|
|
@@ -384,7 +372,7 @@ namespace MediaBrowser.Model.Dlna
|
|
/// <param name="width">The width.</param>
|
|
/// <param name="width">The width.</param>
|
|
/// <param name="height">The height.</param>
|
|
/// <param name="height">The height.</param>
|
|
/// <returns>The <see cref="ResponseProfile"/>.</returns>
|
|
/// <returns>The <see cref="ResponseProfile"/>.</returns>
|
|
- public ResponseProfile GetImageMediaProfile(string container, int? width, int? height)
|
|
|
|
|
|
+ public ResponseProfile? GetImageMediaProfile(string container, int? width, int? height)
|
|
{
|
|
{
|
|
foreach (var i in ResponseProfiles)
|
|
foreach (var i in ResponseProfiles)
|
|
{
|
|
{
|
|
@@ -442,7 +430,7 @@ namespace MediaBrowser.Model.Dlna
|
|
/// <param name="videoCodecTag">The video Codec tag.</param>
|
|
/// <param name="videoCodecTag">The video Codec tag.</param>
|
|
/// <param name="isAvc">True if Avc.</param>
|
|
/// <param name="isAvc">True if Avc.</param>
|
|
/// <returns>The <see cref="ResponseProfile"/>.</returns>
|
|
/// <returns>The <see cref="ResponseProfile"/>.</returns>
|
|
- public ResponseProfile GetVideoMediaProfile(
|
|
|
|
|
|
+ public ResponseProfile? GetVideoMediaProfile(
|
|
string container,
|
|
string container,
|
|
string audioCodec,
|
|
string audioCodec,
|
|
string videoCodec,
|
|
string videoCodec,
|