2019-06-27 10:30:28 +01:00
|
|
|
using System.Collections.Concurrent;
|
2023-03-19 17:57:55 +00:00
|
|
|
using Microsoft.AspNetCore.Http;
|
2020-10-09 19:35:39 +01:00
|
|
|
using Yavsc.Models;
|
2019-06-27 10:30:28 +01:00
|
|
|
using Yavsc.ViewModels.Streaming;
|
2026-10-19 15:22:34 +01:00
|
|
|
using Yavsc.Abstract.Streaming;
|
2019-06-27 10:30:28 +01:00
|
|
|
|
|
|
|
|
namespace Yavsc.Services
|
|
|
|
|
{
|
|
|
|
|
public interface ILiveProcessor {
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// instance keeping reference on
|
|
|
|
|
/// all collections of casting and listenning websockets
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value></value>
|
|
|
|
|
ConcurrentDictionary<string, LiveCastHandler> Casters { get; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Try and accept websocket from aspnet http context
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="context"></param>
|
|
|
|
|
/// <returns></returns>
|
2020-10-09 19:35:39 +01:00
|
|
|
Task<bool> AcceptStream (HttpContext context, ApplicationUser user, string destDir, string fileName);
|
2019-06-27 10:30:28 +01:00
|
|
|
|
2026-11-16 14:22:14 +00:00
|
|
|
Task<PodcastResponse> CreateAsync(string ownerId, string ownerName, string title, CancellationToken ct,
|
|
|
|
|
Guid? id = null, bool refineReplay = false);
|
2026-10-19 15:22:34 +01:00
|
|
|
Task<IReadOnlyList<PodcastResponse>> ListAsync(CancellationToken ct);
|
|
|
|
|
Task<PodcastManifestResponse> GetAsync(Guid id, CancellationToken ct);
|
|
|
|
|
Task<PodcastResponse> AppendAsync(Guid id, string ownerId, int sequence,
|
|
|
|
|
double durationSeconds, Stream input, CancellationToken ct);
|
|
|
|
|
Task<PodcastResponse> CompleteAsync(Guid id, string ownerId, CancellationToken ct);
|
2026-11-16 14:22:14 +00:00
|
|
|
/// <summary>Opens a segment; the originals of a refined emission are reserved to its owner after the live.</summary>
|
|
|
|
|
Task<Stream> OpenSegmentAsync(Guid id, int sequence, string? viewerId, CancellationToken ct);
|
2026-10-25 00:48:53 +01:00
|
|
|
Task<Stream> OpenReplayAsync(Guid id, CancellationToken ct);
|
|
|
|
|
Task<bool> PrepareNextReplayAsync(IPodcastReplayRemuxer remuxer, CancellationToken ct);
|
|
|
|
|
Task RetryReplayAsync(Guid id, string ownerId, CancellationToken ct);
|
2026-11-16 14:22:14 +00:00
|
|
|
Task<PodcastResponse> SaveDraftAsync(Guid id, string ownerId, SavePodcastDraftRequest request, CancellationToken ct);
|
|
|
|
|
Task<PodcastResponse> PublishDraftAsync(Guid id, string ownerId, int revision, CancellationToken ct);
|
|
|
|
|
Task<Stream> OpenDraftSourceAsync(Guid id, string ownerId, CancellationToken ct);
|
|
|
|
|
Task<bool> PublishNextDraftAsync(IPodcastReplayEditor editor, CancellationToken ct);
|
2026-10-19 15:22:34 +01:00
|
|
|
Task DeleteAsync(Guid id, string ownerId, CancellationToken ct);
|
2019-06-27 10:30:28 +01:00
|
|
|
}
|
2020-10-09 19:35:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|