尝试解决插件bug

This commit is contained in:
2026-01-10 18:56:58 +08:00
parent e37972b227
commit 4d393f3d23
24 changed files with 959 additions and 161 deletions
@@ -0,0 +1,19 @@
#include <gtest/gtest.h>
#include "render/plugin/pluginrenderer.h"
TEST(PluginRendererReadback, BytesToPixels)
{
olive::VideoParams params(16, 16, olive::core::PixelFormat::U8, 4,
olive::core::rational(1, 1),
olive::VideoParams::kInterlaceNone, 1);
const int bytes_per_pixel =
olive::VideoParams::GetBytesPerPixel(params.format(),
params.channel_count());
ASSERT_EQ(bytes_per_pixel, 4);
EXPECT_EQ(olive::plugin::detail::BytesToPixels(64, params), 16);
EXPECT_EQ(olive::plugin::detail::BytesToPixels(0, params), 0);
EXPECT_EQ(olive::plugin::detail::BytesToPixels(-1, params), 0);
}