mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-14 02:04:14 +01:00
f9f7161686
* Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents
41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using FFMpegCore.Exceptions;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
namespace FFMpegCore.Test
|
|
{
|
|
[TestClass]
|
|
public class PixelFormatTests
|
|
{
|
|
[TestMethod]
|
|
public void PixelFormats_Enumerate()
|
|
{
|
|
var formats = FFMpeg.GetPixelFormats();
|
|
Assert.IsTrue(formats.Count > 0);
|
|
}
|
|
|
|
[TestMethod]
|
|
public void PixelFormats_TryGetExisting()
|
|
{
|
|
Assert.IsTrue(FFMpeg.TryGetPixelFormat("yuv420p", out _));
|
|
}
|
|
|
|
[TestMethod]
|
|
public void PixelFormats_TryGetNotExisting()
|
|
{
|
|
Assert.IsFalse(FFMpeg.TryGetPixelFormat("yuv420pppUnknown", out _));
|
|
}
|
|
|
|
[TestMethod]
|
|
public void PixelFormats_GetExisting()
|
|
{
|
|
var fmt = FFMpeg.GetPixelFormat("yuv420p");
|
|
Assert.IsTrue(fmt.Components == 3 && fmt.BitsPerPixel == 12);
|
|
}
|
|
|
|
[TestMethod]
|
|
public void PixelFormats_GetNotExisting()
|
|
{
|
|
Assert.ThrowsException<FFMpegException>(() => FFMpeg.GetPixelFormat("yuv420pppUnknown"));
|
|
}
|
|
}
|
|
}
|