StreamRequest.cs 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. using MediaBrowser.Model.Dto;
  2. using ServiceStack.ServiceHost;
  3. namespace MediaBrowser.Api.Playback
  4. {
  5. /// <summary>
  6. /// Class StreamRequest
  7. /// </summary>
  8. public class StreamRequest
  9. {
  10. /// <summary>
  11. /// Gets or sets the id.
  12. /// </summary>
  13. /// <value>The id.</value>
  14. [ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
  15. public string Id { get; set; }
  16. /// <summary>
  17. /// Gets or sets the audio codec.
  18. /// </summary>
  19. /// <value>The audio codec.</value>
  20. [ApiMember(Name = "AudioCodec", Description = "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
  21. public AudioCodecs? AudioCodec { get; set; }
  22. /// <summary>
  23. /// Gets or sets the start time ticks.
  24. /// </summary>
  25. /// <value>The start time ticks.</value>
  26. [ApiMember(Name = "StartTimeTicks", Description = "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  27. public long? StartTimeTicks { get; set; }
  28. /// <summary>
  29. /// Gets or sets the audio bit rate.
  30. /// </summary>
  31. /// <value>The audio bit rate.</value>
  32. [ApiMember(Name = "AudioBitRate", Description = "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  33. public int? AudioBitRate { get; set; }
  34. /// <summary>
  35. /// Gets or sets the audio channels.
  36. /// </summary>
  37. /// <value>The audio channels.</value>
  38. [ApiMember(Name = "AudioChannels", Description = "Optional. Specify a specific number of audio channels to encode to, e.g. 2", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  39. public int? AudioChannels { get; set; }
  40. /// <summary>
  41. /// Gets or sets the audio sample rate.
  42. /// </summary>
  43. /// <value>The audio sample rate.</value>
  44. [ApiMember(Name = "AudioSampleRate", Description = "Optional. Specify a specific audio sample rate, e.g. 44100", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  45. public int? AudioSampleRate { get; set; }
  46. /// <summary>
  47. /// Gets or sets a value indicating whether this <see cref="StreamRequest" /> is static.
  48. /// </summary>
  49. /// <value><c>true</c> if static; otherwise, <c>false</c>.</value>
  50. [ApiMember(Name = "Static", Description = "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
  51. public bool Static { get; set; }
  52. /// <summary>
  53. /// This is an xbox 360 param that is used with dlna. If true the item's image should be returned instead of audio or video.
  54. /// No need to put this in api docs since it's dlna only
  55. /// </summary>
  56. public bool AlbumArt { get; set; }
  57. }
  58. public class VideoStreamRequest : StreamRequest
  59. {
  60. /// <summary>
  61. /// Gets or sets the video codec.
  62. /// </summary>
  63. /// <value>The video codec.</value>
  64. [ApiMember(Name = "VideoCodec", Description = "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h264, theora, vpx, wmv.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
  65. public VideoCodecs? VideoCodec { get; set; }
  66. /// <summary>
  67. /// Gets or sets the video bit rate.
  68. /// </summary>
  69. /// <value>The video bit rate.</value>
  70. [ApiMember(Name = "VideoBitRate", Description = "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  71. public int? VideoBitRate { get; set; }
  72. /// <summary>
  73. /// Gets or sets the index of the audio stream.
  74. /// </summary>
  75. /// <value>The index of the audio stream.</value>
  76. [ApiMember(Name = "AudioStreamIndex", Description = "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  77. public int? AudioStreamIndex { get; set; }
  78. /// <summary>
  79. /// Gets or sets the index of the video stream.
  80. /// </summary>
  81. /// <value>The index of the video stream.</value>
  82. [ApiMember(Name = "VideoStreamIndex", Description = "Optional. The index of the video stream to use. If omitted the first video stream will be used.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  83. public int? VideoStreamIndex { get; set; }
  84. /// <summary>
  85. /// Gets or sets the index of the subtitle stream.
  86. /// </summary>
  87. /// <value>The index of the subtitle stream.</value>
  88. [ApiMember(Name = "SubtitleStreamIndex", Description = "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  89. public int? SubtitleStreamIndex { get; set; }
  90. /// <summary>
  91. /// Gets or sets the width.
  92. /// </summary>
  93. /// <value>The width.</value>
  94. [ApiMember(Name = "Width", Description = "Optional. The fixed horizontal resolution of the encoded video.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  95. public int? Width { get; set; }
  96. /// <summary>
  97. /// Gets or sets the height.
  98. /// </summary>
  99. /// <value>The height.</value>
  100. [ApiMember(Name = "Height", Description = "Optional. The fixed vertical resolution of the encoded video.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  101. public int? Height { get; set; }
  102. /// <summary>
  103. /// Gets or sets the width of the max.
  104. /// </summary>
  105. /// <value>The width of the max.</value>
  106. [ApiMember(Name = "MaxWidth", Description = "Optional. The maximum horizontal resolution of the encoded video.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  107. public int? MaxWidth { get; set; }
  108. /// <summary>
  109. /// Gets or sets the height of the max.
  110. /// </summary>
  111. /// <value>The height of the max.</value>
  112. [ApiMember(Name = "MaxHeight", Description = "Optional. The maximum vertical resolution of the encoded video.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  113. public int? MaxHeight { get; set; }
  114. /// <summary>
  115. /// Gets or sets the framerate.
  116. /// </summary>
  117. /// <value>The framerate.</value>
  118. [ApiMember(Name = "Framerate", Description = "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", IsRequired = false, DataType = "double", ParameterType = "query", Verb = "GET")]
  119. public double? Framerate { get; set; }
  120. /// <summary>
  121. /// Gets or sets the profile.
  122. /// </summary>
  123. /// <value>The profile.</value>
  124. [ApiMember(Name = "Profile", Description = "Optional. Specify a specific h264 profile, e.g. main, baseline, high.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
  125. public string Profile { get; set; }
  126. /// <summary>
  127. /// Gets or sets the level.
  128. /// </summary>
  129. /// <value>The level.</value>
  130. [ApiMember(Name = "Level", Description = "Optional. Specify a level for the h264 profile, e.g. 3, 3.1.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
  131. public string Level { get; set; }
  132. }
  133. }