updated ffmpeg

This commit is contained in:
Luke Pulverenti 2014-01-04 22:50:29 -05:00
parent 2788d8d201
commit 4d4ea6e42c
10 changed files with 140 additions and 81 deletions

View File

@ -49,17 +49,17 @@ namespace MediaBrowser.Api.UserLibrary
/// Limit results to items containing specific genres
/// </summary>
/// <value>The genres.</value>
[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; }
/// <summary>
/// Limit results to items containing specific studios
/// </summary>
/// <value>The studios.</value>
[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; }
/// <summary>
@ -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)));
}

View File

@ -154,5 +154,13 @@ namespace MediaBrowser.Controller.LiveTv
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{Stream}.</returns>
Task<LiveStreamInfo> GetChannelStream(string channelId, CancellationToken cancellationToken);
/// <summary>
/// Closes the live stream.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task CloseLiveStream(string id, CancellationToken cancellationToken);
}
}

View File

@ -14,5 +14,11 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary>
/// <value>The URL.</value>
public string Url { get; set; }
/// <summary>
/// Gets or sets the identifier.
/// </summary>
/// <value>The identifier.</value>
public string Id { get; set; }
}
}

View File

@ -226,6 +226,39 @@ namespace MediaBrowser.Model.Web
}
}
/// <summary>
/// Adds the specified name.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
/// <param name="delimiter">The delimiter.</param>
/// <exception cref="System.ArgumentNullException">value</exception>
public void Add(string name, IEnumerable<string> value, string delimiter)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
var paramValue = string.Join(delimiter, value.ToArray());
Add(name, paramValue);
}
/// <summary>
/// Adds if not null.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
/// <param name="delimiter">The delimiter.</param>
public void AddIfNotNull(string name, IEnumerable<string> value, string delimiter)
{
if (value != null)
{
Add(name, value, delimiter);
}
}
/// <summary>
/// Gets the query string.
/// </summary>

View File

@ -1,9 +1,8 @@
<Properties>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Release Mono" />
<MonoDevelop.Ide.Workbench ActiveDocument="MediaBrowser.Server.Mono\Networking\NetworkManager.cs">
<MonoDevelop.Ide.Workbench ActiveDocument="MediaBrowser.Server.Mono\app.config">
<Files>
<File FileName="MediaBrowser.Server.Mono\app.config" Line="1" Column="1" />
<File FileName="MediaBrowser.Server.Mono\Networking\NetworkManager.cs" Line="7" Column="26" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>

View File

@ -78,7 +78,7 @@ namespace MediaBrowser.Providers.MediaInfo
{
get
{
return MediaEncoder.Version;
return "ffmpeg20131209";
}
}

View File

@ -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 "";
}
}
}

View File

@ -22,7 +22,6 @@
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<Externalconsole>true</Externalconsole>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>full</DebugType>
@ -32,13 +31,11 @@
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<Externalconsole>true</Externalconsole>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<WarningLevel>4</WarningLevel>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release Mono|AnyCPU' ">
<Optimize>false</Optimize>
@ -50,7 +47,7 @@
<Reference Include="ServiceStack.Interfaces">
<HintPath>..\ThirdParty\ServiceStack\ServiceStack.Interfaces.dll</HintPath>
</Reference>
<Reference Include="Mono.Posix" Condition=" '$(ConfigurationName)' == 'Release Mono' "/>
<Reference Include="Mono.Posix" Condition=" '$(ConfigurationName)' == 'Release Mono' " />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SharedVersion.cs">
@ -78,11 +75,13 @@
<Compile Include="..\MediaBrowser.ServerApplication\FFMpeg\FFMpegDownloader.cs">
<Link>FFMpeg\FFMpegDownloader.cs</Link>
</Compile>
<Compile Include="FFMpeg\FFMpegDownloadInfo.cs" />
<Compile Include="IO\FileSystemFactory.cs" />
<Compile Include="..\MediaBrowser.ServerApplication\EntryPoints\WanAddressEntryPoint.cs">
<Link>EntryPoints\WanAddressEntryPoint.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.ServerApplication\FFMpeg\FFMpegDownloadInfo.cs">
<Link>FFMpeg\FFMpegDownloadInfo.cs</Link>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>

View File

@ -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[] {};
}
}
}

View File

@ -91,6 +91,15 @@
<Content Include="dashboard-ui\css\icons.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\css\images\clients\amazon.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\css\images\clients\mediaportal.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\css\images\clients\playstore.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\css\images\clients\xbmc.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>