ITunerHost.cs 2.5 KB

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