From c8a106f485ff7e340ee8ca67adac3351ec6a31b6 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 12 Jan 2014 01:31:21 -0500 Subject: move media encoder to server project --- .../MediaInfo/MediaEncoderHelpers.cs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'MediaBrowser.Controller/MediaInfo/MediaEncoderHelpers.cs') diff --git a/MediaBrowser.Controller/MediaInfo/MediaEncoderHelpers.cs b/MediaBrowser.Controller/MediaInfo/MediaEncoderHelpers.cs index 261454f6d..300071b7b 100644 --- a/MediaBrowser.Controller/MediaInfo/MediaEncoderHelpers.cs +++ b/MediaBrowser.Controller/MediaInfo/MediaEncoderHelpers.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; -using MediaBrowser.Common.MediaInfo; using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; @@ -29,7 +28,7 @@ namespace MediaBrowser.Controller.MediaInfo { var inputPath = isoMount == null ? new[] { videoPath } : new[] { isoMount.MountedPath }; - type = InputType.VideoFile; + type = InputType.File; switch (videoType) { @@ -87,7 +86,7 @@ namespace MediaBrowser.Controller.MediaInfo /// InputType. public static InputType GetInputType(VideoType? videoType, IsoType? isoType) { - var type = InputType.AudioFile; + var type = InputType.File; if (videoType.HasValue) { @@ -119,12 +118,22 @@ namespace MediaBrowser.Controller.MediaInfo return type; } - public static IEnumerable GetMediaStreams(MediaInfoResult data) + public static Model.Entities.MediaInfo GetMediaInfo(InternalMediaInfoResult data) { var internalStreams = data.streams ?? new MediaStreamInfo[] { }; - return internalStreams.Select(s => GetMediaStream(s, data.format)) - .Where(i => i != null); + var info = new Model.Entities.MediaInfo(); + + info.MediaStreams = internalStreams.Select(s => GetMediaStream(s, data.format)) + .Where(i => i != null) + .ToList(); + + if (data.format != null) + { + info.Format = data.format.format_name; + } + + return info; } private static readonly CultureInfo UsCulture = new CultureInfo("en-US"); -- cgit v1.2.3