ITunerHost.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #nullable disable
  2. #pragma warning disable CS1591
  3. using System.Collections.Generic;
  4. using System.Threading;
  5. using System.Threading.Tasks;
  6. using MediaBrowser.Controller.Library;
  7. using MediaBrowser.Model.Dto;
  8. using MediaBrowser.Model.LiveTv;
  9. namespace MediaBrowser.Controller.LiveTv
  10. {
  11. public interface ITunerHost
  12. {
  13. /// <summary>
  14. /// Gets the name.
  15. /// </summary>
  16. /// <value>The name.</value>
  17. string Name { get; }
  18. /// <summary>
  19. /// Gets the type.
  20. /// </summary>
  21. /// <value>The type.</value>
  22. string Type { get; }
  23. bool IsSupported { get; }
  24. /// <summary>
  25. /// Gets the channels.
  26. /// </summary>
  27. /// <returns>Task&lt;IEnumerable&lt;ChannelInfo&gt;&gt;.</returns>
  28. Task<List<ChannelInfo>> GetChannels(bool enableCache, CancellationToken cancellationToken);
  29. /// <summary>
  30. /// Gets the tuner infos.
  31. /// </summary>
  32. /// <param name="cancellationToken">The cancellation token.</param>
  33. /// <returns>Task&lt;List&lt;LiveTvTunerInfo&gt;&gt;.</returns>
  34. Task<List<LiveTvTunerInfo>> GetTunerInfos(CancellationToken cancellationToken);
  35. /// <summary>
  36. /// Gets the channel stream.
  37. /// </summary>
  38. /// <param name="channelId">The channel identifier.</param>
  39. /// <param name="streamId">The stream identifier.</param>
  40. /// <param name="currentLiveStreams">The current live streams.</param>
  41. /// <param name="cancellationToken">The cancellation token to cancel operation.</param>
  42. Task<ILiveStream> GetChannelStream(string channelId, string streamId, List<ILiveStream> currentLiveStreams, CancellationToken cancellationToken);
  43. /// <summary>
  44. /// Gets the channel stream media sources.
  45. /// </summary>
  46. /// <param name="channelId">The channel identifier.</param>
  47. /// <param name="cancellationToken">The cancellation token.</param>
  48. /// <returns>Task&lt;List&lt;MediaSourceInfo&gt;&gt;.</returns>
  49. Task<List<MediaSourceInfo>> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken);
  50. Task<List<TunerHostInfo>> DiscoverDevices(int discoveryDurationMs, CancellationToken cancellationToken);
  51. }
  52. public interface IConfigurableTunerHost
  53. {
  54. /// <summary>
  55. /// Validates the specified information.
  56. /// </summary>
  57. /// <param name="info">The information.</param>
  58. /// <returns>Task.</returns>
  59. Task Validate(TunerHostInfo info);
  60. }
  61. }