ResponseProfile.cs 1.7 KB

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