StreamRequest.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using MediaBrowser.Controller.MediaEncoding;
  3. using MediaBrowser.Model.Dlna;
  4. using MediaBrowser.Model.Services;
  5. namespace MediaBrowser.Api.Playback
  6. {
  7. /// <summary>
  8. /// Class StreamRequest
  9. /// </summary>
  10. public class StreamRequest : BaseEncodingJobOptions
  11. {
  12. /// <summary>
  13. /// Gets or sets the id.
  14. /// </summary>
  15. /// <value>The id.</value>
  16. [ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
  17. public Guid Id { get; set; }
  18. [ApiMember(Name = "MediaSourceId", Description = "The media version id, if playing an alternate version", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
  19. public string MediaSourceId { get; set; }
  20. [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")]
  21. public string DeviceId { get; set; }
  22. [ApiMember(Name = "Container", Description = "Container", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
  23. public string Container { get; set; }
  24. /// <summary>
  25. /// Gets or sets the audio codec.
  26. /// </summary>
  27. /// <value>The audio codec.</value>
  28. [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")]
  29. public string AudioCodec { get; set; }
  30. [ApiMember(Name = "DeviceProfileId", Description = "Optional. The dlna device profile id to utilize.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
  31. public string DeviceProfileId { get; set; }
  32. public string Params { get; set; }
  33. public string PlaySessionId { 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. }