TranscodingProfile.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using System.Xml.Serialization;
  4. namespace MediaBrowser.Controller.Dlna
  5. {
  6. public class TranscodingProfile
  7. {
  8. [XmlAttribute("container")]
  9. public string Container { get; set; }
  10. [XmlAttribute("type")]
  11. public DlnaProfileType Type { get; set; }
  12. [XmlAttribute("videoCodec")]
  13. public string VideoCodec { get; set; }
  14. [XmlAttribute("audioCodec")]
  15. public string AudioCodec { get; set; }
  16. [XmlAttribute("protocol")]
  17. public string Protocol { get; set; }
  18. [XmlAttribute("estimateContentLength")]
  19. public bool EstimateContentLength { get; set; }
  20. [XmlAttribute("enableMpegtsM2TsMode")]
  21. public bool EnableMpegtsM2TsMode { get; set; }
  22. [XmlAttribute("transcodeSeekInfo")]
  23. public TranscodeSeekInfo TranscodeSeekInfo { get; set; }
  24. public TranscodingSetting[] Settings { get; set; }
  25. public TranscodingProfile()
  26. {
  27. Settings = new TranscodingSetting[] { };
  28. }
  29. public List<string> GetAudioCodecs()
  30. {
  31. return (AudioCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList();
  32. }
  33. }
  34. public class TranscodingSetting
  35. {
  36. [XmlAttribute("name")]
  37. public TranscodingSettingType Name { get; set; }
  38. [XmlAttribute("value")]
  39. public string Value { get; set; }
  40. }
  41. public enum TranscodingSettingType
  42. {
  43. VideoProfile = 0
  44. }
  45. public enum TranscodeSeekInfo
  46. {
  47. Auto = 0,
  48. Bytes = 1
  49. }
  50. }