From 21fd761b05584481d9f6293ca48e373f356c80b6 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 16 Jun 2014 21:56:23 -0400 Subject: fixes #838 - Support rtmp protocol with channels --- .../MediaEncoding/MediaEncoderHelpers.cs | 93 +++------------------- 1 file changed, 10 insertions(+), 83 deletions(-) (limited to 'MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs') diff --git a/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs b/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs index 6a37626b7..37dd06da9 100644 --- a/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs +++ b/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs @@ -1,5 +1,6 @@ using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; +using MediaBrowser.Model.MediaInfo; using System; using System.Collections.Generic; using System.Globalization; @@ -17,56 +18,22 @@ namespace MediaBrowser.Controller.MediaEncoding /// Gets the input argument. /// /// The video path. - /// if set to true [is remote]. - /// Type of the video. - /// Type of the iso. + /// The protocol. /// The iso mount. /// The playable stream file names. - /// The type. /// System.String[][]. - public static string[] GetInputArgument(string videoPath, bool isRemote, VideoType videoType, IsoType? isoType, IIsoMount isoMount, IEnumerable playableStreamFileNames, out InputType type) + public static string[] GetInputArgument(string videoPath, MediaProtocol protocol, IIsoMount isoMount, List playableStreamFileNames) { - var inputPath = isoMount == null ? new[] { videoPath } : new[] { isoMount.MountedPath }; - - type = InputType.File; - - switch (videoType) + if (playableStreamFileNames.Count > 0) { - case VideoType.BluRay: - type = InputType.Bluray; - inputPath = GetPlayableStreamFiles(inputPath[0], playableStreamFileNames).ToArray(); - break; - case VideoType.Dvd: - type = InputType.Dvd; - inputPath = GetPlayableStreamFiles(inputPath[0], playableStreamFileNames).ToArray(); - break; - case VideoType.Iso: - if (isoType.HasValue) - { - switch (isoType.Value) - { - case IsoType.BluRay: - type = InputType.Bluray; - inputPath = GetPlayableStreamFiles(inputPath[0], playableStreamFileNames).ToArray(); - break; - case IsoType.Dvd: - type = InputType.Dvd; - inputPath = GetPlayableStreamFiles(inputPath[0], playableStreamFileNames).ToArray(); - break; - } - } - break; - case VideoType.VideoFile: - { - if (isRemote) - { - type = InputType.Url; - } - break; - } + if (isoMount == null) + { + return GetPlayableStreamFiles(videoPath, playableStreamFileNames).ToArray(); + } + return GetPlayableStreamFiles(isoMount.MountedPath, playableStreamFileNames).ToArray(); } - return inputPath; + return new[] {videoPath}; } public static List GetPlayableStreamFiles(string rootPath, IEnumerable filenames) @@ -80,46 +47,6 @@ namespace MediaBrowser.Controller.MediaEncoding .ToList(); } - /// - /// Gets the type of the input. - /// - /// Type of the video. - /// Type of the iso. - /// InputType. - public static InputType GetInputType(VideoType? videoType, IsoType? isoType) - { - var type = InputType.File; - - if (videoType.HasValue) - { - switch (videoType.Value) - { - case VideoType.BluRay: - type = InputType.Bluray; - break; - case VideoType.Dvd: - type = InputType.Dvd; - break; - case VideoType.Iso: - if (isoType.HasValue) - { - switch (isoType.Value) - { - case IsoType.BluRay: - type = InputType.Bluray; - break; - case IsoType.Dvd: - type = InputType.Dvd; - break; - } - } - break; - } - } - - return type; - } - public static MediaInfo GetMediaInfo(InternalMediaInfoResult data) { var internalStreams = data.streams ?? new MediaStreamInfo[] { }; -- cgit v1.2.3