コミットを比較
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
|
|
bf6de65f3c
|
||
|
|
4f2e566ab8
|
||
|
|
9352e8e2c3
|
||
|
|
c377663165
|
検索条件に一致するファイルはありません
@@ -1,5 +1,5 @@
|
||||
========================================
|
||||
ProxyForge for YMM4 v2.0.0
|
||||
ProxyForge for YMM4 v2.0.1
|
||||
========================================
|
||||
YukkuriMovieMaker4(YMM4)上で動作する、編集の間だけ使う解像度の低い
|
||||
動画ファイルを作り、プレビューでは元の動画の代わりにそれを読み込む
|
||||
|
||||
@@ -187,6 +187,20 @@ public sealed class ProxyEncoderTests
|
||||
Assert.False(File.Exists(workspace.OutputPath));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AnOutputThatCannotBeOpenedIsReportedAsAnFFmpegFailure()
|
||||
{
|
||||
Ymm4TestEnvironment.Require();
|
||||
using var workspace = new Workspace();
|
||||
var encoder = workspace.CreateEncoder(640, 360, 30, 1, 10);
|
||||
using var session = await encoder.OpenAsync(workspace.Request(50), TestContext.Current.CancellationToken);
|
||||
var missing = Path.Combine(workspace.Path, "missing", "proxy.mp4");
|
||||
|
||||
var exception = await Assert.ThrowsAsync<ProxyEncodeException>(() => session.EncodeAsync(0, 10, missing, null, TestContext.Current.CancellationToken));
|
||||
|
||||
Assert.Equal(ProxyEncodeFailure.FFmpegFailed, exception.Failure);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ASoftEdgeIsNotMistakenForTransparency()
|
||||
{
|
||||
@@ -474,6 +488,44 @@ public sealed class ProxyEncoderTests
|
||||
Assert.IsType<IOException>(failure.InnerException);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task RunAsyncReportsTheExitOfFFmpegThatStoppedReadingTheInput()
|
||||
{
|
||||
Ymm4TestEnvironment.Require();
|
||||
using var workspace = new Workspace();
|
||||
var missing = Path.Combine(workspace.Path, "missing", "proxy.mp4");
|
||||
Exception? failure = null;
|
||||
|
||||
var result = await FFmpegProcessRunner.RunAsync(
|
||||
Ymm4TestEnvironment.FFmpegPath,
|
||||
arguments =>
|
||||
{
|
||||
var request = new FFmpegEncodeRequest(missing, 32, 32, new FrameRate(30, 1), 100_000, 1, SoftwareEncoder);
|
||||
FFmpegArguments.WriteEncode(arguments, in request);
|
||||
},
|
||||
workspace.Path,
|
||||
(destination, cancellationToken) => Task.Run(() =>
|
||||
{
|
||||
var frame = new byte[32 * 32 * 4];
|
||||
try
|
||||
{
|
||||
for (var index = 0; index < 1024; index++)
|
||||
destination.Write(frame);
|
||||
}
|
||||
catch (IOException exception)
|
||||
{
|
||||
failure = exception;
|
||||
throw;
|
||||
}
|
||||
}, cancellationToken),
|
||||
ProcessPriorityClass.BelowNormal,
|
||||
TestContext.Current.CancellationToken);
|
||||
|
||||
Assert.IsType<IOException>(failure);
|
||||
Assert.False(result.IsSuccess);
|
||||
Assert.Contains(missing, result.Diagnostics);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task RunAsyncRethrowsOtherFailuresOfTheInputWriterUnchanged()
|
||||
{
|
||||
|
||||
@@ -203,11 +203,13 @@ public sealed class ProxyVideoSourceTests : IDisposable
|
||||
var source = CreateSource();
|
||||
var entry = Register(source, 0, 1, 2);
|
||||
using var wrapper = CreateWrapper(source, entry, null);
|
||||
var lastTickOfFrame299 = new FrameRate(30, 1).GetFrameStart(300) - TimeSpan.FromTicks(1);
|
||||
Assert.Equal(300, FrameTime.TimeToFrame(lastTickOfFrame299, 30, 1));
|
||||
|
||||
wrapper.Update(FrameTimeOf(299));
|
||||
wrapper.Update(lastTickOfFrame299);
|
||||
|
||||
Assert.Equal(0, wrapper.ShownChunk);
|
||||
Assert.Equal(FrameTimeOf(299), chunkSources[0].LastUpdateTime);
|
||||
Assert.Equal(lastTickOfFrame299, chunkSources[0].LastUpdateTime);
|
||||
Assert.Equal(299, focus.Get(source));
|
||||
}
|
||||
|
||||
|
||||
@@ -133,12 +133,13 @@ internal static class FFmpegProcessRunner
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
if (inputFailure is IOException)
|
||||
throw new InvalidOperationException(string.Concat("Failed to send frames to FFmpeg. ", diagnostics.ToString()), inputFailure);
|
||||
if (inputFailure is not null)
|
||||
var result = new FFmpegProcessResult(process.ExitCode, diagnostics.ToString());
|
||||
if (inputFailure is IOException && result.IsSuccess)
|
||||
throw new InvalidOperationException(string.Concat("Failed to send frames to FFmpeg. ", result.Diagnostics), inputFailure);
|
||||
if (inputFailure is not (null or IOException))
|
||||
ExceptionDispatchInfo.Throw(inputFailure);
|
||||
|
||||
return new FFmpegProcessResult(process.ExitCode, diagnostics.ToString());
|
||||
return result;
|
||||
}
|
||||
|
||||
static async Task WriteStandardInputAsync(Process process, FFmpegInputWriter writer, CancellationToken cancellationToken)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>2.0.0</Version>
|
||||
<Version>2.0.1</Version>
|
||||
<Platforms>AnyCPU;x64;x64</Platforms>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -2,6 +2,7 @@ using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Interop;
|
||||
using ProxyForge.Encoding;
|
||||
using ProxyForge.ViewModels;
|
||||
|
||||
@@ -31,11 +32,7 @@ internal static class GenerationProgressWindowHost
|
||||
Update();
|
||||
}
|
||||
|
||||
public static void Shutdown()
|
||||
{
|
||||
window?.CloseForShutdown();
|
||||
window = null;
|
||||
}
|
||||
public static void Shutdown() => window?.CloseForShutdown();
|
||||
|
||||
static void OnItemsChanged(object? sender, NotifyCollectionChangedEventArgs e) => Update();
|
||||
|
||||
@@ -56,16 +53,18 @@ internal static class GenerationProgressWindowHost
|
||||
}
|
||||
|
||||
window ??= Create();
|
||||
if (!window.IsVisible)
|
||||
if (window is { IsVisible: false })
|
||||
window.Show();
|
||||
}
|
||||
|
||||
static GenerationProgressWindow Create()
|
||||
static GenerationProgressWindow? Create()
|
||||
{
|
||||
var created = new GenerationProgressWindow(new GenerationProgressViewModel(items!, cancelAll!));
|
||||
if (Application.Current?.MainWindow is { IsLoaded: true } owner)
|
||||
created.Owner = owner;
|
||||
if (Application.Current?.MainWindow is not { } owner || new WindowInteropHelper(owner).Handle == 0)
|
||||
return null;
|
||||
|
||||
var created = new GenerationProgressWindow(new GenerationProgressViewModel(items!, cancelAll!)) { Owner = owner };
|
||||
created.HideRequested += (_, _) => suppressed = true;
|
||||
created.Closed += (_, _) => window = null;
|
||||
return created;
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする