TranscodingProfile.cs 2.2 KB

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