StreamRequest.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. public bool BreakOnNonKeyFrames { get; set; }
  39. }
  40. public class VideoStreamRequest : StreamRequest
  41. {
  42. /// <summary>
  43. /// Gets a value indicating whether this instance has fixed resolution.
  44. /// </summary>
  45. /// <value><c>true</c> if this instance has fixed resolution; otherwise, <c>false</c>.</value>
  46. public bool HasFixedResolution
  47. {
  48. get
  49. {
  50. return Width.HasValue || Height.HasValue;
  51. }
  52. }
  53. public bool EnableSubtitlesInManifest { get; set; }
  54. }
  55. }