diff options
| author | Cody Robibero <cody@robibe.ro> | 2024-02-21 14:24:50 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-21 14:24:50 -0700 |
| commit | ca21a80c95d7e96734484ee642f761be2f3a4d0c (patch) | |
| tree | 1ab2e7e37295492788e5edd572a67e503862061f /src/Jellyfin.LiveTv/IO/ExclusiveLiveStream.cs | |
| parent | 1dfaa171a95e3e6eea780f018cd8442f1dcc9f78 (diff) | |
| parent | 170b8b2550a6ebb08453fe96d6c2223eaa1aa0ff (diff) | |
Merge pull request #11045 from barronpm/livetv-recordingsmanager
LiveTV Recordings Refactor
Diffstat (limited to 'src/Jellyfin.LiveTv/IO/ExclusiveLiveStream.cs')
| -rw-r--r-- | src/Jellyfin.LiveTv/IO/ExclusiveLiveStream.cs | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/Jellyfin.LiveTv/IO/ExclusiveLiveStream.cs b/src/Jellyfin.LiveTv/IO/ExclusiveLiveStream.cs new file mode 100644 index 000000000..394b9cf11 --- /dev/null +++ b/src/Jellyfin.LiveTv/IO/ExclusiveLiveStream.cs @@ -0,0 +1,61 @@ +#nullable disable + +#pragma warning disable CA1711 +#pragma warning disable CS1591 + +using System; +using System.Globalization; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Controller.Library; +using MediaBrowser.Model.Dto; + +namespace Jellyfin.LiveTv.IO +{ + public sealed class ExclusiveLiveStream : ILiveStream + { + private readonly Func<Task> _closeFn; + + public ExclusiveLiveStream(MediaSourceInfo mediaSource, Func<Task> closeFn) + { + MediaSource = mediaSource; + EnableStreamSharing = false; + _closeFn = closeFn; + ConsumerCount = 1; + UniqueId = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture); + } + + public int ConsumerCount { get; set; } + + public string OriginalStreamId { get; set; } + + public string TunerHostId => null; + + public bool EnableStreamSharing { get; set; } + + public MediaSourceInfo MediaSource { get; set; } + + public string UniqueId { get; } + + public Task Close() + { + return _closeFn(); + } + + public Stream GetStream() + { + throw new NotSupportedException(); + } + + public Task Open(CancellationToken openCancellationToken) + { + return Task.CompletedTask; + } + + /// <inheritdoc /> + public void Dispose() + { + } + } +} |
