diff options
| author | tikuf <admin@nyalindee.com> | 2014-04-02 16:53:53 +1100 |
|---|---|---|
| committer | tikuf <admin@nyalindee.com> | 2014-04-02 16:53:53 +1100 |
| commit | 9ff262bc2ac24be2931505aa877b0c500fcb988a (patch) | |
| tree | 75ef8f32fc4b7359cc48f45be58216491d624b93 /MediaBrowser.Controller | |
| parent | 8882925dab080eb236a5cc896f48ed99711d76a8 (diff) | |
| parent | 6fe7264f7828aff196e19cfa3497835c5921a7f9 (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Dlna/CodecProfile.cs | 86 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Dlna/ContainerProfile.cs | 26 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Dlna/DeviceIdentification.cs | 83 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Dlna/DeviceProfile.cs | 231 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Dlna/DirectPlayProfile.cs | 43 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Dlna/ResponseProfile.cs | 49 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Dlna/TranscodingProfile.cs | 47 | ||||
| -rw-r--r-- | MediaBrowser.Controller/MediaBrowser.Controller.csproj | 7 | ||||
| -rw-r--r-- | MediaBrowser.Controller/MediaEncoding/EncodingOptions.cs | 1 |
9 files changed, 1 insertions, 572 deletions
diff --git a/MediaBrowser.Controller/Dlna/CodecProfile.cs b/MediaBrowser.Controller/Dlna/CodecProfile.cs deleted file mode 100644 index e2eb60d9a..000000000 --- a/MediaBrowser.Controller/Dlna/CodecProfile.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Xml.Serialization; - -namespace MediaBrowser.Controller.Dlna -{ - public class CodecProfile - { - [XmlAttribute("type")] - public CodecType Type { get; set; } - - public ProfileCondition[] Conditions { get; set; } - - [XmlAttribute("codec")] - public string Codec { get; set; } - - public CodecProfile() - { - Conditions = new ProfileCondition[] {}; - } - - public List<string> GetCodecs() - { - return (Codec ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList(); - } - - public bool ContainsCodec(string codec) - { - var codecs = GetCodecs(); - - return codecs.Count == 0 || codecs.Contains(codec, StringComparer.OrdinalIgnoreCase); - } - } - - public enum CodecType - { - Video = 0, - VideoAudio = 1, - Audio = 2 - } - - 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() - { - IsRequired = true; - } - } - - public enum ProfileConditionType - { - Equals = 0, - NotEquals = 1, - LessThanEqual = 2, - GreaterThanEqual = 3 - } - - public enum ProfileConditionValue - { - AudioChannels, - AudioBitrate, - AudioProfile, - Filesize, - Width, - Height, - Has64BitOffsets, - VideoBitDepth, - VideoBitrate, - VideoFramerate, - VideoLevel, - VideoProfile - } -} diff --git a/MediaBrowser.Controller/Dlna/ContainerProfile.cs b/MediaBrowser.Controller/Dlna/ContainerProfile.cs deleted file mode 100644 index 1029ba72c..000000000 --- a/MediaBrowser.Controller/Dlna/ContainerProfile.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Xml.Serialization; - -namespace MediaBrowser.Controller.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() - { - Conditions = new ProfileCondition[] { }; - } - - public List<string> GetContainers() - { - return (Container ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList(); - } - } -} diff --git a/MediaBrowser.Controller/Dlna/DeviceIdentification.cs b/MediaBrowser.Controller/Dlna/DeviceIdentification.cs deleted file mode 100644 index c9cd4bc70..000000000 --- a/MediaBrowser.Controller/Dlna/DeviceIdentification.cs +++ /dev/null @@ -1,83 +0,0 @@ - -using System.Xml.Serialization; - -namespace MediaBrowser.Controller.Dlna -{ - public class DeviceIdentification - { - /// <summary> - /// Gets or sets the name of the friendly. - /// </summary> - /// <value>The name of the friendly.</value> - public string FriendlyName { get; set; } - /// <summary> - /// Gets or sets the model number. - /// </summary> - /// <value>The model number.</value> - public string ModelNumber { get; set; } - /// <summary> - /// Gets or sets the serial number. - /// </summary> - /// <value>The serial number.</value> - public string SerialNumber { get; set; } - /// <summary> - /// Gets or sets the name of the model. - /// </summary> - /// <value>The name of the model.</value> - public string ModelName { get; set; } - /// <summary> - /// Gets or sets the model description. - /// </summary> - /// <value>The model description.</value> - public string ModelDescription { get; set; } - /// <summary> - /// Gets or sets the device description. - /// </summary> - /// <value>The device description.</value> - public string DeviceDescription { get; set; } - /// <summary> - /// Gets or sets the model URL. - /// </summary> - /// <value>The model URL.</value> - public string ModelUrl { get; set; } - /// <summary> - /// Gets or sets the manufacturer. - /// </summary> - /// <value>The manufacturer.</value> - public string Manufacturer { get; set; } - /// <summary> - /// Gets or sets the manufacturer URL. - /// </summary> - /// <value>The manufacturer URL.</value> - public string ManufacturerUrl { get; set; } - /// <summary> - /// Gets or sets the headers. - /// </summary> - /// <value>The headers.</value> - public HttpHeaderInfo[] Headers { get; set; } - - public DeviceIdentification() - { - Headers = new HttpHeaderInfo[] {}; - } - } - - public class HttpHeaderInfo - { - [XmlAttribute("name")] - public string Name { get; set; } - - [XmlAttribute("value")] - public string Value { get; set; } - - [XmlAttribute("match")] - public HeaderMatchType Match { get; set; } - } - - public enum HeaderMatchType - { - Equals = 0, - Regex = 1, - Substring = 2 - } -} diff --git a/MediaBrowser.Controller/Dlna/DeviceProfile.cs b/MediaBrowser.Controller/Dlna/DeviceProfile.cs deleted file mode 100644 index bb9629c28..000000000 --- a/MediaBrowser.Controller/Dlna/DeviceProfile.cs +++ /dev/null @@ -1,231 +0,0 @@ -using MediaBrowser.Model.Dlna; -using MediaBrowser.Model.Entities; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Xml.Serialization; - -namespace MediaBrowser.Controller.Dlna -{ - [XmlRoot("Profile")] - public class DeviceProfile - { - /// <summary> - /// Gets or sets the name. - /// </summary> - /// <value>The name.</value> - public string Name { get; set; } - - [XmlIgnore] - public string Id { get; set; } - - [XmlIgnore] - public DeviceProfileType ProfileType { 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 bool IgnoreTranscodeByteRangeRequests { get; set; } - public bool EnableAlbumArtInDidl { get; set; } - - public string SupportedMediaTypes { get; set; } - - /// <summary> - /// Controls the content of the X_DLNADOC element in the urn:schemas-dlna-org:device-1-0 namespace. - /// </summary> - public string XDlnaDoc { get; set; } - /// <summary> - /// Controls the content of the X_DLNACAP element in the urn:schemas-dlna-org:device-1-0 namespace. - /// </summary> - public string XDlnaCap { get; set; } - /// <summary> - /// Controls the content of the aggregationFlags element in the urn:schemas-sonycom:av. - /// </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; } - - /// <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 DeviceProfile() - { - DirectPlayProfiles = new DirectPlayProfile[] { }; - TranscodingProfiles = new TranscodingProfile[] { }; - ResponseProfiles = new ResponseProfile[] { }; - CodecProfiles = new CodecProfile[] { }; - ContainerProfiles = new ContainerProfile[] { }; - - SupportedMediaTypes = "Audio,Photo,Video"; - } - - public List<string> GetSupportedMediaTypes() - { - return (SupportedMediaTypes ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList(); - } - - public TranscodingProfile GetAudioTranscodingProfile(string container, string audioCodec) - { - container = (container ?? string.Empty).TrimStart('.'); - - return TranscodingProfiles.FirstOrDefault(i => - { - if (i.Type != DlnaProfileType.Audio) - { - return false; - } - - if (!string.Equals(container, i.Container, StringComparison.OrdinalIgnoreCase)) - { - return false; - } - - if (!i.GetAudioCodecs().Contains(audioCodec ?? string.Empty)) - { - return false; - } - - return true; - }); - } - - public TranscodingProfile GetVideoTranscodingProfile(string container, string audioCodec, string videoCodec) - { - container = (container ?? string.Empty).TrimStart('.'); - - return TranscodingProfiles.FirstOrDefault(i => - { - if (i.Type != DlnaProfileType.Video) - { - return false; - } - - if (!string.Equals(container, i.Container, StringComparison.OrdinalIgnoreCase)) - { - return false; - } - - if (!i.GetAudioCodecs().Contains(audioCodec ?? string.Empty)) - { - return false; - } - - if (!string.Equals(videoCodec, i.VideoCodec, StringComparison.OrdinalIgnoreCase)) - { - return false; - } - - return true; - }); - } - - public ResponseProfile GetAudioMediaProfile(string container, string audioCodec, MediaStream audioStream) - { - container = (container ?? string.Empty).TrimStart('.'); - - return ResponseProfiles.FirstOrDefault(i => - { - if (i.Type != DlnaProfileType.Audio) - { - return false; - } - - var containers = i.GetContainers().ToList(); - if (containers.Count > 0 && !containers.Contains(container)) - { - return false; - } - - var audioCodecs = i.GetAudioCodecs().ToList(); - if (audioCodecs.Count > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty)) - { - return false; - } - - return true; - }); - } - - public ResponseProfile GetVideoMediaProfile(string container, string audioCodec, string videoCodec, MediaStream audioStream, MediaStream videoStream) - { - container = (container ?? string.Empty).TrimStart('.'); - - return ResponseProfiles.FirstOrDefault(i => - { - if (i.Type != DlnaProfileType.Video) - { - return false; - } - - var containers = i.GetContainers().ToList(); - if (containers.Count > 0 && !containers.Contains(container)) - { - return false; - } - - var audioCodecs = i.GetAudioCodecs().ToList(); - if (audioCodecs.Count > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty)) - { - return false; - } - - var videoCodecs = i.GetVideoCodecs().ToList(); - if (videoCodecs.Count > 0 && !videoCodecs.Contains(videoCodec ?? string.Empty)) - { - return false; - } - - return true; - }); - } - - public ResponseProfile GetPhotoMediaProfile(string container) - { - container = (container ?? string.Empty).TrimStart('.'); - - return ResponseProfiles.FirstOrDefault(i => - { - if (i.Type != DlnaProfileType.Photo) - { - return false; - } - - var containers = i.GetContainers().ToList(); - if (containers.Count > 0 && !containers.Contains(container)) - { - return false; - } - - return true; - }); - } - } -} diff --git a/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs b/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs deleted file mode 100644 index ad70640da..000000000 --- a/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Xml.Serialization; - -namespace MediaBrowser.Controller.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() - { - return (Container ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList(); - } - - public List<string> GetAudioCodecs() - { - return (AudioCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList(); - } - - public List<string> GetVideoCodecs() - { - return (VideoCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList(); - } - } - - public enum DlnaProfileType - { - Audio = 0, - Video = 1, - Photo = 2 - } -} diff --git a/MediaBrowser.Controller/Dlna/ResponseProfile.cs b/MediaBrowser.Controller/Dlna/ResponseProfile.cs deleted file mode 100644 index 163a95d5a..000000000 --- a/MediaBrowser.Controller/Dlna/ResponseProfile.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Xml.Serialization; - -namespace MediaBrowser.Controller.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; } - - public ResponseProfile() - { - Conditions = new ProfileCondition[] {}; - } - - public List<string> GetContainers() - { - return (Container ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList(); - } - - public List<string> GetAudioCodecs() - { - return (AudioCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList(); - } - - public List<string> GetVideoCodecs() - { - return (VideoCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList(); - } - } -} diff --git a/MediaBrowser.Controller/Dlna/TranscodingProfile.cs b/MediaBrowser.Controller/Dlna/TranscodingProfile.cs deleted file mode 100644 index 704ba54d2..000000000 --- a/MediaBrowser.Controller/Dlna/TranscodingProfile.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Xml.Serialization; - -namespace MediaBrowser.Controller.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("videoProfile")] - public string VideoProfile { get; set; } - - public List<string> GetAudioCodecs() - { - return (AudioCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList(); - } - } - - public enum TranscodeSeekInfo - { - Auto = 0, - Bytes = 1 - } -} diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index a233c1f12..760d07611 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -78,14 +78,7 @@ <Compile Include="Channels\Channel.cs" /> <Compile Include="Collections\CollectionCreationOptions.cs" /> <Compile Include="Collections\ICollectionManager.cs" /> - <Compile Include="Dlna\CodecProfile.cs" /> - <Compile Include="Dlna\ContainerProfile.cs" /> - <Compile Include="Dlna\DeviceIdentification.cs" /> - <Compile Include="Dlna\DirectPlayProfile.cs" /> <Compile Include="Dlna\IDlnaManager.cs" /> - <Compile Include="Dlna\DeviceProfile.cs" /> - <Compile Include="Dlna\ResponseProfile.cs" /> - <Compile Include="Dlna\TranscodingProfile.cs" /> <Compile Include="Drawing\IImageProcessor.cs" /> <Compile Include="Drawing\ImageFormat.cs" /> <Compile Include="Drawing\ImageProcessingOptions.cs" /> diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingOptions.cs b/MediaBrowser.Controller/MediaEncoding/EncodingOptions.cs index 74235becd..26182ebc4 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingOptions.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingOptions.cs @@ -1,4 +1,5 @@ using MediaBrowser.Controller.Dlna; +using MediaBrowser.Model.Dlna; namespace MediaBrowser.Controller.MediaEncoding { |
