Message ID | 20230724095925.20877-1-jacopo.mondi@ideasonboard.com |
---|---|
State | Superseded |
Headers | show |
Hi Jacopo, On Mon, 24 Jul 2023 at 10:59, Jacopo Mondi <jacopo.mondi@ideasonboard.com> wrote: > > Naush, I have simplified a bit 2/3 and removed a few leftovers. > If no objections I plan to push this soon, is it fine ? No objections from me. Feel free to merge it when you are ready. Regards, Naush > > The overall diff between v2 and v3 is very minor, but 2/3 now looks more > logical. > > --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp > +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp > @@ -207,7 +207,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate() > std::sort(outStreams.begin(), outStreams.end(), > [](auto &l, auto &r) { return l.cfg->size > r.cfg->size; }); > > - /* Do any platform specific fixups. */ > + /* Compute the sensor configuration. */ > unsigned int bitDepth = defaultRawBitDepth; > if (!rawStreams.empty()) { > BayerFormat bayerFormat = BayerFormat::fromPixelFormat(rawStreams[0].cfg->pixelFormat); > @@ -218,6 +218,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate() > : rawStreams[0].cfg->size, > bitDepth); > > + /* Do any platform specific fixups. */ > status = data_->platformValidate(rawStreams, outStreams); > if (status == Invalid) > return Invalid; > @@ -227,9 +228,6 @@ CameraConfiguration::Status RPiCameraConfiguration::validate() > StreamConfiguration &cfg = config_.at(raw.index); > V4L2DeviceFormat rawFormat; > > - const PixelFormatInfo &info = PixelFormatInfo::info(cfg.pixelFormat); > - bitDepth = info.isValid() ? info.bitsPerPixel : defaultRawBitDepth; > - > BayerFormat::Packing packing = BayerFormat::fromPixelFormat(cfg.pixelFormat).packing; > rawFormat = PipelineHandlerBase::toV4L2DeviceFormat(raw.dev, sensorFormat_, packing); > > > > Thanks > j > > Jacopo Mondi (3): > libcamera: rpi: pipeline_base: Remove populateSensorFormats() > libcamera: rpi: pipeline_base: Move findBestFormat to CameraData > libcamera: rpi: pipeline_base: Cache sensor format > > .../pipeline/rpi/common/pipeline_base.cpp | 182 +++++++++--------- > .../pipeline/rpi/common/pipeline_base.h | 5 + > 2 files changed, 91 insertions(+), 96 deletions(-) > > -- > 2.40.1 >
--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -207,7 +207,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate() std::sort(outStreams.begin(), outStreams.end(), [](auto &l, auto &r) { return l.cfg->size > r.cfg->size; }); - /* Do any platform specific fixups. */ + /* Compute the sensor configuration. */ unsigned int bitDepth = defaultRawBitDepth; if (!rawStreams.empty()) { BayerFormat bayerFormat = BayerFormat::fromPixelFormat(rawStreams[0].cfg->pixelFormat); @@ -218,6 +218,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate() : rawStreams[0].cfg->size, bitDepth); + /* Do any platform specific fixups. */ status = data_->platformValidate(rawStreams, outStreams); if (status == Invalid) return Invalid; @@ -227,9 +228,6 @@ CameraConfiguration::Status RPiCameraConfiguration::validate() StreamConfiguration &cfg = config_.at(raw.index); V4L2DeviceFormat rawFormat; - const PixelFormatInfo &info = PixelFormatInfo::info(cfg.pixelFormat); - bitDepth = info.isValid() ? info.bitsPerPixel : defaultRawBitDepth; - BayerFormat::Packing packing = BayerFormat::fromPixelFormat(cfg.pixelFormat).packing; rawFormat = PipelineHandlerBase::toV4L2DeviceFormat(raw.dev, sensorFormat_, packing);