DirectPlayProfile.cs 1.4 KB

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