ResponseProfile.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System.Collections.Generic;
  2. using System.Xml.Serialization;
  3. namespace MediaBrowser.Model.Dlna
  4. {
  5. public class ResponseProfile
  6. {
  7. [XmlAttribute("container")]
  8. public string Container { get; set; }
  9. [XmlAttribute("audioCodec")]
  10. public string AudioCodec { get; set; }
  11. [XmlAttribute("videoCodec")]
  12. public string VideoCodec { get; set; }
  13. [XmlAttribute("type")]
  14. public DlnaProfileType Type { get; set; }
  15. [XmlAttribute("orgPn")]
  16. public string OrgPn { get; set; }
  17. [XmlAttribute("mimeType")]
  18. public string MimeType { get; set; }
  19. public ProfileCondition[] Conditions { get; set; }
  20. public ResponseProfile()
  21. {
  22. Conditions = new ProfileCondition[] {};
  23. }
  24. public List<string> GetContainers()
  25. {
  26. List<string> list = new List<string>();
  27. foreach (string i in (Container ?? string.Empty).Split(','))
  28. {
  29. if (!string.IsNullOrEmpty(i)) list.Add(i);
  30. }
  31. return list;
  32. }
  33. public List<string> GetAudioCodecs()
  34. {
  35. List<string> list = new List<string>();
  36. foreach (string i in (AudioCodec ?? string.Empty).Split(','))
  37. {
  38. if (!string.IsNullOrEmpty(i)) list.Add(i);
  39. }
  40. return list;
  41. }
  42. public List<string> GetVideoCodecs()
  43. {
  44. List<string> list = new List<string>();
  45. foreach (string i in (VideoCodec ?? string.Empty).Split(','))
  46. {
  47. if (!string.IsNullOrEmpty(i)) list.Add(i);
  48. }
  49. return list;
  50. }
  51. }
  52. }