From 820b4873fb669b5a273817d68f3fbfc216b6610e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 4 Jun 2017 16:28:27 -0400 Subject: move methods to base class --- MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs | 242 --------------------- .../Encoder/EncodingJobFactory.cs | 1 - MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 7 +- 3 files changed, 1 insertion(+), 249 deletions(-) (limited to 'MediaBrowser.MediaEncoding') diff --git a/MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs b/MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs index 97623c44b..d53701feb 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs @@ -150,248 +150,6 @@ namespace MediaBrowser.MediaEncoding.Encoder } } - public int? TotalOutputBitrate - { - get - { - return (OutputAudioBitrate ?? 0) + (OutputVideoBitrate ?? 0); - } - } - - public int? OutputWidth - { - get - { - if (VideoStream != null && VideoStream.Width.HasValue && VideoStream.Height.HasValue) - { - var size = new ImageSize - { - Width = VideoStream.Width.Value, - Height = VideoStream.Height.Value - }; - - var newSize = DrawingUtils.Resize(size, - Options.Width, - Options.Height, - Options.MaxWidth, - Options.MaxHeight); - - return Convert.ToInt32(newSize.Width); - } - - if (!IsVideoRequest) - { - return null; - } - - return Options.MaxWidth ?? Options.Width; - } - } - - public int? OutputHeight - { - get - { - if (VideoStream != null && VideoStream.Width.HasValue && VideoStream.Height.HasValue) - { - var size = new ImageSize - { - Width = VideoStream.Width.Value, - Height = VideoStream.Height.Value - }; - - var newSize = DrawingUtils.Resize(size, - Options.Width, - Options.Height, - Options.MaxWidth, - Options.MaxHeight); - - return Convert.ToInt32(newSize.Height); - } - - if (!IsVideoRequest) - { - return null; - } - - return Options.MaxHeight ?? Options.Height; - } - } - - /// - /// Predicts the audio sample rate that will be in the output stream - /// - public int? TargetVideoBitDepth - { - get - { - var stream = VideoStream; - return stream == null || !Options.Static ? null : stream.BitDepth; - } - } - - /// - /// Gets the target reference frames. - /// - /// The target reference frames. - public int? TargetRefFrames - { - get - { - var stream = VideoStream; - return stream == null || !Options.Static ? null : stream.RefFrames; - } - } - - /// - /// Predicts the audio sample rate that will be in the output stream - /// - public float? TargetFramerate - { - get - { - var stream = VideoStream; - var requestedFramerate = Options.MaxFramerate ?? Options.Framerate; - - return requestedFramerate.HasValue && !Options.Static - ? requestedFramerate - : stream == null ? null : stream.AverageFrameRate ?? stream.RealFrameRate; - } - } - - public TransportStreamTimestamp TargetTimestamp - { - get - { - var defaultValue = string.Equals(OutputContainer, "m2ts", StringComparison.OrdinalIgnoreCase) ? - TransportStreamTimestamp.Valid : - TransportStreamTimestamp.None; - - return !Options.Static - ? defaultValue - : InputTimestamp; - } - } - - /// - /// Predicts the audio sample rate that will be in the output stream - /// - public int? TargetPacketLength - { - get - { - var stream = VideoStream; - return !Options.Static - ? null - : stream == null ? null : stream.PacketLength; - } - } - - /// - /// Predicts the audio sample rate that will be in the output stream - /// - public string TargetVideoProfile - { - get - { - var stream = VideoStream; - return !string.IsNullOrEmpty(Options.Profile) && !Options.Static - ? Options.Profile - : stream == null ? null : stream.Profile; - } - } - - public string TargetVideoCodecTag - { - get - { - var stream = VideoStream; - return !Options.Static - ? null - : stream == null ? null : stream.CodecTag; - } - } - - public bool? IsTargetAnamorphic - { - get - { - if (Options.Static) - { - return VideoStream == null ? null : VideoStream.IsAnamorphic; - } - - return false; - } - } - - public bool? IsTargetInterlaced - { - get - { - if (Options.Static) - { - return VideoStream == null ? (bool?)null : VideoStream.IsInterlaced; - } - - if (DeInterlace) - { - return false; - } - - return VideoStream == null ? (bool?)null : VideoStream.IsInterlaced; - } - } - - public bool? IsTargetAVC - { - get - { - if (Options.Static) - { - return VideoStream == null ? null : VideoStream.IsAVC; - } - - return false; - } - } - - public int? TargetVideoStreamCount - { - get - { - if (Options.Static) - { - return GetMediaStreamCount(MediaStreamType.Video, int.MaxValue); - } - return GetMediaStreamCount(MediaStreamType.Video, 1); - } - } - - public int? TargetAudioStreamCount - { - get - { - if (Options.Static) - { - return GetMediaStreamCount(MediaStreamType.Audio, int.MaxValue); - } - return GetMediaStreamCount(MediaStreamType.Audio, 1); - } - } - - private int? GetMediaStreamCount(MediaStreamType type, int limit) - { - var count = MediaSource.GetStreamCount(type); - - if (count.HasValue) - { - count = Math.Min(count.Value, limit); - } - - return count; - } - public override void ReportTranscodingProgress(TimeSpan? transcodingPosition, float? framerate, double? percentComplete, long? bytesTranscoded, int? bitRate) { var ticks = transcodingPosition.HasValue ? transcodingPosition.Value.Ticks : (long?)null; diff --git a/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs b/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs index c74a8ce37..ba5f625f5 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs @@ -105,7 +105,6 @@ namespace MediaBrowser.MediaEncoding.Encoder //state.OutputContainer = (container ?? string.Empty).TrimStart('.'); state.OutputAudioBitrate = encodingHelper.GetAudioBitrateParam(state.Options, state.AudioStream); - state.OutputAudioSampleRate = request.AudioSampleRate; state.OutputAudioCodec = state.Options.AudioCodec; diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index 280b01ee2..faf5b0667 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -80,11 +80,6 @@ namespace MediaBrowser.MediaEncoding.Encoder int defaultImageExtractionTimeoutMs, bool enableEncoderFontFile, IEnvironmentInfo environmentInfo) { - if (jsonSerializer == null) - { - throw new ArgumentNullException("jsonSerializer"); - } - _logger = logger; _jsonSerializer = jsonSerializer; ConfigurationManager = configurationManager; @@ -330,7 +325,7 @@ namespace MediaBrowser.MediaEncoding.Encoder } var newPaths = GetEncoderPaths(appPath); - if (string.IsNullOrWhiteSpace(newPaths.Item1) || string.IsNullOrWhiteSpace(newPaths.Item2)) + if (string.IsNullOrWhiteSpace(newPaths.Item1) || string.IsNullOrWhiteSpace(newPaths.Item2) || IsSystemInstalledPath(appPath)) { newPaths = TestForInstalledVersions(); } -- cgit v1.2.3 From 42d0b070b48c9be4e11d3913d48d50f634cfd078 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 4 Jun 2017 17:08:56 -0400 Subject: update project files --- BDInfo/BDInfo.csproj | 4 ---- BDInfo/project.json | 17 ----------------- DvdLib/DvdLib.csproj | 4 ---- DvdLib/project.json | 17 ----------------- Emby.Dlna/project.json | 17 ----------------- Emby.Drawing/project.json | 17 ----------------- Emby.Photos/project.json | 17 ----------------- MediaBrowser.Api/Playback/MediaInfoService.cs | 13 +++++++++++++ MediaBrowser.Api/project.json | 17 ----------------- MediaBrowser.Common/MediaBrowser.Common.csproj | 3 --- MediaBrowser.Common/project.json | 17 ----------------- MediaBrowser.Controller/MediaBrowser.Controller.csproj | 4 ---- MediaBrowser.Controller/project.json | 17 ----------------- .../Images/EpisodeLocalImageProvider.cs | 2 +- MediaBrowser.LocalMetadata/project.json | 17 ----------------- MediaBrowser.MediaEncoding/project.json | 17 ----------------- MediaBrowser.Model/MediaBrowser.Model.csproj | 4 ---- MediaBrowser.Model/project.json | 17 ----------------- MediaBrowser.Providers/project.json | 17 ----------------- MediaBrowser.Server.Implementations/project.json | 17 ----------------- MediaBrowser.WebDashboard/project.json | 17 ----------------- MediaBrowser.XbmcMetadata/project.json | 17 ----------------- OpenSubtitlesHandler/OpenSubtitlesHandler.csproj | 3 --- OpenSubtitlesHandler/project.json | 17 ----------------- RSSDP/project.json | 17 ----------------- 25 files changed, 14 insertions(+), 312 deletions(-) delete mode 100644 BDInfo/project.json delete mode 100644 DvdLib/project.json delete mode 100644 Emby.Dlna/project.json delete mode 100644 Emby.Drawing/project.json delete mode 100644 Emby.Photos/project.json delete mode 100644 MediaBrowser.Api/project.json delete mode 100644 MediaBrowser.Common/project.json delete mode 100644 MediaBrowser.Controller/project.json delete mode 100644 MediaBrowser.LocalMetadata/project.json delete mode 100644 MediaBrowser.MediaEncoding/project.json delete mode 100644 MediaBrowser.Model/project.json delete mode 100644 MediaBrowser.Providers/project.json delete mode 100644 MediaBrowser.Server.Implementations/project.json delete mode 100644 MediaBrowser.WebDashboard/project.json delete mode 100644 MediaBrowser.XbmcMetadata/project.json delete mode 100644 OpenSubtitlesHandler/project.json delete mode 100644 RSSDP/project.json (limited to 'MediaBrowser.MediaEncoding') diff --git a/BDInfo/BDInfo.csproj b/BDInfo/BDInfo.csproj index e7013f341..97abe7484 100644 --- a/BDInfo/BDInfo.csproj +++ b/BDInfo/BDInfo.csproj @@ -33,10 +33,6 @@ prompt 4 - - - - diff --git a/BDInfo/project.json b/BDInfo/project.json deleted file mode 100644 index fbbe9eaf3..000000000 --- a/BDInfo/project.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "frameworks":{ - "netstandard1.6":{ - "dependencies":{ - "NETStandard.Library":"1.6.0", - } - }, - ".NETPortable,Version=v4.5,Profile=Profile7":{ - "buildOptions": { - "define": [ ] - }, - "frameworkAssemblies":{ - - } - } - } -} \ No newline at end of file diff --git a/DvdLib/DvdLib.csproj b/DvdLib/DvdLib.csproj index ba63e77f0..9ed197c59 100644 --- a/DvdLib/DvdLib.csproj +++ b/DvdLib/DvdLib.csproj @@ -33,10 +33,6 @@ prompt 4 - - - - diff --git a/DvdLib/project.json b/DvdLib/project.json deleted file mode 100644 index fbbe9eaf3..000000000 --- a/DvdLib/project.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "frameworks":{ - "netstandard1.6":{ - "dependencies":{ - "NETStandard.Library":"1.6.0", - } - }, - ".NETPortable,Version=v4.5,Profile=Profile7":{ - "buildOptions": { - "define": [ ] - }, - "frameworkAssemblies":{ - - } - } - } -} \ No newline at end of file diff --git a/Emby.Dlna/project.json b/Emby.Dlna/project.json deleted file mode 100644 index fbbe9eaf3..000000000 --- a/Emby.Dlna/project.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "frameworks":{ - "netstandard1.6":{ - "dependencies":{ - "NETStandard.Library":"1.6.0", - } - }, - ".NETPortable,Version=v4.5,Profile=Profile7":{ - "buildOptions": { - "define": [ ] - }, - "frameworkAssemblies":{ - - } - } - } -} \ No newline at end of file diff --git a/Emby.Drawing/project.json b/Emby.Drawing/project.json deleted file mode 100644 index fbbe9eaf3..000000000 --- a/Emby.Drawing/project.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "frameworks":{ - "netstandard1.6":{ - "dependencies":{ - "NETStandard.Library":"1.6.0", - } - }, - ".NETPortable,Version=v4.5,Profile=Profile7":{ - "buildOptions": { - "define": [ ] - }, - "frameworkAssemblies":{ - - } - } - } -} \ No newline at end of file diff --git a/Emby.Photos/project.json b/Emby.Photos/project.json deleted file mode 100644 index fbbe9eaf3..000000000 --- a/Emby.Photos/project.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "frameworks":{ - "netstandard1.6":{ - "dependencies":{ - "NETStandard.Library":"1.6.0", - } - }, - ".NETPortable,Version=v4.5,Profile=Profile7":{ - "buildOptions": { - "define": [ ] - }, - "frameworkAssemblies":{ - - } - } - } -} \ No newline at end of file diff --git a/MediaBrowser.Api/Playback/MediaInfoService.cs b/MediaBrowser.Api/Playback/MediaInfoService.cs index 911d92555..bba8094b6 100644 --- a/MediaBrowser.Api/Playback/MediaInfoService.cs +++ b/MediaBrowser.Api/Playback/MediaInfoService.cs @@ -357,6 +357,19 @@ namespace MediaBrowser.Api.Playback mediaSource.SupportsTranscoding = false; } + if (item is Audio) + { + Logger.Info("User policy for {0}. EnableAudioPlaybackTranscoding: {1}", user.Name, user.Policy.EnableAudioPlaybackTranscoding); + } + else + { + Logger.Info("User policy for {0}. EnablePlaybackRemuxing: {1} EnableVideoPlaybackTranscoding: {2} EnableAudioPlaybackTranscoding: {3}", + user.Name, + user.Policy.EnablePlaybackRemuxing, + user.Policy.EnableVideoPlaybackTranscoding, + user.Policy.EnableAudioPlaybackTranscoding); + } + if (mediaSource.SupportsDirectPlay) { if (mediaSource.IsRemote && forceDirectPlayRemoteMediaSource) diff --git a/MediaBrowser.Api/project.json b/MediaBrowser.Api/project.json deleted file mode 100644 index fbbe9eaf3..000000000 --- a/MediaBrowser.Api/project.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "frameworks":{ - "netstandard1.6":{ - "dependencies":{ - "NETStandard.Library":"1.6.0", - } - }, - ".NETPortable,Version=v4.5,Profile=Profile7":{ - "buildOptions": { - "define": [ ] - }, - "frameworkAssemblies":{ - - } - } - } -} \ No newline at end of file diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csproj index b24975dba..d561b634e 100644 --- a/MediaBrowser.Common/MediaBrowser.Common.csproj +++ b/MediaBrowser.Common/MediaBrowser.Common.csproj @@ -72,9 +72,6 @@ MediaBrowser.Model - - - diff --git a/MediaBrowser.Common/project.json b/MediaBrowser.Common/project.json deleted file mode 100644 index fbbe9eaf3..000000000 --- a/MediaBrowser.Common/project.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "frameworks":{ - "netstandard1.6":{ - "dependencies":{ - "NETStandard.Library":"1.6.0", - } - }, - ".NETPortable,Version=v4.5,Profile=Profile7":{ - "buildOptions": { - "define": [ ] - }, - "frameworkAssemblies":{ - - } - } - } -} \ No newline at end of file diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index e15b58e77..348cfd343 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -36,10 +36,6 @@ Always - - - - Properties\SharedVersion.cs diff --git a/MediaBrowser.Controller/project.json b/MediaBrowser.Controller/project.json deleted file mode 100644 index fbbe9eaf3..000000000 --- a/MediaBrowser.Controller/project.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "frameworks":{ - "netstandard1.6":{ - "dependencies":{ - "NETStandard.Library":"1.6.0", - } - }, - ".NETPortable,Version=v4.5,Profile=Profile7":{ - "buildOptions": { - "define": [ ] - }, - "frameworkAssemblies":{ - - } - } - } -} \ No newline at end of file diff --git a/MediaBrowser.LocalMetadata/Images/EpisodeLocalImageProvider.cs b/MediaBrowser.LocalMetadata/Images/EpisodeLocalImageProvider.cs index 033c38420..2b5858aec 100644 --- a/MediaBrowser.LocalMetadata/Images/EpisodeLocalImageProvider.cs +++ b/MediaBrowser.LocalMetadata/Images/EpisodeLocalImageProvider.cs @@ -40,7 +40,7 @@ namespace MediaBrowser.LocalMetadata.Images { var parentPath = _fileSystem.GetDirectoryName(item.Path); - var parentPathFiles = directoryService.GetFileSystemEntries(parentPath) + var parentPathFiles = directoryService.GetFiles(parentPath) .ToList(); var nameWithoutExtension = _fileSystem.GetFileNameWithoutExtension(item.Path); diff --git a/MediaBrowser.LocalMetadata/project.json b/MediaBrowser.LocalMetadata/project.json deleted file mode 100644 index fbbe9eaf3..000000000 --- a/MediaBrowser.LocalMetadata/project.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "frameworks":{ - "netstandard1.6":{ - "dependencies":{ - "NETStandard.Library":"1.6.0", - } - }, - ".NETPortable,Version=v4.5,Profile=Profile7":{ - "buildOptions": { - "define": [ ] - }, - "frameworkAssemblies":{ - - } - } - } -} \ No newline at end of file diff --git a/MediaBrowser.MediaEncoding/project.json b/MediaBrowser.MediaEncoding/project.json deleted file mode 100644 index fbbe9eaf3..000000000 --- a/MediaBrowser.MediaEncoding/project.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "frameworks":{ - "netstandard1.6":{ - "dependencies":{ - "NETStandard.Library":"1.6.0", - } - }, - ".NETPortable,Version=v4.5,Profile=Profile7":{ - "buildOptions": { - "define": [ ] - }, - "frameworkAssemblies":{ - - } - } - } -} \ No newline at end of file diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index 67a04c5a1..354fd38ea 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -33,10 +33,6 @@ prompt 4 - - - - Properties\SharedVersion.cs diff --git a/MediaBrowser.Model/project.json b/MediaBrowser.Model/project.json deleted file mode 100644 index fbbe9eaf3..000000000 --- a/MediaBrowser.Model/project.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "frameworks":{ - "netstandard1.6":{ - "dependencies":{ - "NETStandard.Library":"1.6.0", - } - }, - ".NETPortable,Version=v4.5,Profile=Profile7":{ - "buildOptions": { - "define": [ ] - }, - "frameworkAssemblies":{ - - } - } - } -} \ No newline at end of file diff --git a/MediaBrowser.Providers/project.json b/MediaBrowser.Providers/project.json deleted file mode 100644 index fbbe9eaf3..000000000 --- a/MediaBrowser.Providers/project.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "frameworks":{ - "netstandard1.6":{ - "dependencies":{ - "NETStandard.Library":"1.6.0", - } - }, - ".NETPortable,Version=v4.5,Profile=Profile7":{ - "buildOptions": { - "define": [ ] - }, - "frameworkAssemblies":{ - - } - } - } -} \ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/project.json b/MediaBrowser.Server.Implementations/project.json deleted file mode 100644 index fbbe9eaf3..000000000 --- a/MediaBrowser.Server.Implementations/project.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "frameworks":{ - "netstandard1.6":{ - "dependencies":{ - "NETStandard.Library":"1.6.0", - } - }, - ".NETPortable,Version=v4.5,Profile=Profile7":{ - "buildOptions": { - "define": [ ] - }, - "frameworkAssemblies":{ - - } - } - } -} \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/project.json b/MediaBrowser.WebDashboard/project.json deleted file mode 100644 index fbbe9eaf3..000000000 --- a/MediaBrowser.WebDashboard/project.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "frameworks":{ - "netstandard1.6":{ - "dependencies":{ - "NETStandard.Library":"1.6.0", - } - }, - ".NETPortable,Version=v4.5,Profile=Profile7":{ - "buildOptions": { - "define": [ ] - }, - "frameworkAssemblies":{ - - } - } - } -} \ No newline at end of file diff --git a/MediaBrowser.XbmcMetadata/project.json b/MediaBrowser.XbmcMetadata/project.json deleted file mode 100644 index fbbe9eaf3..000000000 --- a/MediaBrowser.XbmcMetadata/project.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "frameworks":{ - "netstandard1.6":{ - "dependencies":{ - "NETStandard.Library":"1.6.0", - } - }, - ".NETPortable,Version=v4.5,Profile=Profile7":{ - "buildOptions": { - "define": [ ] - }, - "frameworkAssemblies":{ - - } - } - } -} \ No newline at end of file diff --git a/OpenSubtitlesHandler/OpenSubtitlesHandler.csproj b/OpenSubtitlesHandler/OpenSubtitlesHandler.csproj index e54683027..d70f72962 100644 --- a/OpenSubtitlesHandler/OpenSubtitlesHandler.csproj +++ b/OpenSubtitlesHandler/OpenSubtitlesHandler.csproj @@ -107,9 +107,6 @@ - - -