EncodingJobOptions.cs 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using MediaBrowser.Model.Dlna;
  2. namespace MediaBrowser.Controller.MediaEncoding
  3. {
  4. public class EncodingJobOptions
  5. {
  6. public string OutputContainer { get; set; }
  7. public long? StartTimeTicks { get; set; }
  8. public int? Width { get; set; }
  9. public int? Height { get; set; }
  10. public int? MaxWidth { get; set; }
  11. public int? MaxHeight { get; set; }
  12. public bool Static = false;
  13. public float? Framerate { get; set; }
  14. public float? MaxFramerate { get; set; }
  15. public string Profile { get; set; }
  16. public int? Level { get; set; }
  17. public string DeviceId { get; set; }
  18. public string ItemId { get; set; }
  19. public string MediaSourceId { get; set; }
  20. public string AudioCodec { get; set; }
  21. public bool EnableAutoStreamCopy { get; set; }
  22. public int? MaxAudioChannels { get; set; }
  23. public int? AudioChannels { get; set; }
  24. public int? AudioBitRate { get; set; }
  25. public int? AudioSampleRate { get; set; }
  26. public DeviceProfile DeviceProfile { get; set; }
  27. public EncodingContext Context { get; set; }
  28. public string VideoCodec { get; set; }
  29. public int? VideoBitRate { get; set; }
  30. public int? AudioStreamIndex { get; set; }
  31. public int? VideoStreamIndex { get; set; }
  32. public int? SubtitleStreamIndex { get; set; }
  33. public int? MaxRefFrames { get; set; }
  34. public int? MaxVideoBitDepth { get; set; }
  35. public SubtitleDeliveryMethod SubtitleMethod { get; set; }
  36. /// <summary>
  37. /// Gets a value indicating whether this instance has fixed resolution.
  38. /// </summary>
  39. /// <value><c>true</c> if this instance has fixed resolution; otherwise, <c>false</c>.</value>
  40. public bool HasFixedResolution
  41. {
  42. get
  43. {
  44. return Width.HasValue || Height.HasValue;
  45. }
  46. }
  47. public bool? Cabac { get; set; }
  48. public EncodingJobOptions()
  49. {
  50. }
  51. public EncodingJobOptions(StreamInfo info, DeviceProfile deviceProfile)
  52. {
  53. OutputContainer = info.Container;
  54. StartTimeTicks = info.StartPositionTicks;
  55. MaxWidth = info.MaxWidth;
  56. MaxHeight = info.MaxHeight;
  57. MaxFramerate = info.MaxFramerate;
  58. Profile = info.VideoProfile;
  59. Level = info.VideoLevel;
  60. ItemId = info.ItemId;
  61. MediaSourceId = info.MediaSourceId;
  62. AudioCodec = info.AudioCodec;
  63. MaxAudioChannels = info.MaxAudioChannels;
  64. AudioBitRate = info.AudioBitrate;
  65. AudioSampleRate = info.TargetAudioSampleRate;
  66. DeviceProfile = deviceProfile;
  67. VideoCodec = info.VideoCodec;
  68. VideoBitRate = info.VideoBitrate;
  69. AudioStreamIndex = info.AudioStreamIndex;
  70. SubtitleStreamIndex = info.SubtitleStreamIndex;
  71. MaxRefFrames = info.MaxRefFrames;
  72. MaxVideoBitDepth = info.MaxVideoBitDepth;
  73. SubtitleMethod = info.SubtitleDeliveryMethod;
  74. Cabac = info.Cabac;
  75. Context = info.Context;
  76. }
  77. }
  78. }