DirectPlayProfile.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System.Collections.Generic;
  2. using System.Linq;
  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 List<string> GetContainers()
  17. {
  18. return (Container ?? string.Empty).Split(',').Where(i => !string.IsNullOrEmpty(i)).ToList();
  19. }
  20. public List<string> GetAudioCodecs()
  21. {
  22. return (AudioCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrEmpty(i)).ToList();
  23. }
  24. public List<string> GetVideoCodecs()
  25. {
  26. return (VideoCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrEmpty(i)).ToList();
  27. }
  28. }
  29. public class XmlAttribute
  30. {
  31. [XmlAttribute("name")]
  32. public string Name { get; set; }
  33. [XmlAttribute("value")]
  34. public string Value { get; set; }
  35. }
  36. public enum DlnaProfileType
  37. {
  38. Audio = 0,
  39. Video = 1,
  40. Photo = 2
  41. }
  42. }