DirectPlayProfile.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System.Collections.Generic;
  2. using System.Xml.Serialization;
  3. using MediaBrowser.Model.Dlna;
  4. namespace MediaBrowser.Model.Dlna
  5. {
  6. public class DirectPlayProfile
  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. public List<string> GetContainers()
  17. {
  18. List<string> list = new List<string>();
  19. foreach (string i in (Container ?? string.Empty).Split(','))
  20. {
  21. if (!string.IsNullOrEmpty(i)) list.Add(i);
  22. }
  23. return list;
  24. }
  25. public List<string> GetAudioCodecs()
  26. {
  27. List<string> list = new List<string>();
  28. foreach (string i in (AudioCodec ?? string.Empty).Split(','))
  29. {
  30. if (!string.IsNullOrEmpty(i)) list.Add(i);
  31. }
  32. return list;
  33. }
  34. public List<string> GetVideoCodecs()
  35. {
  36. List<string> list = new List<string>();
  37. foreach (string i in (VideoCodec ?? string.Empty).Split(','))
  38. {
  39. if (!string.IsNullOrEmpty(i)) list.Add(i);
  40. }
  41. return list;
  42. }
  43. }
  44. }