aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Dlna/DirectPlayProfile.cs')
-rw-r--r--MediaBrowser.Controller/Dlna/DirectPlayProfile.cs90
1 files changed, 16 insertions, 74 deletions
diff --git a/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs b/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs
index 68e25e2f7..53d32a2f8 100644
--- a/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs
+++ b/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs
@@ -1,60 +1,14 @@
-using System;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-using System.Xml.Serialization;
+using System.Collections.Generic;
+using System.Linq;
namespace MediaBrowser.Controller.Dlna
{
public class DirectPlayProfile
{
- public string Container { get; set; }
+ public string[] Containers { get; set; }
public string AudioCodec { get; set; }
public string VideoCodec { get; set; }
- [IgnoreDataMember]
- [XmlIgnore]
- public string[] Containers
- {
- get
- {
- return (Container ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
- }
- set
- {
- Container = value == null ? null : string.Join(",", value);
- }
- }
-
- [IgnoreDataMember]
- [XmlIgnore]
- public string[] AudioCodecs
- {
- get
- {
- return (AudioCodec ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
- }
- set
- {
- AudioCodec = value == null ? null : string.Join(",", value);
- }
- }
-
- [IgnoreDataMember]
- [XmlIgnore]
- public string[] VideoCodecs
- {
- get
- {
- return (VideoCodec ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
- }
- set
- {
- VideoCodec = value == null ? null : string.Join(",", value);
- }
- }
-
- public string OrgPn { get; set; }
- public string MimeType { get; set; }
public DlnaProfileType Type { get; set; }
public List<ProfileCondition> Conditions { get; set; }
@@ -62,37 +16,25 @@ namespace MediaBrowser.Controller.Dlna
public DirectPlayProfile()
{
Conditions = new List<ProfileCondition>();
+
+ Containers = new string[] { };
}
- }
- public class ProfileCondition
- {
- public ProfileConditionType Condition { get; set; }
- public ProfileConditionValue Value { get; set; }
+ 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
- }
-
- public enum ProfileConditionType
- {
- Equals = 0,
- NotEquals = 1,
- LessThanEqual = 2,
- GreaterThanEqual = 3
- }
-
- public enum ProfileConditionValue
- {
- AudioChannels,
- AudioBitrate,
- Filesize,
- VideoWidth,
- VideoHeight,
- VideoBitrate,
- VideoFramerate
+ Video = 1,
+ Photo = 2
}
}