From 4d4ea6e42c39c20a8d8b7767dcb1bd4dc00b1bb8 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 4 Jan 2014 22:50:29 -0500 Subject: [PATCH] updated ffmpeg --- MediaBrowser.Api/UserLibrary/ItemsService.cs | 12 +-- .../LiveTv/ILiveTvService.cs | 8 ++ .../LiveTv/LiveStreamInfo.cs | 6 ++ .../Web/QueryStringDictionary.cs | 33 ++++++++ MediaBrowser.Mono.userprefs | 3 +- .../MediaInfo/BaseFFProbeProvider.cs | 2 +- .../FFMpeg/FFMpegDownloadInfo.cs | 57 ------------- .../MediaBrowser.Server.Mono.csproj | 9 +- .../FFMpeg/FFMpegDownloadInfo.cs | 82 ++++++++++++++++--- .../MediaBrowser.WebDashboard.csproj | 9 ++ 10 files changed, 140 insertions(+), 81 deletions(-) delete mode 100644 MediaBrowser.Server.Mono/FFMpeg/FFMpegDownloadInfo.cs diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index a7f76b2f2..464f4ba1a 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -49,17 +49,17 @@ namespace MediaBrowser.Api.UserLibrary /// Limit results to items containing specific genres /// /// The genres. - [ApiMember(Name = "Genres", Description = "Optional. If specified, results will be filtered based on genre. This allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] + [ApiMember(Name = "Genres", Description = "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] public string Genres { get; set; } - [ApiMember(Name = "AllGenres", Description = "Optional. If specified, results will be filtered based on genre. This allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] + [ApiMember(Name = "AllGenres", Description = "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] public string AllGenres { get; set; } /// /// Limit results to items containing specific studios /// /// The studios. - [ApiMember(Name = "Studios", Description = "Optional. If specified, results will be filtered based on studio. This allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] + [ApiMember(Name = "Studios", Description = "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] public string Studios { get; set; } /// @@ -805,21 +805,21 @@ namespace MediaBrowser.Api.UserLibrary // Apply genre filter if (!string.IsNullOrEmpty(request.Genres)) { - var vals = request.Genres.Split(','); + var vals = request.Genres.Split('|'); items = items.Where(f => vals.Any(v => f.Genres.Contains(v, StringComparer.OrdinalIgnoreCase))); } // Apply genre filter if (!string.IsNullOrEmpty(request.AllGenres)) { - var vals = request.AllGenres.Split(','); + var vals = request.AllGenres.Split('|'); items = items.Where(f => vals.All(v => f.Genres.Contains(v, StringComparer.OrdinalIgnoreCase))); } // Apply studio filter if (!string.IsNullOrEmpty(request.Studios)) { - var vals = request.Studios.Split(','); + var vals = request.Studios.Split('|'); items = items.Where(f => vals.Any(v => f.Studios.Contains(v, StringComparer.OrdinalIgnoreCase))); } diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs index 491e8cbf8..1e535139c 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs @@ -154,5 +154,13 @@ namespace MediaBrowser.Controller.LiveTv /// The cancellation token. /// Task{Stream}. Task GetChannelStream(string channelId, CancellationToken cancellationToken); + + /// + /// Closes the live stream. + /// + /// The identifier. + /// The cancellation token. + /// Task. + Task CloseLiveStream(string id, CancellationToken cancellationToken); } } diff --git a/MediaBrowser.Controller/LiveTv/LiveStreamInfo.cs b/MediaBrowser.Controller/LiveTv/LiveStreamInfo.cs index ba480f685..8e1f94178 100644 --- a/MediaBrowser.Controller/LiveTv/LiveStreamInfo.cs +++ b/MediaBrowser.Controller/LiveTv/LiveStreamInfo.cs @@ -14,5 +14,11 @@ namespace MediaBrowser.Controller.LiveTv /// /// The URL. public string Url { get; set; } + + /// + /// Gets or sets the identifier. + /// + /// The identifier. + public string Id { get; set; } } } diff --git a/MediaBrowser.Model/Web/QueryStringDictionary.cs b/MediaBrowser.Model/Web/QueryStringDictionary.cs index f6c07c2f4..905fbb215 100644 --- a/MediaBrowser.Model/Web/QueryStringDictionary.cs +++ b/MediaBrowser.Model/Web/QueryStringDictionary.cs @@ -226,6 +226,39 @@ namespace MediaBrowser.Model.Web } } + /// + /// Adds the specified name. + /// + /// The name. + /// The value. + /// The delimiter. + /// value + public void Add(string name, IEnumerable value, string delimiter) + { + if (value == null) + { + throw new ArgumentNullException("value"); + } + + var paramValue = string.Join(delimiter, value.ToArray()); + + Add(name, paramValue); + } + + /// + /// Adds if not null. + /// + /// The name. + /// The value. + /// The delimiter. + public void AddIfNotNull(string name, IEnumerable value, string delimiter) + { + if (value != null) + { + Add(name, value, delimiter); + } + } + /// /// Gets the query string. /// diff --git a/MediaBrowser.Mono.userprefs b/MediaBrowser.Mono.userprefs index e5d5fa75e..6269e1b78 100644 --- a/MediaBrowser.Mono.userprefs +++ b/MediaBrowser.Mono.userprefs @@ -1,9 +1,8 @@  - + - diff --git a/MediaBrowser.Providers/MediaInfo/BaseFFProbeProvider.cs b/MediaBrowser.Providers/MediaInfo/BaseFFProbeProvider.cs index 0fdeddb49..31eae0c97 100644 --- a/MediaBrowser.Providers/MediaInfo/BaseFFProbeProvider.cs +++ b/MediaBrowser.Providers/MediaInfo/BaseFFProbeProvider.cs @@ -78,7 +78,7 @@ namespace MediaBrowser.Providers.MediaInfo { get { - return MediaEncoder.Version; + return "ffmpeg20131209"; } } diff --git a/MediaBrowser.Server.Mono/FFMpeg/FFMpegDownloadInfo.cs b/MediaBrowser.Server.Mono/FFMpeg/FFMpegDownloadInfo.cs deleted file mode 100644 index 7cb7278dc..000000000 --- a/MediaBrowser.Server.Mono/FFMpeg/FFMpegDownloadInfo.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; - -namespace MediaBrowser.ServerApplication.FFMpeg -{ - public static class FFMpegDownloadInfo - { - public static string Version = ffmpegOsType("Version"); - - public static string[] FfMpegUrls = ffmpegOsType("FfMpegUrls").Split(','); - - public static string FFMpegFilename = ffmpegOsType("FFMpegFilename"); - public static string FFProbeFilename = ffmpegOsType("FFProbeFilename"); - - public static string ArchiveType = ffmpegOsType("ArchiveType"); - - private static string ffmpegOsType(string arg) - { - OperatingSystem os = Environment.OSVersion; - PlatformID pid = os.Platform; - switch (pid) - { - case PlatformID.Win32NT: - switch (arg) - { - case "Version": - return "ffmpeg20131221"; - case "FfMpegUrls": - return "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20131221-git-70d6ce7-win32-static.7z,https://www.dropbox.com/s/d38uj7857trbw1g/ffmpeg-20131209-git-a12f679-win32-static.7z?dl=1"; - case "FFMpegFilename": - return "ffmpeg.exe"; - case "FFProbeFilename": - return "ffprobe.exe"; - case "ArchiveType": - return "7z"; - } - break; - case PlatformID.Unix: - case PlatformID.MacOSX: - switch (arg) - { - case "Version": - return "ffmpeg20131221"; - case "FfMpegUrls": - return "http://ffmpeg.gusari.org/static/32bit/ffmpeg.static.32bit.2013-12-21.tar.gz,https://www.dropbox.com/s/b9v17h105cps7p0/ffmpeg.static.32bit.2013-10-11.tar.gz?dl=1"; - case "FFMpegFilename": - return "ffmpeg"; - case "FFProbeFilename": - return "ffprobe"; - case "ArchiveType": - return "gz"; - } - break; - } - return ""; - } - } -} diff --git a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj index d37330821..cccc75c92 100644 --- a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj +++ b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj @@ -22,7 +22,6 @@ 4 x86 true - v4.5 full @@ -32,13 +31,11 @@ 4 x86 true - v4.5 false bin\Release 4 - v4.5 false @@ -50,7 +47,7 @@ ..\ThirdParty\ServiceStack\ServiceStack.Interfaces.dll - + @@ -78,11 +75,13 @@ FFMpeg\FFMpegDownloader.cs - EntryPoints\WanAddressEntryPoint.cs + + FFMpeg\FFMpegDownloadInfo.cs + diff --git a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs index fc50df216..596c9d234 100644 --- a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs +++ b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs @@ -1,19 +1,81 @@ - +using System; + namespace MediaBrowser.ServerApplication.FFMpeg { public static class FFMpegDownloadInfo { - public static string Version = "ffmpeg20131209"; + // Windows builds: http://ffmpeg.zeranoe.com/builds/ + // Linux builds: http://ffmpeg.gusari.org/static/ - public static string[] FfMpegUrls = new[] - { - "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20131209-git-a12f679-win32-static.7z", - "https://www.dropbox.com/s/d38uj7857trbw1g/ffmpeg-20131209-git-a12f679-win32-static.7z?dl=1" - }; + public static string Version = ffmpegOsType("Version"); - public static string FFMpegFilename = "ffmpeg.exe"; - public static string FFProbeFilename = "ffprobe.exe"; + public static string[] FfMpegUrls = GetDownloadUrls(); - public static string ArchiveType = "7z"; + public static string FFMpegFilename = ffmpegOsType("FFMpegFilename"); + public static string FFProbeFilename = ffmpegOsType("FFProbeFilename"); + + public static string ArchiveType = ffmpegOsType("ArchiveType"); + + private static string ffmpegOsType(string arg) + { + OperatingSystem os = Environment.OSVersion; + PlatformID pid = os.Platform; + switch (pid) + { + case PlatformID.Win32NT: + switch (arg) + { + case "Version": + return "20140105"; + case "FFMpegFilename": + return "ffmpeg.exe"; + case "FFProbeFilename": + return "ffprobe.exe"; + case "ArchiveType": + return "7z"; + } + break; + case PlatformID.Unix: + case PlatformID.MacOSX: + switch (arg) + { + case "Version": + return "20140104"; + case "FFMpegFilename": + return "ffmpeg"; + case "FFProbeFilename": + return "ffprobe"; + case "ArchiveType": + return "gz"; + } + break; + } + return ""; + } + + private static string[] GetDownloadUrls() + { + var pid = Environment.OSVersion.Platform; + + switch (pid) + { + case PlatformID.Win32NT: + return new[] + { + "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20140105-git-70937d9-win32-static.7z", + "https://www.dropbox.com/s/oghurnp5zh292ry/ffmpeg-20140105-git-70937d9-win32-static.7z?dl=1" + }; + + case PlatformID.Unix: + case PlatformID.MacOSX: + return new[] + { + "http://ffmpeg.gusari.org/static/32bit/ffmpeg.static.32bit.2014-01-04.tar.gz", + "https://www.dropbox.com/s/b7nkg71sil812hp/ffmpeg.static.32bit.2014-01-04.tar.gz?dl=1" + }; + } + + return new string[] {}; + } } } diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index e4a5ad047..52c578b97 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -91,6 +91,15 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + PreserveNewest