ResponseProfile.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System.Collections.Generic;
  2. using System.Xml.Serialization;
  3. namespace MediaBrowser.Model.Dlna
  4. {
  5. public class ResponseProfile
  6. {
  7. public string Container { get; set; }
  8. public string AudioCodec { get; set; }
  9. public string VideoCodec { get; set; }
  10. public DlnaProfileType Type { get; set; }
  11. public string OrgPn { get; set; }
  12. public string MimeType { get; set; }
  13. public ProfileCondition[] Conditions { get; set; }
  14. public ResponseProfile()
  15. {
  16. Conditions = new ProfileCondition[] {};
  17. }
  18. public List<string> GetContainers()
  19. {
  20. List<string> list = new List<string>();
  21. foreach (string i in (Container ?? string.Empty).Split(','))
  22. {
  23. if (!string.IsNullOrEmpty(i)) list.Add(i);
  24. }
  25. return list;
  26. }
  27. public List<string> GetAudioCodecs()
  28. {
  29. List<string> list = new List<string>();
  30. foreach (string i in (AudioCodec ?? string.Empty).Split(','))
  31. {
  32. if (!string.IsNullOrEmpty(i)) list.Add(i);
  33. }
  34. return list;
  35. }
  36. public List<string> GetVideoCodecs()
  37. {
  38. List<string> list = new List<string>();
  39. foreach (string i in (VideoCodec ?? string.Empty).Split(','))
  40. {
  41. if (!string.IsNullOrEmpty(i)) list.Add(i);
  42. }
  43. return list;
  44. }
  45. }
  46. }