Files
jellyfin-jellyfin-1/MediaBrowser.Api/Playback/Progressive/VideoService.cs

98 lines
4.1 KiB
C#
Raw Normal View History

using MediaBrowser.Controller.Configuration;
2015-01-20 00:19:13 -05:00
using MediaBrowser.Controller.Devices;
2014-03-25 01:25:03 -04:00
using MediaBrowser.Controller.Dlna;
2013-09-18 14:49:06 -04:00
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Library;
2014-02-20 11:37:41 -05:00
using MediaBrowser.Controller.MediaEncoding;
2013-08-09 21:16:31 -04:00
using MediaBrowser.Model.IO;
2015-05-04 13:44:25 -04:00
using MediaBrowser.Model.Serialization;
2016-06-19 02:18:29 -04:00
using System.Threading.Tasks;
2016-11-10 09:41:24 -05:00
using MediaBrowser.Controller.Net;
2016-10-25 15:02:04 -04:00
using MediaBrowser.Model.Services;
2013-02-20 20:33:05 -05:00
2013-02-26 23:19:05 -05:00
namespace MediaBrowser.Api.Playback.Progressive
2013-02-20 20:33:05 -05:00
{
2013-02-26 23:44:41 -05:00
/// <summary>
2015-05-24 14:33:28 -04:00
/// Class GetVideoStream
2013-02-26 23:44:41 -05:00
/// </summary>
2015-09-09 23:22:52 -04:00
[Route("/Videos/{Id}/stream.mpegts", "GET")]
2013-02-26 23:44:41 -05:00
[Route("/Videos/{Id}/stream.ts", "GET")]
[Route("/Videos/{Id}/stream.webm", "GET")]
[Route("/Videos/{Id}/stream.asf", "GET")]
[Route("/Videos/{Id}/stream.wmv", "GET")]
[Route("/Videos/{Id}/stream.ogv", "GET")]
[Route("/Videos/{Id}/stream.mp4", "GET")]
[Route("/Videos/{Id}/stream.m4v", "GET")]
[Route("/Videos/{Id}/stream.mkv", "GET")]
[Route("/Videos/{Id}/stream.mpeg", "GET")]
2014-06-18 01:16:00 -04:00
[Route("/Videos/{Id}/stream.mpg", "GET")]
2013-02-26 23:44:41 -05:00
[Route("/Videos/{Id}/stream.avi", "GET")]
2013-03-11 10:54:08 -04:00
[Route("/Videos/{Id}/stream.m2ts", "GET")]
[Route("/Videos/{Id}/stream.3gp", "GET")]
2013-04-10 17:03:41 -04:00
[Route("/Videos/{Id}/stream.wmv", "GET")]
[Route("/Videos/{Id}/stream.wtv", "GET")]
2014-10-11 16:38:13 -04:00
[Route("/Videos/{Id}/stream.mov", "GET")]
2016-02-29 11:23:30 -05:00
[Route("/Videos/{Id}/stream.iso", "GET")]
2017-02-15 16:18:56 -05:00
[Route("/Videos/{Id}/stream.flv", "GET")]
2013-02-26 23:44:41 -05:00
[Route("/Videos/{Id}/stream", "GET")]
2013-03-12 23:57:54 -04:00
[Route("/Videos/{Id}/stream.ts", "HEAD")]
[Route("/Videos/{Id}/stream.webm", "HEAD")]
[Route("/Videos/{Id}/stream.asf", "HEAD")]
[Route("/Videos/{Id}/stream.wmv", "HEAD")]
[Route("/Videos/{Id}/stream.ogv", "HEAD")]
[Route("/Videos/{Id}/stream.mp4", "HEAD")]
[Route("/Videos/{Id}/stream.m4v", "HEAD")]
[Route("/Videos/{Id}/stream.mkv", "HEAD")]
[Route("/Videos/{Id}/stream.mpeg", "HEAD")]
2014-06-18 01:16:00 -04:00
[Route("/Videos/{Id}/stream.mpg", "HEAD")]
2013-03-12 23:57:54 -04:00
[Route("/Videos/{Id}/stream.avi", "HEAD")]
[Route("/Videos/{Id}/stream.3gp", "HEAD")]
2013-04-10 17:03:41 -04:00
[Route("/Videos/{Id}/stream.wmv", "HEAD")]
[Route("/Videos/{Id}/stream.wtv", "HEAD")]
2013-03-12 23:57:54 -04:00
[Route("/Videos/{Id}/stream.m2ts", "HEAD")]
2014-10-11 16:38:13 -04:00
[Route("/Videos/{Id}/stream.mov", "HEAD")]
2016-02-29 11:23:30 -05:00
[Route("/Videos/{Id}/stream.iso", "HEAD")]
2017-02-15 16:18:56 -05:00
[Route("/Videos/{Id}/stream.flv", "HEAD")]
2013-03-12 23:57:54 -04:00
[Route("/Videos/{Id}/stream", "HEAD")]
2013-03-08 21:34:54 -05:00
public class GetVideoStream : VideoStreamRequest
2013-02-26 23:44:41 -05:00
{
}
2013-03-07 12:39:21 -05:00
2013-02-20 20:33:05 -05:00
/// <summary>
2013-02-26 23:19:05 -05:00
/// Class VideoService
2013-02-20 20:33:05 -05:00
/// </summary>
2013-02-26 23:19:05 -05:00
public class VideoService : BaseProgressiveStreamingService
2013-02-20 20:33:05 -05:00
{
2016-11-10 09:41:24 -05:00
public VideoService(IServerConfigurationManager serverConfig, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager, IMediaEncoder mediaEncoder, IFileSystem fileSystem, IDlnaManager dlnaManager, ISubtitleEncoder subtitleEncoder, IDeviceManager deviceManager, IMediaSourceManager mediaSourceManager, IZipClient zipClient, IJsonSerializer jsonSerializer, IAuthorizationContext authorizationContext, IImageProcessor imageProcessor) : base(serverConfig, userManager, libraryManager, isoManager, mediaEncoder, fileSystem, dlnaManager, subtitleEncoder, deviceManager, mediaSourceManager, zipClient, jsonSerializer, authorizationContext, imageProcessor)
2013-02-20 20:33:05 -05:00
{
}
2013-02-26 23:44:41 -05:00
/// <summary>
/// Gets the specified request.
/// </summary>
/// <param name="request">The request.</param>
/// <returns>System.Object.</returns>
2016-06-19 02:18:29 -04:00
public Task<object> Get(GetVideoStream request)
2013-02-26 23:44:41 -05:00
{
2013-03-12 23:57:54 -04:00
return ProcessRequest(request, false);
2013-02-26 23:44:41 -05:00
}
2013-03-07 12:39:21 -05:00
2013-04-29 12:01:23 -04:00
/// <summary>
/// Heads the specified request.
/// </summary>
/// <param name="request">The request.</param>
/// <returns>System.Object.</returns>
2016-06-19 02:18:29 -04:00
public Task<object> Head(GetVideoStream request)
2013-03-12 23:57:54 -04:00
{
return ProcessRequest(request, true);
}
2015-03-28 16:22:27 -04:00
protected override string GetCommandLineArguments(string outputPath, StreamState state, bool isEncoding)
2013-02-20 20:33:05 -05:00
{
var encodingOptions = ApiEntryPoint.Instance.GetEncodingOptions();
2017-03-19 14:59:05 -04:00
return EncodingHelper.GetProgressiveVideoFullCommandLine(state, encodingOptions, outputPath, GetDefaultH264Preset());
2013-02-20 20:33:05 -05:00
}
}
2016-08-07 16:13:30 -04:00
}