jellyfin/MediaBrowser.Controller/LiveTv/LiveStream.cs

46 lines
1.3 KiB
C#
Raw Normal View History

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