e7b7a311f7
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>
45 lines
1.1 KiB
C++
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
|