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:
@@ -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
|
||||
Reference in New Issue
Block a user