DirectPlayProfile.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Xml.Serialization;
  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 bool SupportsContainer(string container)
  17. {
  18. return ContainerProfile.ContainsContainer(Container, container);
  19. }
  20. public List<string> GetAudioCodecs()
  21. {
  22. List<string> list = new List<string>();
  23. foreach (string i in (AudioCodec ?? string.Empty).Split(','))
  24. {
  25. if (!string.IsNullOrEmpty(i)) list.Add(i);
  26. }
  27. return list;
  28. }
  29. public List<string> GetVideoCodecs()
  30. {
  31. List<string> list = new List<string>();
  32. foreach (string i in (VideoCodec ?? string.Empty).Split(','))
  33. {
  34. if (!string.IsNullOrEmpty(i)) list.Add(i);
  35. }
  36. return list;
  37. }
  38. }
  39. }