2015-03-07 22:43:53 +00:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
|
using MediaBrowser.Controller.Persistence;
|
|
|
|
|
using MediaBrowser.Model.Dto;
|
2015-02-07 21:03:09 +00:00
|
|
|
|
using MediaBrowser.Model.Entities;
|
2015-03-29 16:45:16 +00:00
|
|
|
|
using MediaBrowser.Model.MediaInfo;
|
2015-03-03 07:03:17 +00:00
|
|
|
|
using System;
|
2015-02-07 21:03:09 +00:00
|
|
|
|
using System.Collections.Generic;
|
2015-03-07 22:43:53 +00:00
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
2016-10-05 07:15:29 +00:00
|
|
|
|
using System.IO;
|
2015-02-07 21:03:09 +00:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Library
|
|
|
|
|
{
|
|
|
|
|
public interface IMediaSourceManager
|
|
|
|
|
{
|
2015-03-07 22:43:53 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Adds the parts.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="providers">The providers.</param>
|
|
|
|
|
void AddParts(IEnumerable<IMediaSourceProvider> providers);
|
|
|
|
|
|
2015-03-03 07:03:17 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the media streams.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="itemId">The item identifier.</param>
|
|
|
|
|
/// <returns>IEnumerable<MediaStream>.</returns>
|
2017-08-05 19:02:33 +00:00
|
|
|
|
List<MediaStream> GetMediaStreams(Guid itemId);
|
2015-03-03 07:03:17 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the media streams.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="mediaSourceId">The media source identifier.</param>
|
|
|
|
|
/// <returns>IEnumerable<MediaStream>.</returns>
|
2017-08-05 19:02:33 +00:00
|
|
|
|
List<MediaStream> GetMediaStreams(string mediaSourceId);
|
2015-03-03 07:03:17 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the media streams.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
|
/// <returns>IEnumerable<MediaStream>.</returns>
|
2017-08-05 19:02:33 +00:00
|
|
|
|
List<MediaStream> GetMediaStreams(MediaStreamQuery query);
|
2015-03-07 22:43:53 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the playack media sources.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
|
/// <param name="userId">The user identifier.</param>
|
2015-03-12 03:37:25 +00:00
|
|
|
|
/// <param name="enablePathSubstitution">if set to <c>true</c> [enable path substitution].</param>
|
2015-04-09 05:20:23 +00:00
|
|
|
|
/// <param name="supportedLiveMediaTypes">The supported live media types.</param>
|
2015-03-07 22:43:53 +00:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>IEnumerable<MediaSourceInfo>.</returns>
|
2015-04-09 05:20:23 +00:00
|
|
|
|
Task<IEnumerable<MediaSourceInfo>> GetPlayackMediaSources(string id, string userId, bool enablePathSubstitution, string[] supportedLiveMediaTypes, CancellationToken cancellationToken);
|
2015-03-07 22:43:53 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the static media sources.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="enablePathSubstitution">if set to <c>true</c> [enable path substitution].</param>
|
|
|
|
|
/// <param name="user">The user.</param>
|
|
|
|
|
/// <returns>IEnumerable<MediaSourceInfo>.</returns>
|
2017-08-05 19:02:33 +00:00
|
|
|
|
List<MediaSourceInfo> GetStaticMediaSources(IHasMediaSources item, bool enablePathSubstitution, User user = null);
|
2015-04-09 05:20:23 +00:00
|
|
|
|
|
2015-03-07 22:43:53 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the static media source.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>MediaSourceInfo.</returns>
|
2016-09-18 20:38:38 +00:00
|
|
|
|
Task<MediaSourceInfo> GetMediaSource(IHasMediaSources item, string mediaSourceId, string liveStreamId, bool enablePathSubstitution, CancellationToken cancellationToken);
|
2015-03-28 20:22:27 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Opens the media source.
|
|
|
|
|
/// </summary>
|
2015-03-29 16:45:16 +00:00
|
|
|
|
/// <param name="request">The request.</param>
|
2015-03-28 20:22:27 +00:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task<MediaSourceInfo>.</returns>
|
2017-04-17 19:01:16 +00:00
|
|
|
|
Task<LiveStreamResponse> OpenLiveStream(LiveStreamRequest request, CancellationToken cancellationToken);
|
2015-03-29 04:56:39 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the live stream.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task<MediaSourceInfo>.</returns>
|
|
|
|
|
Task<MediaSourceInfo> GetLiveStream(string id, CancellationToken cancellationToken);
|
2016-10-05 07:15:29 +00:00
|
|
|
|
|
|
|
|
|
Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> GetLiveStreamWithDirectStreamProvider(string id, CancellationToken cancellationToken);
|
2015-03-28 20:22:27 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Closes the media source.
|
|
|
|
|
/// </summary>
|
2015-03-29 04:56:39 +00:00
|
|
|
|
/// <param name="id">The live stream identifier.</param>
|
2015-03-28 20:22:27 +00:00
|
|
|
|
/// <returns>Task.</returns>
|
2016-09-29 12:55:49 +00:00
|
|
|
|
Task CloseLiveStream(string id);
|
2015-02-07 21:03:09 +00:00
|
|
|
|
}
|
2016-10-05 07:15:29 +00:00
|
|
|
|
|
|
|
|
|
public interface IDirectStreamProvider
|
|
|
|
|
{
|
|
|
|
|
Task CopyToAsync(Stream stream, CancellationToken cancellationToken);
|
|
|
|
|
}
|
2015-02-07 21:03:09 +00:00
|
|
|
|
}
|