aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Dlna
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Dlna')
-rw-r--r--MediaBrowser.Controller/Dlna/CodecProfile.cs16
-rw-r--r--MediaBrowser.Controller/Dlna/ContainerProfile.cs4
-rw-r--r--MediaBrowser.Controller/Dlna/DeviceIdentification.cs7
-rw-r--r--MediaBrowser.Controller/Dlna/DeviceProfile.cs55
-rw-r--r--MediaBrowser.Controller/Dlna/DirectPlayProfile.cs7
-rw-r--r--MediaBrowser.Controller/Dlna/IDlnaManager.cs42
-rw-r--r--MediaBrowser.Controller/Dlna/MediaProfile.cs11
-rw-r--r--MediaBrowser.Controller/Dlna/TranscodingProfile.cs14
8 files changed, 127 insertions, 29 deletions
diff --git a/MediaBrowser.Controller/Dlna/CodecProfile.cs b/MediaBrowser.Controller/Dlna/CodecProfile.cs
index 2b9a40ea0..75f80ed3b 100644
--- a/MediaBrowser.Controller/Dlna/CodecProfile.cs
+++ b/MediaBrowser.Controller/Dlna/CodecProfile.cs
@@ -1,13 +1,18 @@
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()
@@ -37,9 +42,16 @@ namespace MediaBrowser.Controller.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()
@@ -69,8 +81,6 @@ namespace MediaBrowser.Controller.Dlna
VideoBitrate,
VideoFramerate,
VideoLevel,
- VideoPacketLength,
- VideoProfile,
- VideoTimestamp
+ VideoProfile
}
}
diff --git a/MediaBrowser.Controller/Dlna/ContainerProfile.cs b/MediaBrowser.Controller/Dlna/ContainerProfile.cs
index 3bd3c9eaf..1029ba72c 100644
--- a/MediaBrowser.Controller/Dlna/ContainerProfile.cs
+++ b/MediaBrowser.Controller/Dlna/ContainerProfile.cs
@@ -1,12 +1,16 @@
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()
diff --git a/MediaBrowser.Controller/Dlna/DeviceIdentification.cs b/MediaBrowser.Controller/Dlna/DeviceIdentification.cs
index 7b8e3a1e7..c9cd4bc70 100644
--- a/MediaBrowser.Controller/Dlna/DeviceIdentification.cs
+++ b/MediaBrowser.Controller/Dlna/DeviceIdentification.cs
@@ -1,4 +1,6 @@

