StreamRequest.cs 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using MediaBrowser.Controller.MediaEncoding;
  2. using MediaBrowser.Model.Dlna;
  3. using MediaBrowser.Model.Services;
  4. namespace MediaBrowser.Api.Playback
  5. {
  6. /// <summary>
  7. /// Class StreamRequest
  8. /// </summary>
  9. public class StreamRequest : BaseEncodingJobOptions
  10. {
  11. /// <summary>
  12. /// Gets or sets the id.
  13. /// </summary>
  14. /// <value>The id.</value>
  15. [ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
  16. public string Id { get; set; }
  17. [ApiMember(Name = "MediaSourceId", Description = "The media version id, if playing an alternate version", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
  18. public string MediaSourceId { get; set; }
  19. [ApiMember(Name = "DeviceId", Description = "The device id of the client requesting. Used to stop encoding processes when needed.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
  20. public string DeviceId { get; set; }
  21. [ApiMember(Name = "Container", Description = "Container", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
  22. public string Container { get; set; }
  23. /// <summary>
  24. /// Gets or sets the audio codec.
  25. /// </summary>
  26. /// <value>The audio codec.</value>
  27. [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")]
  28. public string AudioCodec { get; set; }
  29. [ApiMember(Name = "DeviceProfileId", Description = "Optional. The dlna device profile id to utilize.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
  30. public string DeviceProfileId { get; set; }
  31. public string Params { get; set; }
  32. public string PlaySessionId { get; set; }
  33. public string LiveStreamId { get; set; }
  34. public string Tag { get; set; }
  35. public string SegmentContainer { get; set; }
  36. public int? SegmentLength { get; set; }
  37. public int? MinSegments { get; set; }
  38. }
  39. public class VideoStreamRequest : StreamRequest
  40. {
  41. /// <summary>
  42. /// Gets a value indicating whether this instance has fixed resolution.
  43. /// </summary>
  44. /// <value><c>true</c> if this instance has fixed resolution; otherwise, <c>false</c>.</value>
  45. public bool HasFixedResolution
  46. {
  47. get
  48. {
  49. return Width.HasValue || Height.HasValue;
  50. }
  51. }
  52. public bool EnableSubtitlesInManifest { get; set; }
  53. }
  54. }