2
0

TranscodingProfile.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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("estimateContentLength")]
  17. public bool EstimateContentLength { get; set; }
  18. [XmlAttribute("enableMpegtsM2TsMode")]
  19. public bool EnableMpegtsM2TsMode { get; set; }
  20. [XmlAttribute("transcodeSeekInfo")]
  21. public TranscodeSeekInfo TranscodeSeekInfo { get; set; }
  22. public TranscodingSetting[] Settings { get; set; }
  23. public TranscodingProfile()
  24. {
  25. Settings = new TranscodingSetting[] { };
  26. }
  27. public List<string> GetAudioCodecs()
  28. {
  29. return (AudioCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList();
  30. }
  31. }
  32. public class TranscodingSetting
  33. {
  34. [XmlAttribute("name")]
  35. public TranscodingSettingType Name { get; set; }
  36. [XmlAttribute("value")]
  37. public string Value { get; set; }
  38. }
  39. public enum TranscodingSettingType
  40. {
  41. VideoProfile = 0
  42. }
  43. public enum TranscodeSeekInfo
  44. {
  45. Auto = 0,
  46. Bytes = 1
  47. }
  48. }