ITunerHost.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using MediaBrowser.Model.Dto;
  3. using MediaBrowser.Model.LiveTv;
  4. using System.Collections.Generic;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  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<IEnumerable<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. /// <param name="cancellationToken">The cancellation token.</param>
  38. /// <returns>Task&lt;MediaSourceInfo&gt;.</returns>
  39. Task<LiveStream> GetChannelStream(string channelId, string streamId, 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. }
  48. public interface IConfigurableTunerHost
  49. {
  50. /// <summary>
  51. /// Validates the specified information.
  52. /// </summary>
  53. /// <param name="info">The information.</param>
  54. /// <returns>Task.</returns>
  55. Task Validate(TunerHostInfo info);
  56. }
  57. }