ITunerHost.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System.Collections.Generic;
  2. using System.Threading;
  3. using System.Threading.Tasks;
  4. using MediaBrowser.Controller.Library;
  5. using MediaBrowser.Model.Dto;
  6. using MediaBrowser.Model.LiveTv;
  7. namespace MediaBrowser.Controller.LiveTv
  8. {
  9. public interface ITunerHost
  10. {
  11. /// <summary>
  12. /// Gets the name.
  13. /// </summary>
  14. /// <value>The name.</value>
  15. string Name { get; }
  16. /// <summary>
  17. /// Gets the type.
  18. /// </summary>
  19. /// <value>The type.</value>
  20. string Type { get; }
  21. /// <summary>
  22. /// Gets the channels.
  23. /// </summary>
  24. /// <returns>Task&lt;IEnumerable&lt;ChannelInfo&gt;&gt;.</returns>
  25. Task<List<ChannelInfo>> GetChannels(bool enableCache, CancellationToken cancellationToken);
  26. /// <summary>
  27. /// Gets the tuner infos.
  28. /// </summary>
  29. /// <param name="cancellationToken">The cancellation token.</param>
  30. /// <returns>Task&lt;List&lt;LiveTvTunerInfo&gt;&gt;.</returns>
  31. Task<List<LiveTvTunerInfo>> GetTunerInfos(CancellationToken cancellationToken);
  32. /// <summary>
  33. /// Gets the channel stream.
  34. /// </summary>
  35. /// <param name="channelId">The channel identifier.</param>
  36. /// <param name="streamId">The stream identifier.</param>
  37. Task<ILiveStream> GetChannelStream(string channelId, string streamId, List<ILiveStream> currentLiveStreams, CancellationToken cancellationToken);
  38. /// <summary>
  39. /// Gets the channel stream media sources.
  40. /// </summary>
  41. /// <param name="channelId">The channel identifier.</param>
  42. /// <param name="cancellationToken">The cancellation token.</param>
  43. /// <returns>Task&lt;List&lt;MediaSourceInfo&gt;&gt;.</returns>
  44. Task<List<MediaSourceInfo>> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken);
  45. Task<List<TunerHostInfo>> DiscoverDevices(int discoveryDurationMs, CancellationToken cancellationToken);
  46. bool IsSupported
  47. {
  48. get;
  49. }
  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. }