2019-11-01 13:38:54 -04:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-01-13 14:54:44 -05:00
|
|
|
using System;
|
2019-02-28 17:22:57 -05:00
|
|
|
using System.Globalization;
|
2018-09-12 13:26:21 -04:00
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using MediaBrowser.Controller.Library;
|
2019-01-13 14:21:32 -05:00
|
|
|
using MediaBrowser.Model.Dto;
|
2018-09-12 13:26:21 -04:00
|
|
|
|
|
|
|
namespace Emby.Server.Implementations.Library
|
|
|
|
{
|
|
|
|
public class ExclusiveLiveStream : ILiveStream
|
|
|
|
{
|
|
|
|
public int ConsumerCount { get; set; }
|
2020-06-15 17:43:52 -04:00
|
|
|
|
2018-09-12 13:26:21 -04:00
|
|
|
public string OriginalStreamId { get; set; }
|
|
|
|
|
|
|
|
public string TunerHostId => null;
|
|
|
|
|
|
|
|
public bool EnableStreamSharing { get; set; }
|
2020-06-15 17:43:52 -04:00
|
|
|
|
2018-09-12 13:26:21 -04:00
|
|
|
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;
|
2019-02-28 17:22:57 -05:00
|
|
|
UniqueId = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
|
2018-09-12 13:26:21 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public Task Close()
|
|
|
|
{
|
|
|
|
return _closeFn();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Task Open(CancellationToken openCancellationToken)
|
|
|
|
{
|
|
|
|
return Task.CompletedTask;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|