aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Dlna/CodecProfile.cs
blob: a4592e654aae86e792a5a222b476cf9167120f57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System.Collections.Generic;
using System.Linq;

namespace MediaBrowser.Controller.Dlna
{
    public class CodecProfile
    {
        public CodecType Type { get; set; }
        public List<ProfileCondition> Conditions { get; set; }
        public string Codec { get; set; }

        public CodecProfile()
        {
            Conditions = new List<ProfileCondition>();
        }

        public List<string> GetCodecs()
        {
            return (Codec ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList();
        }
    }

    public enum CodecType
    {
        VideoCodec = 0,
        VideoAudioCodec = 1,
        AudioCodec = 2
    }

    public class ProfileCondition
    {
        public ProfileConditionType Condition { get; set; }
        public ProfileConditionValue Property { get; set; }
        public string Value { get; set; }
        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,
        Filesize,
        Width,
        Height,
        Has64BitOffsets,
        VideoBitrate,
        VideoFramerate,
        VideoLevel,
        VideoProfile
    }
}