jellyfin-server/Emby.Server.Implementations/Library/ExclusiveLiveStream.cs

56 lines
1.3 KiB
C#
Raw Normal View History

#nullable disable
2019-11-01 17:38:54 +00:00
#pragma warning disable CS1591
using System;
using System.Globalization;
using System.IO;
2018-09-12 17:26:21 +00:00
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Dto;
2018-09-12 17:26:21 +00:00
namespace Emby.Server.Implementations.Library
{
public class ExclusiveLiveStream : ILiveStream
{
2020-07-20 09:01:37 +00:00
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);
}
2018-09-12 17:26:21 +00:00
public int ConsumerCount { get; set; }
2020-06-15 21:43:52 +00:00
2018-09-12 17:26:21 +00:00
public string OriginalStreamId { get; set; }
public string TunerHostId => null;
public bool EnableStreamSharing { get; set; }
2020-06-15 21:43:52 +00:00
2018-09-12 17:26:21 +00:00
public MediaSourceInfo MediaSource { get; set; }
2020-07-20 09:01:37 +00:00
public string UniqueId { get; }
2018-09-12 17:26:21 +00:00
public Task Close()
{
return _closeFn();
}
2021-09-10 07:56:48 +00:00
public Stream GetStream()
{
throw new NotSupportedException();
}
2018-09-12 17:26:21 +00:00
public Task Open(CancellationToken openCancellationToken)
{
return Task.CompletedTask;
}
}
}