jellyfin-server/MediaBrowser.Controller/LiveTv/LiveStream.cs

42 lines
1.2 KiB
C#
Raw Normal View History

2016-09-29 12:55:49 +00:00
using System;
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; }
public DateTime DateOpened { get; set; }
public int ConsumerCount { get; set; }
public ITunerHost TunerHost { get; set; }
public string OriginalStreamId { get; set; }
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-25 18:39:13 +00:00
}
2016-09-29 12:55:49 +00:00
public async Task Open(CancellationToken cancellationToken)
{
await OpenInternal(cancellationToken).ConfigureAwait(false);
DateOpened = DateTime.UtcNow;
OpenedMediaSource.DateLiveStreamOpened = DateOpened;
}
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);
}
}
}