TranscodingProfile.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. using System.ComponentModel;
  2. using System.Xml.Serialization;
  3. using Jellyfin.Data.Enums;
  4. namespace MediaBrowser.Model.Dlna;
  5. /// <summary>
  6. /// A class for transcoding profile information.
  7. /// </summary>
  8. public class TranscodingProfile
  9. {
  10. /// <summary>
  11. /// Initializes a new instance of the <see cref="TranscodingProfile" /> class.
  12. /// </summary>
  13. public TranscodingProfile()
  14. {
  15. Conditions = [];
  16. }
  17. /// <summary>
  18. /// Gets or sets the container.
  19. /// </summary>
  20. [XmlAttribute("container")]
  21. public string Container { get; set; } = string.Empty;
  22. /// <summary>
  23. /// Gets or sets the DLNA profile type.
  24. /// </summary>
  25. [XmlAttribute("type")]
  26. public DlnaProfileType Type { get; set; }
  27. /// <summary>
  28. /// Gets or sets the video codec.
  29. /// </summary>
  30. [XmlAttribute("videoCodec")]
  31. public string VideoCodec { get; set; } = string.Empty;
  32. /// <summary>
  33. /// Gets or sets the audio codec.
  34. /// </summary>
  35. [XmlAttribute("audioCodec")]
  36. public string AudioCodec { get; set; } = string.Empty;
  37. /// <summary>
  38. /// Gets or sets the protocol.
  39. /// </summary>
  40. [XmlAttribute("protocol")]
  41. public MediaStreamProtocol Protocol { get; set; } = MediaStreamProtocol.http;
  42. /// <summary>
  43. /// Gets or sets a value indicating whether the content length should be estimated.
  44. /// </summary>
  45. [DefaultValue(false)]
  46. [XmlAttribute("estimateContentLength")]
  47. public bool EstimateContentLength { get; set; }
  48. /// <summary>
  49. /// Gets or sets a value indicating whether M2TS mode is enabled.
  50. /// </summary>
  51. [DefaultValue(false)]
  52. [XmlAttribute("enableMpegtsM2TsMode")]
  53. public bool EnableMpegtsM2TsMode { get; set; }
  54. /// <summary>
  55. /// Gets or sets the transcoding seek info mode.
  56. /// </summary>
  57. [DefaultValue(TranscodeSeekInfo.Auto)]
  58. [XmlAttribute("transcodeSeekInfo")]
  59. public TranscodeSeekInfo TranscodeSeekInfo { get; set; }
  60. /// <summary>
  61. /// Gets or sets a value indicating whether timestamps should be copied.
  62. /// </summary>
  63. [DefaultValue(false)]
  64. [XmlAttribute("copyTimestamps")]
  65. public bool CopyTimestamps { get; set; }
  66. /// <summary>
  67. /// Gets or sets the encoding context.
  68. /// </summary>
  69. [DefaultValue(EncodingContext.Streaming)]
  70. [XmlAttribute("context")]
  71. public EncodingContext Context { get; set; }
  72. /// <summary>
  73. /// Gets or sets a value indicating whether subtitles are allowed in the manifest.
  74. /// </summary>
  75. [DefaultValue(false)]
  76. [XmlAttribute("enableSubtitlesInManifest")]
  77. public bool EnableSubtitlesInManifest { get; set; }
  78. /// <summary>
  79. /// Gets or sets the maximum audio channels.
  80. /// </summary>
  81. [XmlAttribute("maxAudioChannels")]
  82. public string? MaxAudioChannels { get; set; }
  83. /// <summary>
  84. /// Gets or sets the minimum amount of segments.
  85. /// </summary>
  86. [DefaultValue(0)]
  87. [XmlAttribute("minSegments")]
  88. public int MinSegments { get; set; }
  89. /// <summary>
  90. /// Gets or sets the segment length.
  91. /// </summary>
  92. [DefaultValue(0)]
  93. [XmlAttribute("segmentLength")]
  94. public int SegmentLength { get; set; }
  95. /// <summary>
  96. /// Gets or sets a value indicating whether breaking the video stream on non-keyframes is supported.
  97. /// </summary>
  98. [DefaultValue(false)]
  99. [XmlAttribute("breakOnNonKeyFrames")]
  100. public bool BreakOnNonKeyFrames { get; set; }
  101. /// <summary>
  102. /// Gets or sets the profile conditions.
  103. /// </summary>
  104. public ProfileCondition[] Conditions { get; set; }
  105. /// <summary>
  106. /// Gets or sets a value indicating whether variable bitrate encoding is supported.
  107. /// </summary>
  108. [DefaultValue(true)]
  109. [XmlAttribute("enableAudioVbrEncoding")]
  110. public bool EnableAudioVbrEncoding { get; set; } = true;
  111. }