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>
This commit is contained in:
2026-06-14 11:03:19 -04:00
parent 809861be2b
commit e7b7a311f7
18 changed files with 1698 additions and 0 deletions
@@ -0,0 +1,49 @@
#include <yuvCaptureLayout.h>
#include <stdexcept>
namespace smo {
namespace stim_buff {
namespace lcamera_buff {
YuvCaptureLayoutPath classifyYuvCaptureLayoutPath(
const lcamera_dev::LcameraDevConfiguredCameraMode& configuredMode)
{
if (configuredMode.isFullyPlanar && configuredMode.planeCount == 3u) {
return YuvCaptureLayoutPath::FullPlanarDirect;
}
if (configuredMode.planeCount == 2u) {
return YuvCaptureLayoutPath::SemiPlanarDeinterleave;
}
if (configuredMode.planeCount == 1u) {
return YuvCaptureLayoutPath::PackedDeinterleave;
}
throw std::runtime_error(
"lcameraBuff: unsupported configured YUV layout: pixelFormat="
+ configuredMode.pixelFormatName
+ " planeCount=" + std::to_string(configuredMode.planeCount));
}
YuvChannelBackingPlan getChannelBackingPlanForLayoutPath(
YuvCaptureLayoutPath layoutPath)
{
switch (layoutPath)
{
case YuvCaptureLayoutPath::FullPlanarDirect:
return YuvChannelBackingPlan::LCameraDirect;
case YuvCaptureLayoutPath::SemiPlanarDeinterleave:
case YuvCaptureLayoutPath::PackedDeinterleave:
return YuvChannelBackingPlan::MmapDeinterleaved;
}
throw std::logic_error(
"lcameraBuff: unhandled YuvCaptureLayoutPath in "
"getChannelBackingPlanForLayoutPath");
}
} // namespace lcamera_buff
} // namespace stim_buff
} // namespace smo