ITrickplayManager.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading;
  4. using System.Threading.Tasks;
  5. using MediaBrowser.Controller.Entities;
  6. using MediaBrowser.Model.Entities;
  7. namespace MediaBrowser.Controller.Trickplay
  8. {
  9. /// <summary>
  10. /// Interface ITrickplayManager.
  11. /// </summary>
  12. public interface ITrickplayManager
  13. {
  14. /// <summary>
  15. /// Generate or replace trickplay data.
  16. /// </summary>
  17. /// <param name="video">The video.</param>
  18. /// <param name="replace">Whether or not existing data should be replaced.</param>
  19. /// <param name="cancellationToken">CancellationToken to use for operation.</param>
  20. /// <returns>Task.</returns>
  21. Task RefreshTrickplayData(Video video, bool replace, CancellationToken cancellationToken);
  22. /// <summary>
  23. /// Get available trickplay resolutions and corresponding info.
  24. /// </summary>
  25. /// <param name="itemId">The item.</param>
  26. /// <returns>Map of width resolutions to trickplay tiles info.</returns>
  27. Dictionary<int, TrickplayTilesInfo> GetTilesResolutions(Guid itemId);
  28. /// <summary>
  29. /// Saves trickplay tiles info.
  30. /// </summary>
  31. /// <param name="itemId">The item.</param>
  32. /// <param name="tilesInfo">The trickplay tiles info.</param>
  33. void SaveTilesInfo(Guid itemId, TrickplayTilesInfo tilesInfo);
  34. /// <summary>
  35. /// Gets the trickplay manifest.
  36. /// </summary>
  37. /// <param name="item">The item.</param>
  38. /// <returns>A map of media source id to a map of tile width to tile info.</returns>
  39. Dictionary<Guid, Dictionary<int, TrickplayTilesInfo>> GetTrickplayManifest(BaseItem item);
  40. /// <summary>
  41. /// Gets the path to a trickplay tiles image.
  42. /// </summary>
  43. /// <param name="item">The item.</param>
  44. /// <param name="width">The width of a single tile.</param>
  45. /// <param name="index">The tile grid's index.</param>
  46. /// <returns>The absolute path.</returns>
  47. string GetTrickplayTilePath(BaseItem item, int width, int index);
  48. }
  49. }