Files
video-v1/vav2/godot_extension/TestVavCoreDLL.cs

84 lines
3.5 KiB
C#

using System;
using VavCore.Wrapper;
// Simple console test to verify VavCore DLL connection
class TestVavCoreDLL
{
static void Main(string[] args)
{
Console.WriteLine("VavCore DLL Connection Test");
Console.WriteLine("===========================");
try
{
// Test VavCore DLL connection
Console.WriteLine("Testing VavCore DLL connection...");
// Get version string
var version = VavCore.GetVersion();
Console.WriteLine($"VavCore version: {version}");
// Initialize VavCore
Console.WriteLine("Initializing VavCore...");
bool initSuccess = VavCore.Initialize();
Console.WriteLine($"VavCore initialization: {(initSuccess ? "SUCCESS" : "FAILED")}");
if (initSuccess)
{
// Test player creation
Console.WriteLine("Creating VavCore player...");
var player = VavCore.CreatePlayer();
Console.WriteLine($"Player creation: {(player != IntPtr.Zero ? "SUCCESS" : "FAILED")}");
if (player != IntPtr.Zero)
{
// Test decoder type setting
Console.WriteLine("Setting decoder type to AUTO...");
bool setDecoderSuccess = VavCore.SetDecoderType(player, DecoderType.AUTO);
Console.WriteLine($"Set decoder type: {(setDecoderSuccess ? "SUCCESS" : "FAILED")}");
// Test surface type support
Console.WriteLine("Checking Vulkan surface support...");
bool vulkanSupported = VavCore.SupportsSurfaceType(SurfaceType.Vulkan);
Console.WriteLine($"Vulkan surface support: {(vulkanSupported ? "SUPPORTED" : "NOT SUPPORTED")}");
Console.WriteLine("Checking D3D11 surface support...");
bool d3d11Supported = VavCore.SupportsSurfaceType(SurfaceType.D3D11);
Console.WriteLine($"D3D11 surface support: {(d3d11Supported ? "SUPPORTED" : "NOT SUPPORTED")}");
// Get optimal surface type
Console.WriteLine("Getting optimal surface type...");
var optimalSurface = VavCore.GetOptimalSurfaceType();
Console.WriteLine($"Optimal surface type: {optimalSurface}");
// Test performance metrics
Console.WriteLine("Getting performance metrics...");
var metrics = VavCore.GetPerformanceMetrics(player);
Console.WriteLine($"Performance metrics - FPS: {metrics.CurrentFPS:F2}, Dropped: {metrics.DroppedFrames}");
// Clean up player
Console.WriteLine("Destroying player...");
VavCore.DestroyPlayer(player);
Console.WriteLine("Player destroyed");
}
// Clean up VavCore
Console.WriteLine("Cleaning up VavCore...");
VavCore.Cleanup();
Console.WriteLine("VavCore cleanup completed");
}
Console.WriteLine("\n=== VavCore DLL Connection Test COMPLETED SUCCESSFULLY ===");
}
catch (Exception ex)
{
Console.WriteLine($"\n=== VavCore DLL Connection Test FAILED ===");
Console.WriteLine($"Error: {ex.Message}");
Console.WriteLine($"Stack trace: {ex.StackTrace}");
return;
}
Console.WriteLine("\nPress any key to exit...");
Console.ReadKey();
}
}