From 071e13fb4cb0543ea17836a3969d536842860a91 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 28 Mar 2013 10:42:03 -0400 Subject: [PATCH] added profile and level params for hls --- MediaBrowser.Api/Playback/Hls/VideoHlsService.cs | 14 ++++++++++++-- MediaBrowser.Api/Playback/StreamRequest.cs | 14 ++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs index 699d45de3f..4931383b67 100644 --- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs @@ -8,14 +8,14 @@ using ServiceStack.ServiceHost; namespace MediaBrowser.Api.Playback.Hls { [Route("/Videos/{Id}/stream.m3u8", "GET")] - [ServiceStack.ServiceHost.Api(Description = "Gets a video stream using HTTP live streaming.")] + [Api(Description = "Gets a video stream using HTTP live streaming.")] public class GetHlsVideoStream : VideoStreamRequest { } [Route("/Videos/{Id}/segments/{SegmentId}/stream.ts", "GET")] - [ServiceStack.ServiceHost.Api(Description = "Gets an Http live streaming segment file. Internal use only.")] + [Api(Description = "Gets an Http live streaming segment file. Internal use only.")] public class GetHlsVideoSegment { public string Id { get; set; } @@ -154,6 +154,16 @@ namespace MediaBrowser.Api.Playback.Hls args += " -vsync vfr"; + if (!string.IsNullOrEmpty(state.VideoRequest.Profile)) + { + args += " -profile:v " + state.VideoRequest.Profile; + } + + if (!string.IsNullOrEmpty(state.VideoRequest.Level)) + { + args += " -level 3 " + state.VideoRequest.Level; + } + if (state.SubtitleStream != null) { // This is for internal graphical subs diff --git a/MediaBrowser.Api/Playback/StreamRequest.cs b/MediaBrowser.Api/Playback/StreamRequest.cs index a0b0a1a72d..d4da11e3f3 100644 --- a/MediaBrowser.Api/Playback/StreamRequest.cs +++ b/MediaBrowser.Api/Playback/StreamRequest.cs @@ -135,5 +135,19 @@ namespace MediaBrowser.Api.Playback /// The framerate. [ApiMember(Name = "Framerate", Description = "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", IsRequired = false, DataType = "double", ParameterType = "query", Verb = "GET")] public double? Framerate { get; set; } + + /// + /// Gets or sets the profile. + /// + /// The profile. + [ApiMember(Name = "Profile", Description = "Optional. Specify a specific h264 profile, e.g. main, baseline, high.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + public string Profile { get; set; } + + /// + /// Gets or sets the level. + /// + /// The level. + [ApiMember(Name = "Level", Description = "Optional. Specify a level for the h264 profile, e.g. 3, 3.1.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + public string Level { get; set; } } }