Scaffolded c# app
This commit is contained in:
parent
0272c5ac3a
commit
387a6ac182
57 changed files with 3930 additions and 0 deletions
|
|
@ -0,0 +1,33 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using Surveillance.Client.Media;
|
||||
using Surveillance.Media.FFmpegCore;
|
||||
using Xunit;
|
||||
|
||||
namespace Surveillance.Media.FFmpegCore.Tests;
|
||||
|
||||
public sealed class FfmpegCoreLiveVideoDecoderTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task RejectsDecodedFramesAboveConfiguredMemoryLimit()
|
||||
{
|
||||
var decoder = new FfmpegCoreLiveVideoDecoder();
|
||||
var stream = new VideoStreamDescriptor(VideoCodec.H264, 4097, 4096);
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentOutOfRangeException>(async () =>
|
||||
{
|
||||
await foreach (var _ in decoder.DecodeAsync(
|
||||
stream,
|
||||
EmptyPackets(TestContext.Current.CancellationToken),
|
||||
TestContext.Current.CancellationToken))
|
||||
{
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static async IAsyncEnumerable<EncodedVideoPacket> EmptyPackets(
|
||||
[EnumeratorCancellation] CancellationToken cancellationToken = default)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" />
|
||||
<PackageReference Include="xunit.v3" />
|
||||
<ProjectReference Include="..\..\src\Surveillance.Media.FFmpegCore\Surveillance.Media.FFmpegCore.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Loading…
Add table
Add a link
Reference in a new issue