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

46 lines
1.2 KiB
C#
Raw Normal View History

2019-11-01 10:38:54 -07:00
#pragma warning disable CS1591
using System;
using System.Globalization;
2018-09-12 10:26:21 -07:00
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Dto;
2018-09-12 10:26:21 -07:00
namespace Emby.Server.Implementations.Library
{
public class ExclusiveLiveStream : ILiveStream
{
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; private set; }
private 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 10:26:21 -07:00
}
public Task Close()
{
return _closeFn();
}
public Task Open(CancellationToken openCancellationToken)
{
return Task.CompletedTask;
}
}
}