jellyfin/MediaBrowser.Controller/LiveTv/LiveStream.cs

46 lines
1.3 KiB
C#
Raw Normal View History

2016-09-29 12:55:49 +00:00
using System;
2016-10-10 18:18:28 +00:00
using System.Collections.Generic;
2016-09-29 12:55:49 +00:00
using System.Threading;
2016-09-25 18:39:13 +00:00
using System.Threading.Tasks;
using MediaBrowser.Model.Dto;
namespace MediaBrowser.Controller.LiveTv
{
public class LiveStream
{
public MediaSourceInfo OriginalMediaSource { get; set; }
2016-09-29 12:55:49 +00:00
public MediaSourceInfo OpenedMediaSource { get; set; }
2016-10-10 18:18:28 +00:00
public int ConsumerCount {
get { return SharedStreamIds.Count; }
}
2016-09-29 12:55:49 +00:00
public ITunerHost TunerHost { get; set; }
public string OriginalStreamId { get; set; }
2016-09-30 06:50:06 +00:00
public bool EnableStreamSharing { get; set; }
2016-10-07 15:08:13 +00:00
public string UniqueId = Guid.NewGuid().ToString("N");
2016-09-25 18:39:13 +00:00
2016-10-10 18:18:28 +00:00
public List<string> SharedStreamIds = new List<string>();
2016-09-25 18:39:13 +00:00
public LiveStream(MediaSourceInfo mediaSource)
{
OriginalMediaSource = mediaSource;
2016-09-29 12:55:49 +00:00
OpenedMediaSource = mediaSource;
2016-09-30 06:50:06 +00:00
EnableStreamSharing = true;
2016-09-25 18:39:13 +00:00
}
2016-10-10 18:18:28 +00:00
public Task Open(CancellationToken cancellationToken)
2016-09-29 12:55:49 +00:00
{
2016-10-10 18:18:28 +00:00
return OpenInternal(cancellationToken);
2016-09-29 12:55:49 +00:00
}
protected virtual Task OpenInternal(CancellationToken cancellationToken)
2016-09-25 18:39:13 +00:00
{
return Task.FromResult(true);
}
public virtual Task Close()
{
return Task.FromResult(true);
}
}
}