DirectPlayProfile.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 MimeType { get; set; }
  52. public DlnaProfileType Type { get; set; }
  53. public List<ProfileCondition> Conditions { get; set; }
  54. public DirectPlayProfile()
  55. {
  56. Conditions = new List<ProfileCondition>();
  57. }
  58. }
  59. public class ProfileCondition
  60. {
  61. public ProfileConditionType Condition { get; set; }
  62. public ProfileConditionValue Value { get; set; }
  63. }
  64. public enum DlnaProfileType
  65. {
  66. Audio = 0,
  67. Video = 1
  68. }
  69. public enum ProfileConditionType
  70. {
  71. Equals = 0,
  72. NotEquals = 1,
  73. LessThanEqual = 2,
  74. GreaterThanEqual = 3
  75. }
  76. public enum ProfileConditionValue
  77. {
  78. AudioChannels,
  79. AudioBitrate,
  80. Filesize,
  81. VideoWidth,
  82. VideoHeight,
  83. VideoBitrate,
  84. VideoFramerate
  85. }
  86. }