TranscodingProfile.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #pragma warning disable CS1591
  2. using System;
  3. using System.ComponentModel;
  4. using System.Xml.Serialization;
  5. namespace MediaBrowser.Model.Dlna
  6. {
  7. public class TranscodingProfile
  8. {
  9. public TranscodingProfile()
  10. {
  11. Conditions = Array.Empty<ProfileCondition>();
  12. }
  13. [XmlAttribute("container")]
  14. public string Container { get; set; } = string.Empty;
  15. [XmlAttribute("type")]
  16. public DlnaProfileType Type { get; set; }
  17. [XmlAttribute("videoCodec")]
  18. public string VideoCodec { get; set; } = string.Empty;
  19. [XmlAttribute("audioCodec")]
  20. public string AudioCodec { get; set; } = string.Empty;
  21. [XmlAttribute("protocol")]
  22. public string Protocol { get; set; } = string.Empty;
  23. [DefaultValue(false)]
  24. [XmlAttribute("estimateContentLength")]
  25. public bool EstimateContentLength { get; set; }
  26. [DefaultValue(false)]
  27. [XmlAttribute("enableMpegtsM2TsMode")]
  28. public bool EnableMpegtsM2TsMode { get; set; }
  29. [DefaultValue(TranscodeSeekInfo.Auto)]
  30. [XmlAttribute("transcodeSeekInfo")]
  31. public TranscodeSeekInfo TranscodeSeekInfo { get; set; }
  32. [DefaultValue(false)]
  33. [XmlAttribute("copyTimestamps")]
  34. public bool CopyTimestamps { get; set; }
  35. [DefaultValue(EncodingContext.Streaming)]
  36. [XmlAttribute("context")]
  37. public EncodingContext Context { get; set; }
  38. [DefaultValue(false)]
  39. [XmlAttribute("enableSubtitlesInManifest")]
  40. public bool EnableSubtitlesInManifest { get; set; }
  41. [XmlAttribute("maxAudioChannels")]
  42. public string? MaxAudioChannels { get; set; }
  43. [DefaultValue(0)]
  44. [XmlAttribute("minSegments")]
  45. public int MinSegments { get; set; }
  46. [DefaultValue(0)]
  47. [XmlAttribute("segmentLength")]
  48. public int SegmentLength { get; set; }
  49. [DefaultValue(false)]
  50. [XmlAttribute("breakOnNonKeyFrames")]
  51. public bool BreakOnNonKeyFrames { get; set; }
  52. public ProfileCondition[] Conditions { get; set; }
  53. public string[] GetAudioCodecs()
  54. {
  55. return ContainerProfile.SplitValue(AudioCodec);
  56. }
  57. }
  58. }