Files
salmanoff/stimBuffApis/lcameraBuff/tests/yuvLayoutClassification_tests.cpp
T
hayodea e7b7a311f7 Add lcameraBuff Stage 2 plugin with YUV attach and unit tests.
Introduce params parsing, pixel/format decisions, capture layout, shared
YuvStimProducer per camera, and channel stimulus buffers with attach flow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 11:03:19 -04:00

45 lines
1.1 KiB
C++

#include <yuvCaptureLayout.h>
#include <gtest/gtest.h>
namespace smo {
namespace stim_buff {
namespace lcamera_buff {
namespace {
TEST(YuvCaptureLayoutTest, PackedYuyvUsesMmapDeinterleavedBacking)
{
lcamera_dev::LcameraDevConfiguredCameraMode mode;
mode.pixelFormatName = "YUYV";
mode.isFullyPlanar = false;
mode.planeCount = 1;
EXPECT_EQ(
classifyYuvCaptureLayoutPath(mode),
YuvCaptureLayoutPath::PackedDeinterleave);
EXPECT_EQ(
getChannelBackingPlanForLayoutPath(
YuvCaptureLayoutPath::PackedDeinterleave),
YuvChannelBackingPlan::MmapDeinterleaved);
}
TEST(YuvCaptureLayoutTest, FullPlanarUsesDirectBacking)
{
lcamera_dev::LcameraDevConfiguredCameraMode mode;
mode.pixelFormatName = "YU12";
mode.isFullyPlanar = true;
mode.planeCount = 3;
EXPECT_EQ(
classifyYuvCaptureLayoutPath(mode),
YuvCaptureLayoutPath::FullPlanarDirect);
EXPECT_EQ(
getChannelBackingPlanForLayoutPath(
YuvCaptureLayoutPath::FullPlanarDirect),
YuvChannelBackingPlan::LCameraDirect);
}
} // namespace
} // namespace lcamera_buff
} // namespace stim_buff
} // namespace smo