jellyfin/MediaBrowser.Model/Dlna/ResponseProfile.cs

64 lines
1.7 KiB
C#
Raw Normal View History

using System.Collections.Generic;
2014-03-26 16:06:48 +01:00
using System.Xml.Serialization;
2014-04-02 00:23:07 +02:00
namespace MediaBrowser.Model.Dlna
2014-03-22 20:37:15 +01:00
{
2014-04-01 06:16:25 +02:00
public class ResponseProfile
2014-03-22 20:37:15 +01:00
{
2014-03-26 16:06:48 +01:00
[XmlAttribute("container")]
2014-03-22 20:37:15 +01:00
public string Container { get; set; }
2014-03-26 16:06:48 +01:00
[XmlAttribute("audioCodec")]
public string AudioCodec { get; set; }
2014-03-26 16:06:48 +01:00
[XmlAttribute("videoCodec")]
public string VideoCodec { get; set; }
2014-03-26 16:06:48 +01:00
[XmlAttribute("type")]
2014-03-22 20:37:15 +01:00
public DlnaProfileType Type { get; set; }
2014-03-26 16:06:48 +01:00
[XmlAttribute("orgPn")]
2014-03-22 20:37:15 +01:00
public string OrgPn { get; set; }
2014-03-26 16:06:48 +01:00
[XmlAttribute("mimeType")]
2014-03-22 20:37:15 +01:00
public string MimeType { get; set; }
2014-03-23 20:36:25 +01:00
public ProfileCondition[] Conditions { get; set; }
2014-04-01 06:16:25 +02:00
public ResponseProfile()
2014-03-23 20:36:25 +01:00
{
Conditions = new ProfileCondition[] {};
}
2014-03-25 06:25:03 +01:00
public List<string> GetContainers()
{
2014-05-08 23:23:24 +02:00
List<string> list = new List<string>();
foreach (string i in (Container ?? string.Empty).Split(','))
{
if (!string.IsNullOrEmpty(i)) list.Add(i);
}
return list;
2014-03-25 06:25:03 +01:00
}
2014-05-08 23:23:24 +02:00
public List<string> GetAudioCodecs()
{
2014-05-08 23:23:24 +02:00
List<string> list = new List<string>();
foreach (string i in (AudioCodec ?? string.Empty).Split(','))
{
if (!string.IsNullOrEmpty(i)) list.Add(i);
}
return list;
}
public List<string> GetVideoCodecs()
2014-03-22 20:37:15 +01:00
{
2014-05-08 23:23:24 +02:00
List<string> list = new List<string>();
foreach (string i in (VideoCodec ?? string.Empty).Split(','))
{
if (!string.IsNullOrEmpty(i)) list.Add(i);
}
return list;
2014-03-22 20:37:15 +01:00
}
}
}