ITunerHost.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. /// <param name="enableCache">Option to enable using cache.</param>
  28. /// <param name="cancellationToken">The CancellationToken for this operation.</param>
  29. /// <returns>Task&lt;IEnumerable&lt;ChannelInfo&gt;&gt;.</returns>
  30. Task<List<ChannelInfo>> GetChannels(bool enableCache, CancellationToken cancellationToken);
  31. /// <summary>
  32. /// Gets the channel stream.
  33. /// </summary>
  34. /// <param name="channelId">The channel identifier.</param>
  35. /// <param name="streamId">The stream identifier.</param>
  36. /// <param name="currentLiveStreams">The current live streams.</param>
  37. /// <param name="cancellationToken">The cancellation token to cancel operation.</param>
  38. /// <returns>Live stream wrapped in a task.</returns>
  39. Task<ILiveStream> GetChannelStream(string channelId, string streamId, IList<ILiveStream> currentLiveStreams, CancellationToken cancellationToken);
  40. /// <summary>
  41. /// Gets the channel stream media sources.
  42. /// </summary>
  43. /// <param name="channelId">The channel identifier.</param>
  44. /// <param name="cancellationToken">The cancellation token.</param>
  45. /// <returns>Task&lt;List&lt;MediaSourceInfo&gt;&gt;.</returns>
  46. Task<List<MediaSourceInfo>> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken);
  47. Task<List<TunerHostInfo>> DiscoverDevices(int discoveryDurationMs, CancellationToken cancellationToken);
  48. }
  49. public interface IConfigurableTunerHost
  50. {
  51. /// <summary>
  52. /// Validates the specified information.
  53. /// </summary>
  54. /// <param name="info">The information.</param>
  55. /// <returns>Task.</returns>
  56. Task Validate(TunerHostInfo info);
  57. }
  58. }