aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/LiveTv/ITunerHost.cs
blob: 523eec24ac08ac805324f84fa8262e83588c96a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.LiveTv;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace MediaBrowser.Controller.LiveTv
{
    public interface ITunerHost
    {
        /// <summary>
        /// Gets the name.
        /// </summary>
        /// <value>The name.</value>
        string Name { get; }
        /// <summary>
        /// Gets the type.
        /// </summary>
        /// <value>The type.</value>
        string Type { get; }
        /// <summary>
        /// Gets the channels.
        /// </summary>
        /// <returns>Task&lt;IEnumerable&lt;ChannelInfo&gt;&gt;.</returns>
        Task<List<ChannelInfo>> GetChannels(bool enableCache, CancellationToken cancellationToken);
        /// <summary>
        /// Gets the tuner infos.
        /// </summary>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns>Task&lt;List&lt;LiveTvTunerInfo&gt;&gt;.</returns>
        Task<List<LiveTvTunerInfo>> GetTunerInfos(CancellationToken cancellationToken);
        /// <summary>
        /// Gets the channel stream.
        /// </summary>
        /// <param name="channelId">The channel identifier.</param>
        /// <param name="streamId">The stream identifier.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns>Task&lt;MediaSourceInfo&gt;.</returns>
        Task<ILiveStream> GetChannelStream(string channelId, string streamId, CancellationToken cancellationToken);
        /// <summary>
        /// Gets the channel stream media sources.
        /// </summary>
        /// <param name="channelId">The channel identifier.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns>Task&lt;List&lt;MediaSourceInfo&gt;&gt;.</returns>
        Task<List<MediaSourceInfo>> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken);

        Task<List<TunerHostInfo>> DiscoverDevices(int discoveryDurationMs, CancellationToken cancellationToken);
    }
    public interface IConfigurableTunerHost
    {
        /// <summary>
        /// Validates the specified information.
        /// </summary>
        /// <param name="info">The information.</param>
        /// <returns>Task.</returns>
        Task Validate(TunerHostInfo info);
    }

    public interface ILiveStream
    {
        Task Open(CancellationToken openCancellationToken);
        void Close();
        int ConsumerCount { get; }
        string OriginalStreamId { get; set; }
        bool EnableStreamSharing { get; set; }
        ITunerHost TunerHost { get; set; }
        MediaSourceInfo OpenedMediaSource { get; set; }
        string UniqueId { get; }
        List<string> SharedStreamIds { get; }
    }
}