mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 18:14:42 +01:00
Merge remote-tracking branch 'upstream/master' into fmp4-hls
This commit is contained in:
@@ -11,59 +11,54 @@ namespace MediaBrowser.Model.Dlna
|
||||
/// Gets or sets the name of the friendly.
|
||||
/// </summary>
|
||||
/// <value>The name of the friendly.</value>
|
||||
public string FriendlyName { get; set; }
|
||||
public string FriendlyName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the model number.
|
||||
/// </summary>
|
||||
/// <value>The model number.</value>
|
||||
public string ModelNumber { get; set; }
|
||||
public string ModelNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the serial number.
|
||||
/// </summary>
|
||||
/// <value>The serial number.</value>
|
||||
public string SerialNumber { get; set; }
|
||||
public string SerialNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the model.
|
||||
/// </summary>
|
||||
/// <value>The name of the model.</value>
|
||||
public string ModelName { get; set; }
|
||||
public string ModelName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the model description.
|
||||
/// </summary>
|
||||
/// <value>The model description.</value>
|
||||
public string ModelDescription { get; set; }
|
||||
public string ModelDescription { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the model URL.
|
||||
/// </summary>
|
||||
/// <value>The model URL.</value>
|
||||
public string ModelUrl { get; set; }
|
||||
public string ModelUrl { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the manufacturer.
|
||||
/// </summary>
|
||||
/// <value>The manufacturer.</value>
|
||||
public string Manufacturer { get; set; }
|
||||
public string Manufacturer { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the manufacturer URL.
|
||||
/// </summary>
|
||||
/// <value>The manufacturer URL.</value>
|
||||
public string ManufacturerUrl { get; set; }
|
||||
public string ManufacturerUrl { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the headers.
|
||||
/// </summary>
|
||||
/// <value>The headers.</value>
|
||||
public HttpHeaderInfo[] Headers { get; set; }
|
||||
|
||||
public DeviceIdentification()
|
||||
{
|
||||
Headers = Array.Empty<HttpHeaderInfo>();
|
||||
}
|
||||
public HttpHeaderInfo[] Headers { get; set; } = Array.Empty<HttpHeaderInfo>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
#pragma warning disable CA1819 // Properties should not return arrays
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
@@ -8,107 +7,15 @@ using MediaBrowser.Model.MediaInfo;
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the <see cref="DeviceProfile" />.
|
||||
/// </summary>
|
||||
[XmlRoot("Profile")]
|
||||
public class DeviceProfile
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// Initializes a new instance of the <see cref="DeviceProfile"/> class.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the identification.
|
||||
/// </summary>
|
||||
/// <value>The identification.</value>
|
||||
public DeviceIdentification Identification { get; set; }
|
||||
|
||||
public string FriendlyName { get; set; }
|
||||
|
||||
public string Manufacturer { get; set; }
|
||||
|
||||
public string ManufacturerUrl { get; set; }
|
||||
|
||||
public string ModelName { get; set; }
|
||||
|
||||
public string ModelDescription { get; set; }
|
||||
|
||||
public string ModelNumber { get; set; }
|
||||
|
||||
public string ModelUrl { get; set; }
|
||||
|
||||
public string SerialNumber { get; set; }
|
||||
|
||||
public bool EnableAlbumArtInDidl { get; set; }
|
||||
|
||||
public bool EnableSingleAlbumArtLimit { get; set; }
|
||||
|
||||
public bool EnableSingleSubtitleLimit { get; set; }
|
||||
|
||||
public string SupportedMediaTypes { get; set; }
|
||||
|
||||
public string UserId { get; set; }
|
||||
|
||||
public string AlbumArtPn { get; set; }
|
||||
|
||||
public int MaxAlbumArtWidth { get; set; }
|
||||
|
||||
public int MaxAlbumArtHeight { get; set; }
|
||||
|
||||
public int? MaxIconWidth { get; set; }
|
||||
|
||||
public int? MaxIconHeight { get; set; }
|
||||
|
||||
public int? MaxStreamingBitrate { get; set; }
|
||||
|
||||
public int? MaxStaticBitrate { get; set; }
|
||||
|
||||
public int? MusicStreamingTranscodingBitrate { get; set; }
|
||||
|
||||
public int? MaxStaticMusicBitrate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Controls the content of the aggregationFlags element in the urn:schemas-sonycom:av namespace.
|
||||
/// </summary>
|
||||
public string SonyAggregationFlags { get; set; }
|
||||
|
||||
public string ProtocolInfo { get; set; }
|
||||
|
||||
public int TimelineOffsetSeconds { get; set; }
|
||||
|
||||
public bool RequiresPlainVideoItems { get; set; }
|
||||
|
||||
public bool RequiresPlainFolders { get; set; }
|
||||
|
||||
public bool EnableMSMediaReceiverRegistrar { get; set; }
|
||||
|
||||
public bool IgnoreTranscodeByteRangeRequests { get; set; }
|
||||
|
||||
public XmlAttribute[] XmlRootAttributes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the direct play profiles.
|
||||
/// </summary>
|
||||
/// <value>The direct play profiles.</value>
|
||||
public DirectPlayProfile[] DirectPlayProfiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the transcoding profiles.
|
||||
/// </summary>
|
||||
/// <value>The transcoding profiles.</value>
|
||||
public TranscodingProfile[] TranscodingProfiles { get; set; }
|
||||
|
||||
public ContainerProfile[] ContainerProfiles { get; set; }
|
||||
|
||||
public CodecProfile[] CodecProfiles { get; set; }
|
||||
|
||||
public ResponseProfile[] ResponseProfiles { get; set; }
|
||||
|
||||
public SubtitleProfile[] SubtitleProfiles { get; set; }
|
||||
|
||||
public DeviceProfile()
|
||||
{
|
||||
DirectPlayProfiles = Array.Empty<DirectPlayProfile>();
|
||||
@@ -126,11 +33,217 @@ namespace MediaBrowser.Model.Dlna
|
||||
MusicStreamingTranscodingBitrate = 128000;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Name.
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Id.
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Identification.
|
||||
/// </summary>
|
||||
public DeviceIdentification Identification { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the FriendlyName.
|
||||
/// </summary>
|
||||
public string FriendlyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Manufacturer.
|
||||
/// </summary>
|
||||
public string Manufacturer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ManufacturerUrl.
|
||||
/// </summary>
|
||||
public string ManufacturerUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ModelName.
|
||||
/// </summary>
|
||||
public string ModelName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ModelDescription.
|
||||
/// </summary>
|
||||
public string ModelDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ModelNumber.
|
||||
/// </summary>
|
||||
public string ModelNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ModelUrl.
|
||||
/// </summary>
|
||||
public string ModelUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the SerialNumber.
|
||||
/// </summary>
|
||||
public string SerialNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether EnableAlbumArtInDidl.
|
||||
/// </summary>
|
||||
public bool EnableAlbumArtInDidl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether EnableSingleAlbumArtLimit.
|
||||
/// </summary>
|
||||
public bool EnableSingleAlbumArtLimit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether EnableSingleSubtitleLimit.
|
||||
/// </summary>
|
||||
public bool EnableSingleSubtitleLimit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the SupportedMediaTypes.
|
||||
/// </summary>
|
||||
public string SupportedMediaTypes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the UserId.
|
||||
/// </summary>
|
||||
public string UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the AlbumArtPn.
|
||||
/// </summary>
|
||||
public string AlbumArtPn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MaxAlbumArtWidth.
|
||||
/// </summary>
|
||||
public int MaxAlbumArtWidth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MaxAlbumArtHeight.
|
||||
/// </summary>
|
||||
public int MaxAlbumArtHeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MaxIconWidth.
|
||||
/// </summary>
|
||||
public int? MaxIconWidth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MaxIconHeight.
|
||||
/// </summary>
|
||||
public int? MaxIconHeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MaxStreamingBitrate.
|
||||
/// </summary>
|
||||
public int? MaxStreamingBitrate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MaxStaticBitrate.
|
||||
/// </summary>
|
||||
public int? MaxStaticBitrate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MusicStreamingTranscodingBitrate.
|
||||
/// </summary>
|
||||
public int? MusicStreamingTranscodingBitrate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MaxStaticMusicBitrate.
|
||||
/// </summary>
|
||||
public int? MaxStaticMusicBitrate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the content of the aggregationFlags element in the urn:schemas-sonycom:av namespace.
|
||||
/// </summary>
|
||||
public string SonyAggregationFlags { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ProtocolInfo.
|
||||
/// </summary>
|
||||
public string ProtocolInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the TimelineOffsetSeconds.
|
||||
/// </summary>
|
||||
public int TimelineOffsetSeconds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether RequiresPlainVideoItems.
|
||||
/// </summary>
|
||||
public bool RequiresPlainVideoItems { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether RequiresPlainFolders.
|
||||
/// </summary>
|
||||
public bool RequiresPlainFolders { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether EnableMSMediaReceiverRegistrar.
|
||||
/// </summary>
|
||||
public bool EnableMSMediaReceiverRegistrar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether IgnoreTranscodeByteRangeRequests.
|
||||
/// </summary>
|
||||
public bool IgnoreTranscodeByteRangeRequests { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the XmlRootAttributes.
|
||||
/// </summary>
|
||||
public XmlAttribute[] XmlRootAttributes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the direct play profiles.
|
||||
/// </summary>
|
||||
public DirectPlayProfile[] DirectPlayProfiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the transcoding profiles.
|
||||
/// </summary>
|
||||
public TranscodingProfile[] TranscodingProfiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ContainerProfiles.
|
||||
/// </summary>
|
||||
public ContainerProfile[] ContainerProfiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the CodecProfiles.
|
||||
/// </summary>
|
||||
public CodecProfile[] CodecProfiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ResponseProfiles.
|
||||
/// </summary>
|
||||
public ResponseProfile[] ResponseProfiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the SubtitleProfiles.
|
||||
/// </summary>
|
||||
public SubtitleProfile[] SubtitleProfiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The GetSupportedMediaTypes.
|
||||
/// </summary>
|
||||
/// <returns>The .</returns>
|
||||
public string[] GetSupportedMediaTypes()
|
||||
{
|
||||
return ContainerProfile.SplitValue(SupportedMediaTypes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the audio transcoding profile.
|
||||
/// </summary>
|
||||
/// <param name="container">The container.</param>
|
||||
/// <param name="audioCodec">The audio Codec.</param>
|
||||
/// <returns>A <see cref="TranscodingProfile"/>.</returns>
|
||||
public TranscodingProfile GetAudioTranscodingProfile(string container, string audioCodec)
|
||||
{
|
||||
container = (container ?? string.Empty).TrimStart('.');
|
||||
@@ -158,6 +271,13 @@ namespace MediaBrowser.Model.Dlna
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the video transcoding profile.
|
||||
/// </summary>
|
||||
/// <param name="container">The container.</param>
|
||||
/// <param name="audioCodec">The audio Codec.</param>
|
||||
/// <param name="videoCodec">The video Codec.</param>
|
||||
/// <returns>The <see cref="TranscodingProfile"/>.</returns>
|
||||
public TranscodingProfile GetVideoTranscodingProfile(string container, string audioCodec, string videoCodec)
|
||||
{
|
||||
container = (container ?? string.Empty).TrimStart('.');
|
||||
@@ -190,6 +310,16 @@ namespace MediaBrowser.Model.Dlna
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the audio media profile.
|
||||
/// </summary>
|
||||
/// <param name="container">The container.</param>
|
||||
/// <param name="audioCodec">The audio codec.</param>
|
||||
/// <param name="audioChannels">The audio channels.</param>
|
||||
/// <param name="audioBitrate">The audio bitrate.</param>
|
||||
/// <param name="audioSampleRate">The audio sample rate.</param>
|
||||
/// <param name="audioBitDepth">The audio bit depth.</param>
|
||||
/// <returns>The <see cref="ResponseProfile"/>.</returns>
|
||||
public ResponseProfile GetAudioMediaProfile(string container, string audioCodec, int? audioChannels, int? audioBitrate, int? audioSampleRate, int? audioBitDepth)
|
||||
{
|
||||
foreach (var i in ResponseProfiles)
|
||||
@@ -231,6 +361,11 @@ namespace MediaBrowser.Model.Dlna
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the model profile condition.
|
||||
/// </summary>
|
||||
/// <param name="c">The c<see cref="ProfileCondition"/>.</param>
|
||||
/// <returns>The <see cref="ProfileCondition"/>.</returns>
|
||||
private ProfileCondition GetModelProfileCondition(ProfileCondition c)
|
||||
{
|
||||
return new ProfileCondition
|
||||
@@ -242,6 +377,13 @@ namespace MediaBrowser.Model.Dlna
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the image media profile.
|
||||
/// </summary>
|
||||
/// <param name="container">The container.</param>
|
||||
/// <param name="width">The width.</param>
|
||||
/// <param name="height">The height.</param>
|
||||
/// <returns>The <see cref="ResponseProfile"/>.</returns>
|
||||
public ResponseProfile GetImageMediaProfile(string container, int? width, int? height)
|
||||
{
|
||||
foreach (var i in ResponseProfiles)
|
||||
@@ -277,6 +419,29 @@ namespace MediaBrowser.Model.Dlna
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the video media profile.
|
||||
/// </summary>
|
||||
/// <param name="container">The container.</param>
|
||||
/// <param name="audioCodec">The audio codec.</param>
|
||||
/// <param name="videoCodec">The video codec.</param>
|
||||
/// <param name="width">The width.</param>
|
||||
/// <param name="height">The height.</param>
|
||||
/// <param name="bitDepth">The bit depth.</param>
|
||||
/// <param name="videoBitrate">The video bitrate.</param>
|
||||
/// <param name="videoProfile">The video profile.</param>
|
||||
/// <param name="videoLevel">The video level.</param>
|
||||
/// <param name="videoFramerate">The video framerate.</param>
|
||||
/// <param name="packetLength">The packet length.</param>
|
||||
/// <param name="timestamp">The timestamp<see cref="TransportStreamTimestamp"/>.</param>
|
||||
/// <param name="isAnamorphic">True if anamorphic.</param>
|
||||
/// <param name="isInterlaced">True if interlaced.</param>
|
||||
/// <param name="refFrames">The ref frames.</param>
|
||||
/// <param name="numVideoStreams">The number of video streams.</param>
|
||||
/// <param name="numAudioStreams">The number of audio streams.</param>
|
||||
/// <param name="videoCodecTag">The video Codec tag.</param>
|
||||
/// <param name="isAvc">True if Avc.</param>
|
||||
/// <returns>The <see cref="ResponseProfile"/>.</returns>
|
||||
public ResponseProfile GetVideoMediaProfile(
|
||||
string container,
|
||||
string audioCodec,
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
int? maxWidth,
|
||||
int? maxHeight)
|
||||
{
|
||||
// If the bitrate isn't changing, then don't downlscale the resolution
|
||||
// If the bitrate isn't changing, then don't downscale the resolution
|
||||
if (inputBitrate.HasValue && outputBitrate >= inputBitrate.Value)
|
||||
{
|
||||
if (maxWidth.HasValue || maxHeight.HasValue)
|
||||
|
||||
@@ -1494,6 +1494,32 @@ namespace MediaBrowser.Model.Dlna
|
||||
break;
|
||||
}
|
||||
|
||||
case ProfileConditionValue.AudioSampleRate:
|
||||
{
|
||||
if (!enableNonQualifiedConditions)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out var num))
|
||||
{
|
||||
if (condition.Condition == ProfileConditionType.Equals)
|
||||
{
|
||||
item.AudioSampleRate = num;
|
||||
}
|
||||
else if (condition.Condition == ProfileConditionType.LessThanEqual)
|
||||
{
|
||||
item.AudioSampleRate = Math.Min(num, item.AudioSampleRate ?? num);
|
||||
}
|
||||
else if (condition.Condition == ProfileConditionType.GreaterThanEqual)
|
||||
{
|
||||
item.AudioSampleRate = Math.Max(num, item.AudioSampleRate ?? num);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case ProfileConditionValue.AudioChannels:
|
||||
{
|
||||
if (string.IsNullOrEmpty(qualifier))
|
||||
|
||||
@@ -110,6 +110,8 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
public int? AudioBitrate { get; set; }
|
||||
|
||||
public int? AudioSampleRate { get; set; }
|
||||
|
||||
public int? VideoBitrate { get; set; }
|
||||
|
||||
public int? MaxWidth { get; set; }
|
||||
@@ -183,8 +185,10 @@ namespace MediaBrowser.Model.Dlna
|
||||
continue;
|
||||
}
|
||||
|
||||
// Be careful, IsDirectStream==true by default (Static != false or not in query).
|
||||
// See initialization of StreamingRequestDto in AudioController.GetAudioStream() method : Static = @static ?? true.
|
||||
if (string.Equals(pair.Name, "Static", StringComparison.OrdinalIgnoreCase) &&
|
||||
string.Equals(pair.Value, "false", StringComparison.OrdinalIgnoreCase))
|
||||
string.Equals(pair.Value, "true", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -250,6 +254,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
list.Add(new NameValuePair("SubtitleStreamIndex", item.SubtitleStreamIndex.HasValue && item.SubtitleDeliveryMethod != SubtitleDeliveryMethod.External ? item.SubtitleStreamIndex.Value.ToString(CultureInfo.InvariantCulture) : string.Empty));
|
||||
list.Add(new NameValuePair("VideoBitrate", item.VideoBitrate.HasValue ? item.VideoBitrate.Value.ToString(CultureInfo.InvariantCulture) : string.Empty));
|
||||
list.Add(new NameValuePair("AudioBitrate", item.AudioBitrate.HasValue ? item.AudioBitrate.Value.ToString(CultureInfo.InvariantCulture) : string.Empty));
|
||||
list.Add(new NameValuePair("AudioSampleRate", item.AudioSampleRate.HasValue ? item.AudioSampleRate.Value.ToString(CultureInfo.InvariantCulture) : string.Empty));
|
||||
|
||||
list.Add(new NameValuePair("MaxFramerate", item.MaxFramerate.HasValue ? item.MaxFramerate.Value.ToString(CultureInfo.InvariantCulture) : string.Empty));
|
||||
list.Add(new NameValuePair("MaxWidth", item.MaxWidth.HasValue ? item.MaxWidth.Value.ToString(CultureInfo.InvariantCulture) : string.Empty));
|
||||
@@ -521,7 +526,9 @@ namespace MediaBrowser.Model.Dlna
|
||||
get
|
||||
{
|
||||
var stream = TargetAudioStream;
|
||||
return stream == null ? null : stream.SampleRate;
|
||||
return AudioSampleRate.HasValue && !IsDirectStream
|
||||
? AudioSampleRate
|
||||
: stream == null ? null : stream.SampleRate;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,11 +5,20 @@ using System.Xml.Serialization;
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the <see cref="XmlAttribute" />.
|
||||
/// </summary>
|
||||
public class XmlAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the attribute.
|
||||
/// </summary>
|
||||
[XmlAttribute("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the attribute.
|
||||
/// </summary>
|
||||
[XmlAttribute("value")]
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
@@ -191,6 +191,11 @@ namespace MediaBrowser.Model.Entities
|
||||
attributes.Add(Codec.ToUpperInvariant());
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(VideoRange))
|
||||
{
|
||||
attributes.Add(VideoRange.ToUpperInvariant());
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Title))
|
||||
{
|
||||
var result = new StringBuilder(Title);
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
namespace MediaBrowser.Model.Net
|
||||
{
|
||||
/// <summary>
|
||||
/// Class HttpException.
|
||||
/// </summary>
|
||||
public class HttpException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the status code.
|
||||
/// </summary>
|
||||
/// <value>The status code.</value>
|
||||
public HttpStatusCode? StatusCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is timed out.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is timed out; otherwise, <c>false</c>.</value>
|
||||
public bool IsTimedOut { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HttpException" /> class.
|
||||
/// </summary>
|
||||
/// <param name="message">The message.</param>
|
||||
/// <param name="innerException">The inner exception.</param>
|
||||
public HttpException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HttpException" /> class.
|
||||
/// </summary>
|
||||
/// <param name="message">The message.</param>
|
||||
public HttpException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user