ResponseProfile.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using System.Collections.Generic;
  2. using System.Xml.Serialization;
  3. using MediaBrowser.Model.Dlna;
  4. namespace MediaBrowser.Model.Dlna
  5. {
  6. public class ResponseProfile
  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. [XmlAttribute("orgPn")]
  17. public string OrgPn { get; set; }
  18. [XmlAttribute("mimeType")]
  19. public string MimeType { get; set; }
  20. public ProfileCondition[] Conditions { get; set; }
  21. public ResponseProfile()
  22. {
  23. Conditions = new ProfileCondition[] {};
  24. }
  25. public List<string> GetContainers()
  26. {
  27. return ContainerProfile.SplitValue(Container);
  28. }
  29. public List<string> GetAudioCodecs()
  30. {
  31. List<string> list = new List<string>();
  32. foreach (string i in (AudioCodec ?? string.Empty).Split(','))
  33. {
  34. if (!string.IsNullOrEmpty(i)) list.Add(i);
  35. }
  36. return list;
  37. }
  38. public List<string> GetVideoCodecs()
  39. {
  40. List<string> list = new List<string>();
  41. foreach (string i in (VideoCodec ?? string.Empty).Split(','))
  42. {
  43. if (!string.IsNullOrEmpty(i)) list.Add(i);
  44. }
  45. return list;
  46. }
  47. }
  48. }