Reformatted to fix lint error

This commit is contained in:
Kerry Cao 2023-05-05 01:54:50 -06:00
parent a647f44029
commit 463fb9bf6b
2 changed files with 31 additions and 31 deletions

View file

@ -20,7 +20,7 @@ public void GetLatestSuiteTest()
Assert.Inconclusive("This test is only for Windows"); Assert.Inconclusive("This test is only for Windows");
} }
} }
[TestMethod] [TestMethod]
public void GetLatestFFMpegTest() public void GetLatestFFMpegTest()
{ {
@ -34,7 +34,7 @@ public void GetLatestFFMpegTest()
Assert.Inconclusive("This test is only for Windows"); Assert.Inconclusive("This test is only for Windows");
} }
} }
[TestMethod] [TestMethod]
public void GetLatestFFProbeTest() public void GetLatestFFProbeTest()
{ {
@ -48,7 +48,7 @@ public void GetLatestFFProbeTest()
Assert.Inconclusive("This test is only for Windows"); Assert.Inconclusive("This test is only for Windows");
} }
} }
[TestMethod] [TestMethod]
public void GetLatestFFPlayTest() public void GetLatestFFPlayTest()
{ {

View file

@ -1,14 +1,29 @@
using System.Net; using System.IO.Compression;
using System.IO.Compression; using System.Net;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace FFMpegCore.Helpers; namespace FFMpegCore.Helpers;
/// <summary> /// <summary>
/// Downloads the latest FFMpeg suite binaries from GitHub. Only supported for windows at the moment. /// Downloads the latest FFMpeg suite binaries from GitHub. Only supported for windows at the moment.
/// </summary> /// </summary>
public class FFMpegDownloader public class FFMpegDownloader
{ {
/// <summary>
/// Supported FFMpeg versions
/// </summary>
public enum FFMpegVersions
{
V4_4_1,
V4_2_1,
V4_2,
V4_1,
V4_0,
V3_4,
V3_3,
V3_2
}
private static readonly Dictionary<FFMpegVersions, string> Windows64FFMpegDownloadUrls = new() private static readonly Dictionary<FFMpegVersions, string> Windows64FFMpegDownloadUrls = new()
{ {
{ {
@ -42,7 +57,7 @@ public class FFMpegDownloader
{ {
FFMpegVersions.V3_2, FFMpegVersions.V3_2,
"https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v3.2/ffmpeg-3.2-win-64.zip" "https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v3.2/ffmpeg-3.2-win-64.zip"
}, }
}; };
private static readonly Dictionary<FFMpegVersions, string> Windows32FFMpegDownloadUrls = new() private static readonly Dictionary<FFMpegVersions, string> Windows32FFMpegDownloadUrls = new()
@ -75,26 +90,11 @@ public class FFMpegDownloader
{ {
FFMpegVersions.V3_2, FFMpegVersions.V3_2,
"https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v3.2/ffmpeg-3.2-win-32.zip" "https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v3.2/ffmpeg-3.2-win-32.zip"
}, }
}; };
/// <summary> /// <summary>
/// Supported FFMpeg versions /// Downloads the latest FFMpeg suite binaries to bin directory.
/// </summary>
public enum FFMpegVersions
{
V4_4_1,
V4_2_1,
V4_2,
V4_1,
V4_0,
V3_4,
V3_3,
V3_2
}
/// <summary>
/// Downloads the latest FFMpeg suite binaries to bin directory.
/// </summary> /// </summary>
/// <param name="version"></param> /// <param name="version"></param>
/// <returns>Names of the binary that was saved to bin directory</returns> /// <returns>Names of the binary that was saved to bin directory</returns>
@ -108,7 +108,7 @@ public static List<string> DownloadFFMpegSuite(FFMpegVersions version = FFMpegVe
} }
/// <summary> /// <summary>
/// Downloads the latest FFMpeg binaries to bin directory. /// Downloads the latest FFMpeg binaries to bin directory.
/// </summary> /// </summary>
/// <param name="version"></param> /// <param name="version"></param>
/// <returns></returns> /// <returns></returns>
@ -122,7 +122,7 @@ public static List<string> DownloadFFMpeg(FFMpegVersions version = FFMpegVersion
} }
/// <summary> /// <summary>
/// Downloads the latest FFProbe binaries to bin directory. /// Downloads the latest FFProbe binaries to bin directory.
/// </summary> /// </summary>
/// <param name="version"></param> /// <param name="version"></param>
/// <returns></returns> /// <returns></returns>
@ -136,7 +136,7 @@ public static List<string> DownloadFFProbe(FFMpegVersions version = FFMpegVersio
} }
/// <summary> /// <summary>
/// Downloads the latest FFPlay binaries to bin directory. /// Downloads the latest FFPlay binaries to bin directory.
/// </summary> /// </summary>
/// <param name="version"></param> /// <param name="version"></param>
/// <returns></returns> /// <returns></returns>
@ -150,7 +150,7 @@ public static List<string> DownloadFFPlay(FFMpegVersions version = FFMpegVersion
} }
/// <summary> /// <summary>
/// Downloads the zip file from the given url and saves the binaries to bin directory. /// Downloads the zip file from the given url and saves the binaries to bin directory.
/// </summary> /// </summary>
/// <param name="url"></param> /// <param name="url"></param>
/// <returns></returns> /// <returns></returns>
@ -164,7 +164,7 @@ private static List<string> DownloadAndSave(Uri url)
} }
/// <summary> /// <summary>
/// Downloads the zip file from the given url. /// Downloads the zip file from the given url.
/// </summary> /// </summary>
/// <param name="address"></param> /// <param name="address"></param>
/// <returns></returns> /// <returns></returns>
@ -178,7 +178,7 @@ private static MemoryStream DownloadZip(Uri address)
} }
/// <summary> /// <summary>
/// Extracts the zip file and saves the binaries to bin directory. /// Extracts the zip file and saves the binaries to bin directory.
/// </summary> /// </summary>
/// <param name="zipStream"></param> /// <param name="zipStream"></param>
/// <returns></returns> /// <returns></returns>
@ -200,7 +200,7 @@ private static List<string> ExtractZip(Stream zipStream)
} }
/// <summary> /// <summary>
/// Checks if the given uri is valid. /// Checks if the given uri is valid.
/// </summary> /// </summary>
/// <param name="uri"></param> /// <param name="uri"></param>
/// <exception cref="PlatformNotSupportedException"></exception> /// <exception cref="PlatformNotSupportedException"></exception>