Forráskód Böngészése

added profile and level params for hls

Luke Pulverenti 12 éve
szülő
commit
071e13fb4c

+ 12 - 2
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

+ 14 - 0
MediaBrowser.Api/Playback/StreamRequest.cs

@@ -135,5 +135,19 @@ namespace MediaBrowser.Api.Playback
         /// <value>The framerate.</value>
         [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; }
+
+        /// <summary>
+        /// Gets or sets the profile.
+        /// </summary>
+        /// <value>The profile.</value>
+        [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; }
+
+        /// <summary>
+        /// Gets or sets the level.
+        /// </summary>
+        /// <value>The level.</value>
+        [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; }
     }
 }