aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Dlna/CodecProfile.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-04-01 18:23:07 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-04-01 18:23:07 -0400
commit21308be83fd8678dc1030c6493762f09828b1d2d (patch)
tree874a75ab8b6ecbe7565edbb42fd56d8c2f800614 /MediaBrowser.Model/Dlna/CodecProfile.cs
parent4afe2c3f731562efbe42147d1bcbdc0a7542cfeb (diff)
Add latest translations
Diffstat (limited to 'MediaBrowser.Model/Dlna/CodecProfile.cs')
-rw-r--r--MediaBrowser.Model/Dlna/CodecProfile.cs85
1 files changed, 85 insertions, 0 deletions
diff --git a/MediaBrowser.Model/Dlna/CodecProfile.cs b/MediaBrowser.Model/Dlna/CodecProfile.cs
new file mode 100644
index 000000000..b15dfc809
--- /dev/null
+++ b/MediaBrowser.Model/Dlna/CodecProfile.cs
@@ -0,0 +1,85 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Xml.Serialization;
+
+namespace MediaBrowser.Model.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.IsNullOrEmpty(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,
+ Width,
+ Height,
+ Has64BitOffsets,
+ VideoBitDepth,
+ VideoBitrate,
+ VideoFramerate,
+ VideoLevel,
+ VideoProfile
+ }
+}