DirectPlayProfile.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 Value { get; set; }
  64. }
  65. public enum DlnaProfileType
  66. {
  67. Audio = 0,
  68. Video = 1
  69. }
  70. public enum ProfileConditionType
  71. {
  72. Equals = 0,
  73. NotEquals = 1,
  74. LessThanEqual = 2,
  75. GreaterThanEqual = 3
  76. }
  77. public enum ProfileConditionValue
  78. {
  79. AudioChannels,
  80. AudioBitrate,
  81. Filesize,
  82. VideoWidth,
  83. VideoHeight,
  84. VideoBitrate,
  85. VideoFramerate
  86. }
  87. }