DirectPlayProfile.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Xml.Serialization;
  5. namespace MediaBrowser.Model.Dlna
  6. {
  7. public class DirectPlayProfile
  8. {
  9. [XmlAttribute("container")]
  10. public string Container { get; set; }
  11. [XmlAttribute("audioCodec")]
  12. public string AudioCodec { get; set; }
  13. [XmlAttribute("videoCodec")]
  14. public string VideoCodec { get; set; }
  15. [XmlAttribute("type")]
  16. public DlnaProfileType Type { get; set; }
  17. public bool SupportsContainer(string container)
  18. {
  19. return ContainerProfile.ContainsContainer(Container, container);
  20. }
  21. public List<string> GetAudioCodecs()
  22. {
  23. List<string> list = new List<string>();
  24. foreach (string i in (AudioCodec ?? string.Empty).Split(','))
  25. {
  26. if (!string.IsNullOrEmpty(i)) list.Add(i);
  27. }
  28. return list;
  29. }
  30. public List<string> GetVideoCodecs()
  31. {
  32. List<string> list = new List<string>();
  33. foreach (string i in (VideoCodec ?? string.Empty).Split(','))
  34. {
  35. if (!string.IsNullOrEmpty(i)) list.Add(i);
  36. }
  37. return list;
  38. }
  39. }
  40. }