Merge branch 'or1p4-p5' into or1-p4
This commit is contained in:
commit
a433b55be3
27 files changed
+663
-47
No files matched your search
@@ -128,6 +128,22 @@ public sealed class EncoderSelectorTests
|
||||
Assert.Equal((1080, 606), (odd.Settings.Width, odd.Settings.Height));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void APortraitFrameReadsTheLimitTurned()
|
||||
{
|
||||
// An encoder announced as 4096×2304 takes 4K at 9:16: its limit is long edge × short edge.
|
||||
var portrait = EncoderSelector.Select(Request(VideoCodec.H264, 2160, 3840), Client(SoftwareH264), EncoderHost.Client);
|
||||
Assert.Equal((2160, 3840), (portrait.Settings.Width, portrait.Settings.Height));
|
||||
Assert.False(portrait.Notices.Any(n => n.Key is EncoderNotices.ResolutionCappedByEncoder or EncoderNotices.ResolutionCappedByLevel), "not capped");
|
||||
|
||||
var capped = EncoderSelector.Select(Request(VideoCodec.H264, 4320, 7680), Client(SoftwareH264), EncoderHost.Client);
|
||||
Assert.Equal((2304, 4096), (capped.Settings.Width, capped.Settings.Height));
|
||||
Assert.True(capped.Notices.Any(n => n.Key == EncoderNotices.ResolutionCappedByEncoder));
|
||||
|
||||
Assert.True(EncoderSelector.Takes(SoftwareH264, 2304, 4096));
|
||||
Assert.False(EncoderSelector.Takes(SoftwareH264, 2400, 3840), "the short edge is over the limit");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BitRateIsCappedByTheHighestLevel()
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Chronos.Core.Export;
|
||||
using Chronos.Core.Imaging;
|
||||
using Chronos.Core.Video;
|
||||
|
||||
@@ -26,7 +27,7 @@ internal sealed class CapturingEncoderProvider(string name, params EncoderCapabi
|
||||
public (int Frame, Exception Error)? FailAt { get; set; }
|
||||
|
||||
public bool CanEncode(EncodeSettings settings) => capabilities.Any(c =>
|
||||
c.Codec == settings.Codec && settings.Width <= c.MaxWidth && settings.Height <= c.MaxHeight && (settings.BitDepth == 8 || c.SupportsTenBit));
|
||||
c.Codec == settings.Codec && EncoderSelector.Takes(c, settings.Width, settings.Height) && (settings.BitDepth == 8 || c.SupportsTenBit));
|
||||
|
||||
public IVideoEncoderSession Open(EncodeSettings settings)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user