Message ID | 20210421042346.312854-7-hiroh@chromium.org |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
Hi Hiro, Thank you for the patch. On Wed, Apr 21, 2021 at 01:23:45PM +0900, Hirokazu Honda wrote: > PipelineHandlerIPU3 gets available test pattern modes of the > sensor device and reports them to a client. > > Signed-off-by: Hirokazu Honda <hiroh@chromium.org> > --- > src/libcamera/pipeline/ipu3/ipu3.cpp | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp > index 51446fcf..76903d31 100644 > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp > @@ -891,6 +891,18 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data) > ControlInfoMap::Map controls = IPU3Controls; > const ControlInfoMap &sensorControls = sensor->controls(); > > + if (!sensorInfo.availableTestPatternModes.empty()) { > + std::vector<ControlValue> values( > + sensorInfo.availableTestPatternModes.size()); > + for (size_t i = 0; i < values.size(); ++i) { > + values[i] = ControlValue( > + sensorInfo.availableTestPatternModes[i]); > + } How about this ? std::vector<ControlValue> values; values.reserve(sensorInfo.availableTestPatternModes.size()); for (int32_t pattern : sensorInfo.availableTestPatternModes) values.emplace_back(pattern); (or similar, I haven't compile-tested it) > + > + controls[&controls::draft::TestPatternMode] = > + ControlInfo(libcamera::Span<const ControlValue>(values)); > + } > + > /* > * Compute exposure time limits. > *
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 51446fcf..76903d31 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -891,6 +891,18 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data) ControlInfoMap::Map controls = IPU3Controls; const ControlInfoMap &sensorControls = sensor->controls(); + if (!sensorInfo.availableTestPatternModes.empty()) { + std::vector<ControlValue> values( + sensorInfo.availableTestPatternModes.size()); + for (size_t i = 0; i < values.size(); ++i) { + values[i] = ControlValue( + sensorInfo.availableTestPatternModes[i]); + } + + controls[&controls::draft::TestPatternMode] = + ControlInfo(libcamera::Span<const ControlValue>(values)); + } + /* * Compute exposure time limits. *
PipelineHandlerIPU3 gets available test pattern modes of the sensor device and reports them to a client. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> --- src/libcamera/pipeline/ipu3/ipu3.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+)