From e9cfa6cd267786f8fd97ef2aeb88941c98c8aacf Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 1 May 2013 16:07:20 -0400 Subject: add remote streaming capabilities --- .../MediaEncoder/MediaEncoder.cs | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs') diff --git a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs index 3d4da1e15..d02031fe6 100644 --- a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs +++ b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs @@ -310,6 +310,9 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder case InputType.Bluray: inputPath = GetBlurayInputArgument(inputFiles[0]); break; + case InputType.Url: + inputPath = GetHttpInputArgument(inputFiles); + break; default: throw new ArgumentException("Unrecognized InputType"); } @@ -317,6 +320,18 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder return inputPath; } + /// + /// Gets the HTTP input argument. + /// + /// The input files. + /// System.String. + private string GetHttpInputArgument(string[] inputFiles) + { + var url = inputFiles[0]; + + return string.Format("\"{0}\"", url); + } + /// /// Gets the probe size argument. /// @@ -1005,7 +1020,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder /// /// The path. /// System.String. - public string GetFileInputArgument(string path) + private string GetFileInputArgument(string path) { return string.Format("file:\"{0}\"", path); } @@ -1015,7 +1030,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder /// /// The playable stream files. /// System.String. - public string GetConcatInputArgument(string[] playableStreamFiles) + private string GetConcatInputArgument(string[] playableStreamFiles) { // Get all streams // If there's more than one we'll need to use the concat command @@ -1027,7 +1042,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder } // Determine the input path for video files - return string.Format("file:\"{0}\"", playableStreamFiles[0]); + return GetFileInputArgument(playableStreamFiles[0]); } /// @@ -1035,7 +1050,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder /// /// The bluray root. /// System.String. - public string GetBlurayInputArgument(string blurayRoot) + private string GetBlurayInputArgument(string blurayRoot) { return string.Format("bluray:\"{0}\"", blurayRoot); } -- cgit v1.2.3