DirectPlayProfile.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Runtime.Serialization;
  4. using System.Xml.Serialization;
  5. namespace MediaBrowser.Controller.Dlna
  6. {
  7. public class DirectPlayProfile
  8. {
  9. public string Container { get; set; }
  10. public string AudioCodec { get; set; }
  11. public string VideoCodec { get; set; }
  12. [IgnoreDataMember]
  13. [XmlIgnore]
  14. public string[] Containers
  15. {
  16. get
  17. {
  18. return (Container ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
  19. }
  20. set
  21. {
  22. Container = value == null ? null : string.Join(",", value);
  23. }
  24. }
  25. [IgnoreDataMember]
  26. [XmlIgnore]
  27. public string[] AudioCodecs
  28. {
  29. get
  30. {
  31. return (AudioCodec ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
  32. }
  33. set
  34. {
  35. AudioCodec = value == null ? null : string.Join(",", value);
  36. }
  37. }
  38. [IgnoreDataMember]
  39. [XmlIgnore]
  40. public string[] VideoCodecs
  41. {
  42. get
  43. {
  44. return (VideoCodec ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
  45. }
  46. set
  47. {
  48. VideoCodec = value == null ? null : string.Join(",", value);
  49. }
  50. }
  51. public string OrgPn { get; set; }
  52. public string MimeType { get; set; }
  53. public DlnaProfileType Type { get; set; }
  54. public List<ProfileCondition> Conditions { get; set; }
  55. public DirectPlayProfile()
  56. {
  57. Conditions = new List<ProfileCondition>();
  58. }
  59. }
  60. public class ProfileCondition
  61. {
  62. public ProfileConditionType Condition { get; set; }
  63. public ProfileConditionValue Property { get; set; }
  64. public string Value { get; set; }
  65. }
  66. public enum DlnaProfileType
  67. {
  68. Audio = 0,
  69. Video = 1,
  70. Photo = 2
  71. }
  72. public enum ProfileConditionType
  73. {
  74. Equals = 0,
  75. NotEquals = 1,
  76. LessThanEqual = 2,
  77. GreaterThanEqual = 3
  78. }
  79. public enum ProfileConditionValue
  80. {
  81. AudioChannels,
  82. AudioBitrate,
  83. Filesize,
  84. VideoWidth,
  85. VideoHeight,
  86. VideoBitrate,
  87. VideoFramerate
  88. }
  89. }