using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Data.Entities;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Configuration;
namespace MediaBrowser.Controller.Trickplay;
///
/// Interface ITrickplayManager.
///
public interface ITrickplayManager
{
///
/// Generates new trickplay images and metadata.
///
/// The video.
/// Whether or not existing data should be replaced.
/// CancellationToken to use for operation.
/// Task.
Task RefreshTrickplayDataAsync(Video video, bool replace, CancellationToken cancellationToken);
///
/// Creates trickplay tiles out of individual thumbnails.
///
/// Ordered file paths of the thumbnails to be used.
/// The width of a single thumbnail.
/// The trickplay options.
/// The output directory.
/// The associated trickplay information.
///
/// The output directory will be DELETED and replaced if it already exists.
///
TrickplayInfo CreateTiles(List images, int width, TrickplayOptions options, string outputDir);
///
/// Get available trickplay resolutions and corresponding info.
///
/// The item.
/// Map of width resolutions to trickplay tiles info.
Task> GetTrickplayResolutions(Guid itemId);
///
/// Saves trickplay info.
///
/// The trickplay info.
/// Task.
Task SaveTrickplayInfo(TrickplayInfo info);
///
/// Gets all trickplay infos for all media streams of an item.
///
/// The item.
/// A map of media source id to a map of tile width to trickplay info.
Task>> GetTrickplayManifest(BaseItem item);
///
/// Gets the path to a trickplay tile image.
///
/// The item.
/// The width of a single thumbnail.
/// The tile's index.
/// The absolute path.
string GetTrickplayTilePath(BaseItem item, int width, int index);
///
/// Gets the trickplay HLS playlist.
///
/// The item.
/// The width of a single thumbnail.
/// Optional api key of the requesting user.
/// The text content of the .m3u8 playlist.
Task GetHlsPlaylist(Guid itemId, int width, string? apiKey);
}