diff options
| author | David <daullmer@gmail.com> | 2020-07-22 16:57:06 +0200 |
|---|---|---|
| committer | David <daullmer@gmail.com> | 2020-07-22 16:57:06 +0200 |
| commit | 2ce97c022e9ceadea4b9b72053626eff7439ff91 (patch) | |
| tree | ec385b78c72cae798011efc5a9e48cd0ceb459ab /Jellyfin.Api/Models | |
| parent | 5580df38e62ba75762da2f2b3ed4acd69b66e391 (diff) | |
Move AudioService to Jellyfin.Api
Diffstat (limited to 'Jellyfin.Api/Models')
| -rw-r--r-- | Jellyfin.Api/Models/StreamingDtos/StreamState.cs | 67 | ||||
| -rw-r--r-- | Jellyfin.Api/Models/StreamingDtos/StreamingRequestDto.cs | 45 | ||||
| -rw-r--r-- | Jellyfin.Api/Models/StreamingDtos/VideoRequestDto.cs | 19 |
3 files changed, 82 insertions, 49 deletions
diff --git a/Jellyfin.Api/Models/StreamingDtos/StreamState.cs b/Jellyfin.Api/Models/StreamingDtos/StreamState.cs index db7cc6a75..70a13d745 100644 --- a/Jellyfin.Api/Models/StreamingDtos/StreamState.cs +++ b/Jellyfin.Api/Models/StreamingDtos/StreamState.cs @@ -19,7 +19,7 @@ namespace Jellyfin.Api.Models.StreamingDtos /// <summary> /// Initializes a new instance of the <see cref="StreamState" /> class. /// </summary> - /// <param name="mediaSourceManager">Instance of the <see cref="mediaSourceManager" /> interface.</param> + /// <param name="mediaSourceManager">Instance of the <see cref="IMediaSourceManager" /> interface.</param> /// <param name="transcodingType">The <see cref="TranscodingJobType" />.</param> /// <param name="transcodingJobHelper">The <see cref="TranscodingJobHelper" /> singleton.</param> public StreamState(IMediaSourceManager mediaSourceManager, TranscodingJobType transcodingType, TranscodingJobHelper transcodingJobHelper) @@ -34,29 +34,28 @@ namespace Jellyfin.Api.Models.StreamingDtos /// </summary> public string? RequestedUrl { get; set; } - // /// <summary> - // /// Gets or sets the request. - // /// </summary> - // public StreamRequest Request - // { - // get => (StreamRequest)BaseRequest; - // set - // { - // BaseRequest = value; - // - // IsVideoRequest = VideoRequest != null; - // } - // } + /// <summary> + /// Gets or sets the request. + /// </summary> + public StreamingRequestDto Request + { + get => (StreamingRequestDto)BaseRequest; + set + { + BaseRequest = value; + IsVideoRequest = VideoRequest != null; + } + } /// <summary> /// Gets or sets the transcoding throttler. /// </summary> public TranscodingThrottler? TranscodingThrottler { get; set; } - /*/// <summary> + /// <summary> /// Gets the video request. /// </summary> - public VideoStreamRequest VideoRequest => Request as VideoStreamRequest;*/ + public VideoRequestDto? VideoRequest => Request! as VideoRequestDto; /// <summary> /// Gets or sets the direct stream provicer. @@ -68,10 +67,10 @@ namespace Jellyfin.Api.Models.StreamingDtos /// </summary> public string? WaitForPath { get; set; } - /*/// <summary> + /// <summary> /// Gets a value indicating whether the request outputs video. /// </summary> - public bool IsOutputVideo => Request is VideoStreamRequest;*/ + public bool IsOutputVideo => Request is VideoRequestDto; /// <summary> /// Gets the segment length. @@ -161,36 +160,6 @@ namespace Jellyfin.Api.Models.StreamingDtos /// </summary> public TranscodingJobDto? TranscodingJob { get; set; } - /// <summary> - /// Gets or sets the device id. - /// </summary> - public string? DeviceId { get; set; } - - /// <summary> - /// Gets or sets the play session id. - /// </summary> - public string? PlaySessionId { get; set; } - - /// <summary> - /// Gets or sets the live stream id. - /// </summary> - public string? LiveStreamId { get; set; } - - /// <summary> - /// Gets or sets the video coded. - /// </summary> - public string? VideoCodec { get; set; } - - /// <summary> - /// Gets or sets the audio codec. - /// </summary> - public string? AudioCodec { get; set; } - - /// <summary> - /// Gets or sets the subtitle codec. - /// </summary> - public string? SubtitleCodec { get; set; } - /// <inheritdoc /> public void Dispose() { @@ -219,7 +188,7 @@ namespace Jellyfin.Api.Models.StreamingDtos { // REVIEW: Is this the right place for this? if (MediaSource.RequiresClosing - && string.IsNullOrWhiteSpace(LiveStreamId) + && string.IsNullOrWhiteSpace(Request.LiveStreamId) && !string.IsNullOrWhiteSpace(MediaSource.LiveStreamId)) { _mediaSourceManager.CloseLiveStream(MediaSource.LiveStreamId).GetAwaiter().GetResult(); diff --git a/Jellyfin.Api/Models/StreamingDtos/StreamingRequestDto.cs b/Jellyfin.Api/Models/StreamingDtos/StreamingRequestDto.cs new file mode 100644 index 000000000..1791b0370 --- /dev/null +++ b/Jellyfin.Api/Models/StreamingDtos/StreamingRequestDto.cs @@ -0,0 +1,45 @@ +using MediaBrowser.Controller.MediaEncoding; + +namespace Jellyfin.Api.Models.StreamingDtos +{ + /// <summary> + /// The audio streaming request dto. + /// </summary> + public class StreamingRequestDto : BaseEncodingJobOptions + { + /// <summary> + /// Gets or sets the device profile. + /// </summary> + public string? DeviceProfileId { get; set; } + + /// <summary> + /// Gets or sets the params. + /// </summary> + public string? Params { get; set; } + + /// <summary> + /// Gets or sets the play session id. + /// </summary> + public string? PlaySessionId { get; set; } + + /// <summary> + /// Gets or sets the tag. + /// </summary> + public string? Tag { get; set; } + + /// <summary> + /// Gets or sets the segment container. + /// </summary> + public string? SegmentContainer { get; set; } + + /// <summary> + /// Gets or sets the segment length. + /// </summary> + public int? SegmentLength { get; set; } + + /// <summary> + /// Gets or sets the min segments. + /// </summary> + public int? MinSegments { get; set; } + } +} diff --git a/Jellyfin.Api/Models/StreamingDtos/VideoRequestDto.cs b/Jellyfin.Api/Models/StreamingDtos/VideoRequestDto.cs new file mode 100644 index 000000000..cce2a89d4 --- /dev/null +++ b/Jellyfin.Api/Models/StreamingDtos/VideoRequestDto.cs @@ -0,0 +1,19 @@ +namespace Jellyfin.Api.Models.StreamingDtos +{ + /// <summary> + /// The video request dto. + /// </summary> + public class VideoRequestDto : StreamingRequestDto + { + /// <summary> + /// Gets a value indicating whether this instance has fixed resolution. + /// </summary> + /// <value><c>true</c> if this instance has fixed resolution; otherwise, <c>false</c>.</value> + public bool HasFixedResolution => Width.HasValue || Height.HasValue; + + /// <summary> + /// Gets or sets a value indicating whether to enable subtitles in the manifest. + /// </summary> + public bool EnableSubtitlesInManifest { get; set; } + } +} |
