using System.Collections.Concurrent;
using Microsoft.AspNetCore.Http;
using Yavsc.Models;
using Yavsc.ViewModels.Streaming;
using Yavsc.Abstract.Streaming;
namespace Yavsc.Services
{
public interface ILiveProcessor {
///
/// instance keeping reference on
/// all collections of casting and listenning websockets
///
///
ConcurrentDictionary Casters { get; }
///
/// Try and accept websocket from aspnet http context
///
///
///
Task AcceptStream (HttpContext context, ApplicationUser user, string destDir, string fileName);
Task CreateAsync(string ownerId, string ownerName, string title, CancellationToken ct,
Guid? id = null, bool refineReplay = false, int retentionDays = PodcastRetention.DefaultDays);
Task> ListAsync(CancellationToken ct);
Task GetAsync(Guid id, CancellationToken ct);
Task AppendAsync(Guid id, string ownerId, int sequence,
double durationSeconds, Stream input, CancellationToken ct);
Task CompleteAsync(Guid id, string ownerId, CancellationToken ct);
/// Opens a segment; the originals of a refined emission are reserved to its owner after the live.
Task OpenSegmentAsync(Guid id, int sequence, string? viewerId, CancellationToken ct);
Task OpenReplayAsync(Guid id, CancellationToken ct);
Task PrepareNextReplayAsync(IPodcastReplayRemuxer remuxer, CancellationToken ct);
Task RetryReplayAsync(Guid id, string ownerId, CancellationToken ct);
Task SaveDraftAsync(Guid id, string ownerId, SavePodcastDraftRequest request, CancellationToken ct);
Task PublishDraftAsync(Guid id, string ownerId, int revision, CancellationToken ct);
Task OpenDraftSourceAsync(Guid id, string ownerId, CancellationToken ct);
Task PublishNextDraftAsync(IPodcastReplayEditor editor, CancellationToken ct);
/// Deletes the originals and draft of a published refined replay; the MP4 remains.
Task DeleteOriginalsAsync(Guid id, string ownerId, CancellationToken ct);
///
/// Applies the retention of refined replays: purges the originals of published ones and deletes
/// the emissions never published before their deadline, which are returned.
///
Task> PurgeExpiredOriginalsAsync(CancellationToken ct);
Task DeleteAsync(Guid id, string ownerId, CancellationToken ct);
}
}