diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-12-09 21:02:33 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-09 21:02:33 -0500 |
| commit | c79706efe543199c7efdaef2bc2afd8dfb9b5e61 (patch) | |
| tree | dcb5dee8328bc50978ec09fb3075d5244faad165 /MediaBrowser.Model | |
| parent | 003650f2d669d68cd382281daa2d3af8a1a02d30 (diff) | |
| parent | e936f49518bcd6e28d44600d58205fee9c1e21fd (diff) | |
Merge pull request #2334 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Model')
| -rw-r--r-- | MediaBrowser.Model/Dlna/CodecProfile.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/ContainerProfile.cs | 3 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/DeviceProfile.cs | 57 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/DirectPlayProfile.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/HttpHeaderInfo.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/ProfileCondition.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/ResponseProfile.cs | 7 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/SubtitleProfile.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/TranscodingProfile.cs | 14 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/XmlAttribute.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Model/System/SystemInfo.cs | 6 |
11 files changed, 85 insertions, 28 deletions
diff --git a/MediaBrowser.Model/Dlna/CodecProfile.cs b/MediaBrowser.Model/Dlna/CodecProfile.cs index 70345d2bc..29d4d21ec 100644 --- a/MediaBrowser.Model/Dlna/CodecProfile.cs +++ b/MediaBrowser.Model/Dlna/CodecProfile.cs @@ -1,19 +1,23 @@ using MediaBrowser.Model.Extensions; using System.Collections.Generic; using System.Xml.Serialization; +using MediaBrowser.Model.Dlna; namespace MediaBrowser.Model.Dlna { public class CodecProfile { + [XmlAttribute("type")] public CodecType Type { get; set; } public ProfileCondition[] Conditions { get; set; } public ProfileCondition[] ApplyConditions { get; set; } + [XmlAttribute("codec")] public string Codec { get; set; } + [XmlAttribute("container")] public string Container { get; set; } public CodecProfile() diff --git a/MediaBrowser.Model/Dlna/ContainerProfile.cs b/MediaBrowser.Model/Dlna/ContainerProfile.cs index 92f2fc7c0..d9b75dfc2 100644 --- a/MediaBrowser.Model/Dlna/ContainerProfile.cs +++ b/MediaBrowser.Model/Dlna/ContainerProfile.cs @@ -1,13 +1,16 @@ using System.Collections.Generic; using System.Xml.Serialization; +using MediaBrowser.Model.Dlna; namespace MediaBrowser.Model.Dlna { public class ContainerProfile { + [XmlAttribute("type")] public DlnaProfileType Type { get; set; } public ProfileCondition[] Conditions { get; set; } + [XmlAttribute("container")] public string Container { get; set; } public ContainerProfile() diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.cs index 66ebb867d..821531ed0 100644 --- a/MediaBrowser.Model/Dlna/DeviceProfile.cs +++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs @@ -1,10 +1,11 @@ using MediaBrowser.Model.Extensions; using MediaBrowser.Model.MediaInfo; using System.Collections.Generic; -using MediaBrowser.Model.Serialization; +using System.Xml.Serialization; namespace MediaBrowser.Model.Dlna { + [XmlRoot("Profile")] public class DeviceProfile { /// <summary> @@ -13,16 +14,17 @@ namespace MediaBrowser.Model.Dlna /// <value>The name.</value> public string Name { get; set; } + [XmlIgnore] public string Id { get; set; } - [IgnoreDataMember] - public DeviceProfileType ProfileType { get; set; } + [XmlIgnore] + public MediaBrowser.Model.Dlna.DeviceProfileType ProfileType { get; set; } /// <summary> /// Gets or sets the identification. /// </summary> /// <value>The identification.</value> - public DeviceIdentification Identification { get; set; } + public MediaBrowser.Model.Dlna.DeviceIdentification Identification { get; set; } public string FriendlyName { get; set; } public string Manufacturer { get; set; } @@ -34,8 +36,8 @@ namespace MediaBrowser.Model.Dlna public string SerialNumber { get; set; } public bool EnableAlbumArtInDidl { get; set; } - public bool EnableSingleAlbumArtLimit { get; set; } - public bool EnableSingleSubtitleLimit { get; set; } + public bool EnableSingleAlbumArtLimit { get; set; } + public bool EnableSingleSubtitleLimit { get; set; } public string SupportedMediaTypes { get; set; } @@ -97,7 +99,7 @@ namespace MediaBrowser.Model.Dlna public ResponseProfile[] ResponseProfiles { get; set; } public SubtitleProfile[] SubtitleProfiles { get; set; } - + public DeviceProfile() { DirectPlayProfiles = new DirectPlayProfile[] { }; @@ -106,9 +108,9 @@ namespace MediaBrowser.Model.Dlna CodecProfiles = new CodecProfile[] { }; ContainerProfiles = new ContainerProfile[] { }; SubtitleProfiles = new SubtitleProfile[] { }; - + XmlRootAttributes = new XmlAttribute[] { }; - + SupportedMediaTypes = "Audio,Photo,Video"; MaxStreamingBitrate = 8000000; MaxStaticBitrate = 8000000; @@ -120,7 +122,7 @@ namespace MediaBrowser.Model.Dlna List<string> list = new List<string>(); foreach (string i in (SupportedMediaTypes ?? string.Empty).Split(',')) { - if (!string.IsNullOrEmpty(i)) + if (!string.IsNullOrEmpty(i)) list.Add(i); } return list; @@ -132,7 +134,7 @@ namespace MediaBrowser.Model.Dlna foreach (var i in TranscodingProfiles) { - if (i.Type != DlnaProfileType.Audio) + if (i.Type != MediaBrowser.Model.Dlna.DlnaProfileType.Audio) { continue; } @@ -158,7 +160,7 @@ namespace MediaBrowser.Model.Dlna foreach (var i in TranscodingProfiles) { - if (i.Type != DlnaProfileType.Video) + if (i.Type != MediaBrowser.Model.Dlna.DlnaProfileType.Video) { continue; } @@ -189,7 +191,7 @@ namespace MediaBrowser.Model.Dlna foreach (var i in ResponseProfiles) { - if (i.Type != DlnaProfileType.Audio) + if (i.Type != MediaBrowser.Model.Dlna.DlnaProfileType.Audio) { continue; } @@ -206,12 +208,12 @@ namespace MediaBrowser.Model.Dlna continue; } - ConditionProcessor conditionProcessor = new ConditionProcessor(); + var conditionProcessor = new MediaBrowser.Model.Dlna.ConditionProcessor(); var anyOff = false; foreach (ProfileCondition c in i.Conditions) { - if (!conditionProcessor.IsAudioConditionSatisfied(c, audioChannels, audioBitrate)) + if (!conditionProcessor.IsAudioConditionSatisfied(GetModelProfileCondition(c), audioChannels, audioBitrate)) { anyOff = true; break; @@ -228,13 +230,24 @@ namespace MediaBrowser.Model.Dlna return null; } + private MediaBrowser.Model.Dlna.ProfileCondition GetModelProfileCondition(ProfileCondition c) + { + return new MediaBrowser.Model.Dlna.ProfileCondition + { + Condition = c.Condition, + IsRequired = c.IsRequired, + Property = c.Property, + Value = c.Value + }; + } + public ResponseProfile GetImageMediaProfile(string container, int? width, int? height) { container = StringHelper.TrimStart(container ?? string.Empty, '.'); foreach (var i in ResponseProfiles) { - if (i.Type != DlnaProfileType.Photo) + if (i.Type != MediaBrowser.Model.Dlna.DlnaProfileType.Photo) { continue; } @@ -245,12 +258,12 @@ namespace MediaBrowser.Model.Dlna continue; } - ConditionProcessor conditionProcessor = new ConditionProcessor(); + var conditionProcessor = new MediaBrowser.Model.Dlna.ConditionProcessor(); var anyOff = false; foreach (ProfileCondition c in i.Conditions) { - if (!conditionProcessor.IsImageConditionSatisfied(c, width, height)) + if (!conditionProcessor.IsImageConditionSatisfied(GetModelProfileCondition(c), width, height)) { anyOff = true; break; @@ -267,7 +280,7 @@ namespace MediaBrowser.Model.Dlna return null; } - public ResponseProfile GetVideoMediaProfile(string container, + public ResponseProfile GetVideoMediaProfile(string container, string audioCodec, string videoCodec, int? width, @@ -290,7 +303,7 @@ namespace MediaBrowser.Model.Dlna foreach (var i in ResponseProfiles) { - if (i.Type != DlnaProfileType.Video) + if (i.Type != MediaBrowser.Model.Dlna.DlnaProfileType.Video) { continue; } @@ -313,12 +326,12 @@ namespace MediaBrowser.Model.Dlna continue; } - ConditionProcessor conditionProcessor = new ConditionProcessor(); + var conditionProcessor = new MediaBrowser.Model.Dlna.ConditionProcessor(); var anyOff = false; foreach (ProfileCondition c in i.Conditions) { - if (!conditionProcessor.IsVideoConditionSatisfied(c, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc)) + if (!conditionProcessor.IsVideoConditionSatisfied(GetModelProfileCondition(c), width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc)) { anyOff = true; break; diff --git a/MediaBrowser.Model/Dlna/DirectPlayProfile.cs b/MediaBrowser.Model/Dlna/DirectPlayProfile.cs index 3847a3671..0b6ecf385 100644 --- a/MediaBrowser.Model/Dlna/DirectPlayProfile.cs +++ b/MediaBrowser.Model/Dlna/DirectPlayProfile.cs @@ -1,15 +1,21 @@ using System.Collections.Generic; +using System.Xml.Serialization; +using MediaBrowser.Model.Dlna; namespace MediaBrowser.Model.Dlna { public class DirectPlayProfile { + [XmlAttribute("container")] public string Container { get; set; } + [XmlAttribute("audioCodec")] public string AudioCodec { get; set; } + [XmlAttribute("videoCodec")] public string VideoCodec { get; set; } + [XmlAttribute("type")] public DlnaProfileType Type { get; set; } public List<string> GetContainers() diff --git a/MediaBrowser.Model/Dlna/HttpHeaderInfo.cs b/MediaBrowser.Model/Dlna/HttpHeaderInfo.cs index 517757281..b4fa4e0af 100644 --- a/MediaBrowser.Model/Dlna/HttpHeaderInfo.cs +++ b/MediaBrowser.Model/Dlna/HttpHeaderInfo.cs @@ -1,13 +1,17 @@ using System.Xml.Serialization; +using MediaBrowser.Model.Dlna; namespace MediaBrowser.Model.Dlna { public class HttpHeaderInfo { + [XmlAttribute("name")] public string Name { get; set; } + [XmlAttribute("value")] public string Value { get; set; } + [XmlAttribute("match")] public HeaderMatchType Match { get; set; } } }
\ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/ProfileCondition.cs b/MediaBrowser.Model/Dlna/ProfileCondition.cs index 587c628ff..3d104f9c4 100644 --- a/MediaBrowser.Model/Dlna/ProfileCondition.cs +++ b/MediaBrowser.Model/Dlna/ProfileCondition.cs @@ -1,15 +1,20 @@ using System.Xml.Serialization; +using MediaBrowser.Model.Dlna; namespace MediaBrowser.Model.Dlna { public class ProfileCondition { + [XmlAttribute("condition")] public ProfileConditionType Condition { get; set; } + [XmlAttribute("property")] public ProfileConditionValue Property { get; set; } + [XmlAttribute("value")] public string Value { get; set; } + [XmlAttribute("isRequired")] public bool IsRequired { get; set; } public ProfileCondition() diff --git a/MediaBrowser.Model/Dlna/ResponseProfile.cs b/MediaBrowser.Model/Dlna/ResponseProfile.cs index 15d76df82..1d4791b5c 100644 --- a/MediaBrowser.Model/Dlna/ResponseProfile.cs +++ b/MediaBrowser.Model/Dlna/ResponseProfile.cs @@ -1,20 +1,27 @@ using System.Collections.Generic; using System.Xml.Serialization; +using MediaBrowser.Model.Dlna; namespace MediaBrowser.Model.Dlna { public class ResponseProfile { + [XmlAttribute("container")] public string Container { get; set; } + [XmlAttribute("audioCodec")] public string AudioCodec { get; set; } + [XmlAttribute("videoCodec")] public string VideoCodec { get; set; } + [XmlAttribute("type")] public DlnaProfileType Type { get; set; } + [XmlAttribute("orgPn")] public string OrgPn { get; set; } + [XmlAttribute("mimeType")] public string MimeType { get; set; } public ProfileCondition[] Conditions { get; set; } diff --git a/MediaBrowser.Model/Dlna/SubtitleProfile.cs b/MediaBrowser.Model/Dlna/SubtitleProfile.cs index ea7e0bda8..f182541d8 100644 --- a/MediaBrowser.Model/Dlna/SubtitleProfile.cs +++ b/MediaBrowser.Model/Dlna/SubtitleProfile.cs @@ -1,17 +1,22 @@ using MediaBrowser.Model.Extensions; using System.Collections.Generic; using System.Xml.Serialization; +using MediaBrowser.Model.Dlna; namespace MediaBrowser.Model.Dlna { public class SubtitleProfile { + [XmlAttribute("format")] public string Format { get; set; } + [XmlAttribute("method")] public SubtitleDeliveryMethod Method { get; set; } + [XmlAttribute("didlMode")] public string DidlMode { get; set; } + [XmlAttribute("language")] public string Language { get; set; } public List<string> GetLanguages() diff --git a/MediaBrowser.Model/Dlna/TranscodingProfile.cs b/MediaBrowser.Model/Dlna/TranscodingProfile.cs index 15127dcba..0f9fbae30 100644 --- a/MediaBrowser.Model/Dlna/TranscodingProfile.cs +++ b/MediaBrowser.Model/Dlna/TranscodingProfile.cs @@ -1,34 +1,48 @@ using System.Collections.Generic; using System.Xml.Serialization; +using MediaBrowser.Model.Dlna; namespace MediaBrowser.Model.Dlna { public class TranscodingProfile { + [XmlAttribute("container")] public string Container { get; set; } + [XmlAttribute("type")] public DlnaProfileType Type { get; set; } + [XmlAttribute("videoCodec")] public string VideoCodec { get; set; } + [XmlAttribute("audioCodec")] public string AudioCodec { get; set; } + [XmlAttribute("protocol")] public string Protocol { get; set; } + [XmlAttribute("estimateContentLength")] public bool EstimateContentLength { get; set; } + [XmlAttribute("enableMpegtsM2TsMode")] public bool EnableMpegtsM2TsMode { get; set; } + [XmlAttribute("transcodeSeekInfo")] public TranscodeSeekInfo TranscodeSeekInfo { get; set; } + [XmlAttribute("copyTimestamps")] public bool CopyTimestamps { get; set; } + [XmlAttribute("context")] public EncodingContext Context { get; set; } + [XmlAttribute("enableSubtitlesInManifest")] public bool EnableSubtitlesInManifest { get; set; } + [XmlAttribute("enableSplittingOnNonKeyFrames")] public bool EnableSplittingOnNonKeyFrames { get; set; } + [XmlAttribute("maxAudioChannels")] public string MaxAudioChannels { get; set; } public List<string> GetAudioCodecs() diff --git a/MediaBrowser.Model/Dlna/XmlAttribute.cs b/MediaBrowser.Model/Dlna/XmlAttribute.cs index 661ccf4b6..e8e13ba0d 100644 --- a/MediaBrowser.Model/Dlna/XmlAttribute.cs +++ b/MediaBrowser.Model/Dlna/XmlAttribute.cs @@ -4,8 +4,10 @@ namespace MediaBrowser.Model.Dlna { public class XmlAttribute { + [XmlAttribute("name")] public string Name { get; set; } + [XmlAttribute("value")] public string Value { get; set; } } }
\ No newline at end of file diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs index 022e03baf..6145c7b61 100644 --- a/MediaBrowser.Model/System/SystemInfo.cs +++ b/MediaBrowser.Model/System/SystemInfo.cs @@ -49,12 +49,6 @@ namespace MediaBrowser.Model.System public bool SupportsLibraryMonitor { get; set; } /// <summary> - /// Gets or sets a value indicating whether this instance is network deployed. - /// </summary> - /// <value><c>true</c> if this instance is network deployed; otherwise, <c>false</c>.</value> - public bool IsNetworkDeployed { get; set; } - - /// <summary> /// Gets or sets the in progress installations. /// </summary> /// <value>The in progress installations.</value> |
