-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chore/deterministic-dotnet-builds
- Loading branch information
Showing
25 changed files
with
278 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Drawing; | ||
|
||
namespace FFMpegCore.Arguments | ||
{ | ||
public class CropArgument : IArgument | ||
{ | ||
public readonly Size? Size; | ||
public readonly int Top; | ||
public readonly int Left; | ||
|
||
public CropArgument(Size? size, int top, int left) | ||
{ | ||
Size = size; | ||
Top = top; | ||
Left = left; | ||
} | ||
|
||
public CropArgument(int width, int height, int top, int left) : this(new Size(width, height), top, left) { } | ||
|
||
public string Text => Size == null ? string.Empty : $"-vf crop={Size.Value.Width}:{Size.Value.Height}:{Left}:{Top}"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
namespace FFMpegCore.Arguments | ||
{ | ||
/// <summary> | ||
/// Represents input parameters for multiple files | ||
/// </summary> | ||
public class MultiInputArgument : IInputArgument | ||
{ | ||
public readonly bool VerifyExists; | ||
public readonly IEnumerable<string> FilePaths; | ||
|
||
public MultiInputArgument(bool verifyExists, IEnumerable<string> filePaths) | ||
{ | ||
VerifyExists = verifyExists; | ||
FilePaths = filePaths; | ||
} | ||
|
||
public MultiInputArgument(IEnumerable<string> filePaths, bool verifyExists) : this(verifyExists, filePaths) { } | ||
|
||
public void Pre() | ||
{ | ||
if (VerifyExists) | ||
{ | ||
var missingFiles = new List<string>(); | ||
foreach (var filePath in FilePaths) | ||
{ | ||
if (!File.Exists(filePath)) | ||
{ | ||
missingFiles.Add(filePath); | ||
} | ||
} | ||
|
||
if (missingFiles.Any()) | ||
{ | ||
throw new FileNotFoundException($"The following input files were not found: {string.Join(", ", missingFiles)}"); | ||
} | ||
} | ||
} | ||
|
||
public Task During(CancellationToken cancellationToken = default) => Task.CompletedTask; | ||
public void Post() { } | ||
|
||
/// <summary> | ||
/// Generates a combined input argument text for all file paths | ||
/// </summary> | ||
public string Text => string.Join(" ", FilePaths.Select(filePath => $"-i \"{filePath}\"")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.