+using System.Xml.Serialization;
+
namespace MediaBrowser.Controller.Dlna
{
public class DeviceIdentification
@@ -62,8 +64,13 @@ namespace MediaBrowser.Controller.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; }
}
diff --git a/MediaBrowser.Controller/Dlna/DeviceProfile.cs b/MediaBrowser.Controller/Dlna/DeviceProfile.cs
index f34c4bf64..5950698fb 100644
--- a/MediaBrowser.Controller/Dlna/DeviceProfile.cs
+++ b/MediaBrowser.Controller/Dlna/DeviceProfile.cs
@@ -1,9 +1,14 @@
-using MediaBrowser.Model.Entities;
+using MediaBrowser.Model.Dlna;
+using MediaBrowser.Model.Entities;
using System;
+using System.Collections.Generic;
using System.Linq;
+using System.Runtime.Serialization;
+using System.Xml.Serialization;
namespace MediaBrowser.Controller.Dlna
{
+ [XmlRoot("Profile")]
public class DeviceProfile
{
/// <summary>
@@ -12,19 +17,11 @@ namespace MediaBrowser.Controller.Dlna
/// <value>The name.</value>
public string Name { get; set; }
- /// <summary>
- /// Gets or sets the transcoding profiles.
- /// </summary>
- /// <value>The transcoding profiles.</value>
- public TranscodingProfile[] TranscodingProfiles { get; set; }
+ [XmlIgnore]
+ public string Id { get; set; }
- /// <summary>
- /// Gets or sets the direct play profiles.
- /// </summary>
- /// <value>The direct play profiles.</value>
- public DirectPlayProfile[] DirectPlayProfiles { get; set; }
-
- public ContainerProfile[] ContainerProfiles { get; set; }
+ [XmlIgnore]
+ public DeviceProfileType ProfileType { get; set; }
/// <summary>
/// Gets or sets the identification.
@@ -40,7 +37,9 @@ namespace MediaBrowser.Controller.Dlna
public string ModelNumber { get; set; }
public string ModelUrl { get; set; }
public bool IgnoreTranscodeByteRangeRequests { get; set; }
- public bool SupportsAlbumArtInDidl { 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.
@@ -57,14 +56,27 @@ namespace MediaBrowser.Controller.Dlna
public string ProtocolInfo { get; set; }
- public MediaProfile[] MediaProfiles { get; set; }
- public CodecProfile[] CodecProfiles { 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 MediaProfile[] MediaProfiles { get; set; }
+
public DeviceProfile()
{
DirectPlayProfiles = new DirectPlayProfile[] { };
@@ -72,6 +84,13 @@ namespace MediaBrowser.Controller.Dlna
MediaProfiles = new MediaProfile[] { };
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)
diff --git a/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs b/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs
index 686b31287..ad70640da 100644
--- a/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs
+++ b/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs
@@ -1,14 +1,21 @@
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()
diff --git a/MediaBrowser.Controller/Dlna/IDlnaManager.cs b/MediaBrowser.Controller/Dlna/IDlnaManager.cs
index 22d13fc3a..521d17e01 100644
--- a/MediaBrowser.Controller/Dlna/IDlnaManager.cs
+++ b/MediaBrowser.Controller/Dlna/IDlnaManager.cs
@@ -1,28 +1,54 @@
-using System.Collections.Generic;
+using MediaBrowser.Model.Dlna;
+using System.Collections.Generic;
namespace MediaBrowser.Controller.Dlna
{
public interface IDlnaManager
{
/// <summary>
- /// Gets the dlna profiles.
+ /// Gets the profile infos.
/// </summary>
- /// <returns>IEnumerable{DlnaProfile}.</returns>
- IEnumerable<DeviceProfile> GetProfiles();
+ /// <returns>IEnumerable{DeviceProfileInfo}.</returns>
+ IEnumerable<DeviceProfileInfo> GetProfileInfos();
+
+ /// <summary>
+ /// Gets the profile.
+ /// </summary>
+ /// <param name="headers">The headers.</param>
+ /// <returns>DeviceProfile.</returns>
+ DeviceProfile GetProfile(IDictionary<string,string> headers);
/// <summary>
/// Gets the default profile.
/// </summary>
- /// <returns>DlnaProfile.</returns>
+ /// <returns>DeviceProfile.</returns>
DeviceProfile GetDefaultProfile();
/// <summary>
+ /// Creates the profile.
+ /// </summary>
+ /// <param name="profile">The profile.</param>
+ void CreateProfile(DeviceProfile profile);
+
+ /// <summary>
+ /// Updates the profile.
+ /// </summary>
+ /// <param name="profile">The profile.</param>
+ void UpdateProfile(DeviceProfile profile);
+
+ /// <summary>
+ /// Deletes the profile.
+ /// </summary>
+ /// <param name="id">The identifier.</param>
+ void DeleteProfile(string id);
+
+ /// <summary>
/// Gets the profile.
/// </summary>
- /// <param name="headers">The headers.</param>
+ /// <param name="id">The identifier.</param>
/// <returns>DeviceProfile.</returns>
- DeviceProfile GetProfile(IDictionary<string,string> headers);
-
+ DeviceProfile GetProfile(string id);
+
/// <summary>
/// Gets the profile.
/// </summary>
diff --git a/MediaBrowser.Controller/Dlna/MediaProfile.cs b/MediaBrowser.Controller/Dlna/MediaProfile.cs
index 9a9b56ddd..bf3057294 100644
--- a/MediaBrowser.Controller/Dlna/MediaProfile.cs
+++ b/MediaBrowser.Controller/Dlna/MediaProfile.cs
@@ -1,16 +1,27 @@
using System.Collections.Generic;
using System.Linq;
+using System.Xml.Serialization;
namespace MediaBrowser.Controller.Dlna
{
public class MediaProfile
{
+ [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.Controller/Dlna/TranscodingProfile.cs b/MediaBrowser.Controller/Dlna/TranscodingProfile.cs
index d4cfae989..289333aa7 100644
--- a/MediaBrowser.Controller/Dlna/TranscodingProfile.cs
+++ b/MediaBrowser.Controller/Dlna/TranscodingProfile.cs
@@ -1,19 +1,30 @@
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("estimateContentLength")]
public bool EstimateContentLength { get; set; }
+
+ [XmlAttribute("enableMpegtsM2TsMode")]
public bool EnableMpegtsM2TsMode { get; set; }
+
+ [XmlAttribute("transcodeSeekInfo")]
public TranscodeSeekInfo TranscodeSeekInfo { get; set; }
public TranscodingSetting[] Settings { get; set; }
@@ -32,7 +43,10 @@ namespace MediaBrowser.Controller.Dlna
public class TranscodingSetting
{
+ [XmlAttribute("name")]
public TranscodingSettingType Name { get; set; }
+
+ [XmlAttribute("value")]
public string Value { get; set; }
}