2014-06-05 04:32:40 +02:00
|
|
|
|
using MediaBrowser.Model.Extensions;
|
2014-03-24 18:54:45 +01:00
|
|
|
|
using System.Collections.Generic;
|
2014-03-26 16:06:48 +01:00
|
|
|
|
using System.Xml.Serialization;
|
2014-03-22 21:02:10 +01:00
|
|
|
|
|
2014-04-02 00:23:07 +02:00
|
|
|
|
namespace MediaBrowser.Model.Dlna
|
2014-03-22 21:02:10 +01:00
|
|
|
|
{
|
|
|
|
|
public class CodecProfile
|
|
|
|
|
{
|
2014-03-26 16:06:48 +01:00
|
|
|
|
[XmlAttribute("type")]
|
2014-03-22 21:02:10 +01:00
|
|
|
|
public CodecType Type { get; set; }
|
2014-03-26 16:06:48 +01:00
|
|
|
|
|
2014-03-23 17:42:02 +01:00
|
|
|
|
public ProfileCondition[] Conditions { get; set; }
|
2014-03-26 16:06:48 +01:00
|
|
|
|
|
|
|
|
|
[XmlAttribute("codec")]
|
2014-03-22 21:50:28 +01:00
|
|
|
|
public string Codec { get; set; }
|
2014-03-22 21:02:10 +01:00
|
|
|
|
|
|
|
|
|
public CodecProfile()
|
|
|
|
|
{
|
2014-03-23 17:42:02 +01:00
|
|
|
|
Conditions = new ProfileCondition[] {};
|
2014-03-22 21:50:28 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<string> GetCodecs()
|
|
|
|
|
{
|
2014-05-08 23:23:24 +02:00
|
|
|
|
List<string> list = new List<string>();
|
|
|
|
|
foreach (string i in (Codec ?? string.Empty).Split(','))
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(i)) list.Add(i);
|
|
|
|
|
}
|
|
|
|
|
return list;
|
2014-03-22 21:02:10 +01:00
|
|
|
|
}
|
2014-03-24 18:54:45 +01:00
|
|
|
|
|
|
|
|
|
public bool ContainsCodec(string codec)
|
|
|
|
|
{
|
2014-05-08 22:44:17 +02:00
|
|
|
|
List<string> codecs = GetCodecs();
|
2014-03-24 18:54:45 +01:00
|
|
|
|
|
2014-06-05 04:32:40 +02:00
|
|
|
|
return codecs.Count == 0 || ListHelper.ContainsIgnoreCase(codecs, codec);
|
2014-03-24 18:54:45 +01:00
|
|
|
|
}
|
2014-03-22 21:02:10 +01:00
|
|
|
|
}
|
|
|
|
|
}
|