TranscodingProfile.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System.Collections.Generic;
  2. using System.Xml.Serialization;
  3. namespace MediaBrowser.Model.Dlna
  4. {
  5. public class TranscodingProfile
  6. {
  7. [XmlAttribute("container")]
  8. public string Container { get; set; }
  9. [XmlAttribute("type")]
  10. public DlnaProfileType Type { get; set; }
  11. [XmlAttribute("videoCodec")]
  12. public string VideoCodec { get; set; }
  13. [XmlAttribute("audioCodec")]
  14. public string AudioCodec { get; set; }
  15. [XmlAttribute("protocol")]
  16. public string Protocol { get; set; }
  17. [XmlAttribute("estimateContentLength")]
  18. public bool EstimateContentLength { get; set; }
  19. [XmlAttribute("enableMpegtsM2TsMode")]
  20. public bool EnableMpegtsM2TsMode { get; set; }
  21. [XmlAttribute("transcodeSeekInfo")]
  22. public TranscodeSeekInfo TranscodeSeekInfo { get; set; }
  23. [XmlAttribute("copyTimestamps")]
  24. public bool CopyTimestamps { get; set; }
  25. [XmlAttribute("context")]
  26. public EncodingContext Context { get; set; }
  27. [XmlAttribute("enableSubtitlesInManifest")]
  28. public bool EnableSubtitlesInManifest { get; set; }
  29. [XmlAttribute("maxAudioChannels")]
  30. public string MaxAudioChannels { get; set; }
  31. public List<string> GetAudioCodecs()
  32. {
  33. List<string> list = new List<string>();
  34. foreach (string i in (AudioCodec ?? string.Empty).Split(','))
  35. {
  36. if (!string.IsNullOrEmpty(i)) list.Add(i);
  37. }
  38. return list;
  39. }
  40. }
  41. }