Message ID | 20210830210224.703704-1-hiroh@chromium.org |
---|---|
State | Accepted |
Commit | 75df3c71397ffdd61568b19157d327284c6d3a7f |
Headers | show |
Series |
|
Related | show |
Hi Hiro, Thank you for the patch. On Tue, Aug 31, 2021 at 06:02:24AM +0900, Hirokazu Honda wrote: > MappedFrameBuffer::maps() returns planes_. This renames the function > name to planes(). > > Signed-off-by: Hirokazu Honda <hiroh@chromium.org> > --- > include/libcamera/internal/mapped_framebuffer.h | 3 +-- > src/android/jpeg/encoder_libjpeg.cpp | 2 +- > src/android/jpeg/thumbnailer.cpp | 2 +- > src/android/yuv/post_processor_yuv.cpp | 4 ++-- > src/ipa/ipu3/ipu3.cpp | 4 ++-- > src/ipa/raspberrypi/raspberrypi.cpp | 4 ++-- > src/ipa/rkisp1/rkisp1.cpp | 4 ++-- > src/libcamera/mapped_framebuffer.cpp | 2 +- > 8 files changed, 12 insertions(+), 13 deletions(-) > > diff --git a/include/libcamera/internal/mapped_framebuffer.h b/include/libcamera/internal/mapped_framebuffer.h > index 42479541..70ffbcbe 100644 > --- a/include/libcamera/internal/mapped_framebuffer.h > +++ b/include/libcamera/internal/mapped_framebuffer.h > @@ -30,8 +30,7 @@ public: > > bool isValid() const { return error_ == 0; } > int error() const { return error_; } > - /* \todo rename to planes(). */ I like removing todo items :-) Thanks for following up on this. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > - const std::vector<Plane> &maps() const { return planes_; } > + const std::vector<Plane> &planes() const { return planes_; } > > protected: > MappedBuffer(); > diff --git a/src/android/jpeg/encoder_libjpeg.cpp b/src/android/jpeg/encoder_libjpeg.cpp > index a7a63601..b8b01e20 100644 > --- a/src/android/jpeg/encoder_libjpeg.cpp > +++ b/src/android/jpeg/encoder_libjpeg.cpp > @@ -188,7 +188,7 @@ int EncoderLibJpeg::encode(const FrameBuffer &source, Span<uint8_t> dest, > return frame.error(); > } > > - return encode(frame.maps()[0], dest, exifData, quality); > + return encode(frame.planes()[0], dest, exifData, quality); > } > > int EncoderLibJpeg::encode(Span<const uint8_t> src, Span<uint8_t> dest, > diff --git a/src/android/jpeg/thumbnailer.cpp b/src/android/jpeg/thumbnailer.cpp > index 79d83926..043c7b33 100644 > --- a/src/android/jpeg/thumbnailer.cpp > +++ b/src/android/jpeg/thumbnailer.cpp > @@ -62,7 +62,7 @@ void Thumbnailer::createThumbnail(const FrameBuffer &source, > ASSERT(tw % 2 == 0 && th % 2 == 0); > > /* Image scaling block implementing nearest-neighbour algorithm. */ > - unsigned char *src = static_cast<unsigned char *>(frame.maps()[0].data()); > + unsigned char *src = static_cast<unsigned char *>(frame.planes()[0].data()); > unsigned char *srcC = src + sh * sw; > unsigned char *srcCb, *srcCr; > unsigned char *dstY, *srcY; > diff --git a/src/android/yuv/post_processor_yuv.cpp b/src/android/yuv/post_processor_yuv.cpp > index 3e793a58..6952fc38 100644 > --- a/src/android/yuv/post_processor_yuv.cpp > +++ b/src/android/yuv/post_processor_yuv.cpp > @@ -63,9 +63,9 @@ int PostProcessorYuv::process(const FrameBuffer &source, > return -EINVAL; > } > > - int ret = libyuv::NV12Scale(sourceMapped.maps()[0].data(), > + int ret = libyuv::NV12Scale(sourceMapped.planes()[0].data(), > sourceStride_[0], > - sourceMapped.maps()[1].data(), > + sourceMapped.planes()[1].data(), > sourceStride_[1], > sourceSize_.width, sourceSize_.height, > destination->plane(0).data(), > diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp > index 0ed0a6f1..c925cf64 100644 > --- a/src/ipa/ipu3/ipu3.cpp > +++ b/src/ipa/ipu3/ipu3.cpp > @@ -422,7 +422,7 @@ void IPAIPU3::processEvent(const IPU3Event &event) > return; > } > > - Span<uint8_t> mem = it->second.maps()[0]; > + Span<uint8_t> mem = it->second.planes()[0]; > const ipu3_uapi_stats_3a *stats = > reinterpret_cast<ipu3_uapi_stats_3a *>(mem.data()); > > @@ -436,7 +436,7 @@ void IPAIPU3::processEvent(const IPU3Event &event) > return; > } > > - Span<uint8_t> mem = it->second.maps()[0]; > + Span<uint8_t> mem = it->second.planes()[0]; > ipu3_uapi_params *params = > reinterpret_cast<ipu3_uapi_params *>(mem.data()); > > diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp > index 7215b205..047123ab 100644 > --- a/src/ipa/raspberrypi/raspberrypi.cpp > +++ b/src/ipa/raspberrypi/raspberrypi.cpp > @@ -936,7 +936,7 @@ void IPARPi::prepareISP(const ipa::RPi::ISPConfig &data) > */ > auto it = buffers_.find(data.embeddedBufferId); > ASSERT(it != buffers_.end()); > - embeddedBuffer = it->second.maps()[0]; > + embeddedBuffer = it->second.planes()[0]; > } > > /* > @@ -1043,7 +1043,7 @@ void IPARPi::processStats(unsigned int bufferId) > return; > } > > - Span<uint8_t> mem = it->second.maps()[0]; > + Span<uint8_t> mem = it->second.planes()[0]; > bcm2835_isp_stats *stats = reinterpret_cast<bcm2835_isp_stats *>(mem.data()); > RPiController::StatisticsPtr statistics = std::make_shared<bcm2835_isp_stats>(*stats); > helper_->Process(statistics, rpiMetadata_); > diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp > index 046816e0..bf2c13b6 100644 > --- a/src/ipa/rkisp1/rkisp1.cpp > +++ b/src/ipa/rkisp1/rkisp1.cpp > @@ -192,7 +192,7 @@ void IPARkISP1::processEvent(const RkISP1Event &event) > > const rkisp1_stat_buffer *stats = > reinterpret_cast<rkisp1_stat_buffer *>( > - mappedBuffers_.at(bufferId).maps()[0].data()); > + mappedBuffers_.at(bufferId).planes()[0].data()); > > updateStatistics(frame, stats); > break; > @@ -203,7 +203,7 @@ void IPARkISP1::processEvent(const RkISP1Event &event) > > rkisp1_params_cfg *params = > reinterpret_cast<rkisp1_params_cfg *>( > - mappedBuffers_.at(bufferId).maps()[0].data()); > + mappedBuffers_.at(bufferId).planes()[0].data()); > > queueRequest(frame, params, event.controls); > break; > diff --git a/src/libcamera/mapped_framebuffer.cpp b/src/libcamera/mapped_framebuffer.cpp > index 4db92b8c..464d35fe 100644 > --- a/src/libcamera/mapped_framebuffer.cpp > +++ b/src/libcamera/mapped_framebuffer.cpp > @@ -113,7 +113,7 @@ MappedBuffer::~MappedBuffer() > */ > > /** > - * \fn MappedBuffer::maps() > + * \fn MappedBuffer::planes() > * \brief Retrieve the mapped planes > * > * This function retrieves the successfully mapped planes stored as a vector
Hi Hiro, On Tue, Aug 31, 2021 at 06:02:24AM +0900, Hirokazu Honda wrote: > MappedFrameBuffer::maps() returns planes_. This renames the function > name to planes(). > > Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Looks good Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Thanks j > --- > include/libcamera/internal/mapped_framebuffer.h | 3 +-- > src/android/jpeg/encoder_libjpeg.cpp | 2 +- > src/android/jpeg/thumbnailer.cpp | 2 +- > src/android/yuv/post_processor_yuv.cpp | 4 ++-- > src/ipa/ipu3/ipu3.cpp | 4 ++-- > src/ipa/raspberrypi/raspberrypi.cpp | 4 ++-- > src/ipa/rkisp1/rkisp1.cpp | 4 ++-- > src/libcamera/mapped_framebuffer.cpp | 2 +- > 8 files changed, 12 insertions(+), 13 deletions(-) > > diff --git a/include/libcamera/internal/mapped_framebuffer.h b/include/libcamera/internal/mapped_framebuffer.h > index 42479541..70ffbcbe 100644 > --- a/include/libcamera/internal/mapped_framebuffer.h > +++ b/include/libcamera/internal/mapped_framebuffer.h > @@ -30,8 +30,7 @@ public: > > bool isValid() const { return error_ == 0; } > int error() const { return error_; } > - /* \todo rename to planes(). */ > - const std::vector<Plane> &maps() const { return planes_; } > + const std::vector<Plane> &planes() const { return planes_; } > > protected: > MappedBuffer(); > diff --git a/src/android/jpeg/encoder_libjpeg.cpp b/src/android/jpeg/encoder_libjpeg.cpp > index a7a63601..b8b01e20 100644 > --- a/src/android/jpeg/encoder_libjpeg.cpp > +++ b/src/android/jpeg/encoder_libjpeg.cpp > @@ -188,7 +188,7 @@ int EncoderLibJpeg::encode(const FrameBuffer &source, Span<uint8_t> dest, > return frame.error(); > } > > - return encode(frame.maps()[0], dest, exifData, quality); > + return encode(frame.planes()[0], dest, exifData, quality); > } > > int EncoderLibJpeg::encode(Span<const uint8_t> src, Span<uint8_t> dest, > diff --git a/src/android/jpeg/thumbnailer.cpp b/src/android/jpeg/thumbnailer.cpp > index 79d83926..043c7b33 100644 > --- a/src/android/jpeg/thumbnailer.cpp > +++ b/src/android/jpeg/thumbnailer.cpp > @@ -62,7 +62,7 @@ void Thumbnailer::createThumbnail(const FrameBuffer &source, > ASSERT(tw % 2 == 0 && th % 2 == 0); > > /* Image scaling block implementing nearest-neighbour algorithm. */ > - unsigned char *src = static_cast<unsigned char *>(frame.maps()[0].data()); > + unsigned char *src = static_cast<unsigned char *>(frame.planes()[0].data()); > unsigned char *srcC = src + sh * sw; > unsigned char *srcCb, *srcCr; > unsigned char *dstY, *srcY; > diff --git a/src/android/yuv/post_processor_yuv.cpp b/src/android/yuv/post_processor_yuv.cpp > index 3e793a58..6952fc38 100644 > --- a/src/android/yuv/post_processor_yuv.cpp > +++ b/src/android/yuv/post_processor_yuv.cpp > @@ -63,9 +63,9 @@ int PostProcessorYuv::process(const FrameBuffer &source, > return -EINVAL; > } > > - int ret = libyuv::NV12Scale(sourceMapped.maps()[0].data(), > + int ret = libyuv::NV12Scale(sourceMapped.planes()[0].data(), > sourceStride_[0], > - sourceMapped.maps()[1].data(), > + sourceMapped.planes()[1].data(), > sourceStride_[1], > sourceSize_.width, sourceSize_.height, > destination->plane(0).data(), > diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp > index 0ed0a6f1..c925cf64 100644 > --- a/src/ipa/ipu3/ipu3.cpp > +++ b/src/ipa/ipu3/ipu3.cpp > @@ -422,7 +422,7 @@ void IPAIPU3::processEvent(const IPU3Event &event) > return; > } > > - Span<uint8_t> mem = it->second.maps()[0]; > + Span<uint8_t> mem = it->second.planes()[0]; > const ipu3_uapi_stats_3a *stats = > reinterpret_cast<ipu3_uapi_stats_3a *>(mem.data()); > > @@ -436,7 +436,7 @@ void IPAIPU3::processEvent(const IPU3Event &event) > return; > } > > - Span<uint8_t> mem = it->second.maps()[0]; > + Span<uint8_t> mem = it->second.planes()[0]; > ipu3_uapi_params *params = > reinterpret_cast<ipu3_uapi_params *>(mem.data()); > > diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp > index 7215b205..047123ab 100644 > --- a/src/ipa/raspberrypi/raspberrypi.cpp > +++ b/src/ipa/raspberrypi/raspberrypi.cpp > @@ -936,7 +936,7 @@ void IPARPi::prepareISP(const ipa::RPi::ISPConfig &data) > */ > auto it = buffers_.find(data.embeddedBufferId); > ASSERT(it != buffers_.end()); > - embeddedBuffer = it->second.maps()[0]; > + embeddedBuffer = it->second.planes()[0]; > } > > /* > @@ -1043,7 +1043,7 @@ void IPARPi::processStats(unsigned int bufferId) > return; > } > > - Span<uint8_t> mem = it->second.maps()[0]; > + Span<uint8_t> mem = it->second.planes()[0]; > bcm2835_isp_stats *stats = reinterpret_cast<bcm2835_isp_stats *>(mem.data()); > RPiController::StatisticsPtr statistics = std::make_shared<bcm2835_isp_stats>(*stats); > helper_->Process(statistics, rpiMetadata_); > diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp > index 046816e0..bf2c13b6 100644 > --- a/src/ipa/rkisp1/rkisp1.cpp > +++ b/src/ipa/rkisp1/rkisp1.cpp > @@ -192,7 +192,7 @@ void IPARkISP1::processEvent(const RkISP1Event &event) > > const rkisp1_stat_buffer *stats = > reinterpret_cast<rkisp1_stat_buffer *>( > - mappedBuffers_.at(bufferId).maps()[0].data()); > + mappedBuffers_.at(bufferId).planes()[0].data()); > > updateStatistics(frame, stats); > break; > @@ -203,7 +203,7 @@ void IPARkISP1::processEvent(const RkISP1Event &event) > > rkisp1_params_cfg *params = > reinterpret_cast<rkisp1_params_cfg *>( > - mappedBuffers_.at(bufferId).maps()[0].data()); > + mappedBuffers_.at(bufferId).planes()[0].data()); > > queueRequest(frame, params, event.controls); > break; > diff --git a/src/libcamera/mapped_framebuffer.cpp b/src/libcamera/mapped_framebuffer.cpp > index 4db92b8c..464d35fe 100644 > --- a/src/libcamera/mapped_framebuffer.cpp > +++ b/src/libcamera/mapped_framebuffer.cpp > @@ -113,7 +113,7 @@ MappedBuffer::~MappedBuffer() > */ > > /** > - * \fn MappedBuffer::maps() > + * \fn MappedBuffer::planes() > * \brief Retrieve the mapped planes > * > * This function retrieves the successfully mapped planes stored as a vector > -- > 2.33.0.259.gc128427fd7-goog >
diff --git a/include/libcamera/internal/mapped_framebuffer.h b/include/libcamera/internal/mapped_framebuffer.h index 42479541..70ffbcbe 100644 --- a/include/libcamera/internal/mapped_framebuffer.h +++ b/include/libcamera/internal/mapped_framebuffer.h @@ -30,8 +30,7 @@ public: bool isValid() const { return error_ == 0; } int error() const { return error_; } - /* \todo rename to planes(). */ - const std::vector<Plane> &maps() const { return planes_; } + const std::vector<Plane> &planes() const { return planes_; } protected: MappedBuffer(); diff --git a/src/android/jpeg/encoder_libjpeg.cpp b/src/android/jpeg/encoder_libjpeg.cpp index a7a63601..b8b01e20 100644 --- a/src/android/jpeg/encoder_libjpeg.cpp +++ b/src/android/jpeg/encoder_libjpeg.cpp @@ -188,7 +188,7 @@ int EncoderLibJpeg::encode(const FrameBuffer &source, Span<uint8_t> dest, return frame.error(); } - return encode(frame.maps()[0], dest, exifData, quality); + return encode(frame.planes()[0], dest, exifData, quality); } int EncoderLibJpeg::encode(Span<const uint8_t> src, Span<uint8_t> dest, diff --git a/src/android/jpeg/thumbnailer.cpp b/src/android/jpeg/thumbnailer.cpp index 79d83926..043c7b33 100644 --- a/src/android/jpeg/thumbnailer.cpp +++ b/src/android/jpeg/thumbnailer.cpp @@ -62,7 +62,7 @@ void Thumbnailer::createThumbnail(const FrameBuffer &source, ASSERT(tw % 2 == 0 && th % 2 == 0); /* Image scaling block implementing nearest-neighbour algorithm. */ - unsigned char *src = static_cast<unsigned char *>(frame.maps()[0].data()); + unsigned char *src = static_cast<unsigned char *>(frame.planes()[0].data()); unsigned char *srcC = src + sh * sw; unsigned char *srcCb, *srcCr; unsigned char *dstY, *srcY; diff --git a/src/android/yuv/post_processor_yuv.cpp b/src/android/yuv/post_processor_yuv.cpp index 3e793a58..6952fc38 100644 --- a/src/android/yuv/post_processor_yuv.cpp +++ b/src/android/yuv/post_processor_yuv.cpp @@ -63,9 +63,9 @@ int PostProcessorYuv::process(const FrameBuffer &source, return -EINVAL; } - int ret = libyuv::NV12Scale(sourceMapped.maps()[0].data(), + int ret = libyuv::NV12Scale(sourceMapped.planes()[0].data(), sourceStride_[0], - sourceMapped.maps()[1].data(), + sourceMapped.planes()[1].data(), sourceStride_[1], sourceSize_.width, sourceSize_.height, destination->plane(0).data(), diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index 0ed0a6f1..c925cf64 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -422,7 +422,7 @@ void IPAIPU3::processEvent(const IPU3Event &event) return; } - Span<uint8_t> mem = it->second.maps()[0]; + Span<uint8_t> mem = it->second.planes()[0]; const ipu3_uapi_stats_3a *stats = reinterpret_cast<ipu3_uapi_stats_3a *>(mem.data()); @@ -436,7 +436,7 @@ void IPAIPU3::processEvent(const IPU3Event &event) return; } - Span<uint8_t> mem = it->second.maps()[0]; + Span<uint8_t> mem = it->second.planes()[0]; ipu3_uapi_params *params = reinterpret_cast<ipu3_uapi_params *>(mem.data()); diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 7215b205..047123ab 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -936,7 +936,7 @@ void IPARPi::prepareISP(const ipa::RPi::ISPConfig &data) */ auto it = buffers_.find(data.embeddedBufferId); ASSERT(it != buffers_.end()); - embeddedBuffer = it->second.maps()[0]; + embeddedBuffer = it->second.planes()[0]; } /* @@ -1043,7 +1043,7 @@ void IPARPi::processStats(unsigned int bufferId) return; } - Span<uint8_t> mem = it->second.maps()[0]; + Span<uint8_t> mem = it->second.planes()[0]; bcm2835_isp_stats *stats = reinterpret_cast<bcm2835_isp_stats *>(mem.data()); RPiController::StatisticsPtr statistics = std::make_shared<bcm2835_isp_stats>(*stats); helper_->Process(statistics, rpiMetadata_); diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 046816e0..bf2c13b6 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -192,7 +192,7 @@ void IPARkISP1::processEvent(const RkISP1Event &event) const rkisp1_stat_buffer *stats = reinterpret_cast<rkisp1_stat_buffer *>( - mappedBuffers_.at(bufferId).maps()[0].data()); + mappedBuffers_.at(bufferId).planes()[0].data()); updateStatistics(frame, stats); break; @@ -203,7 +203,7 @@ void IPARkISP1::processEvent(const RkISP1Event &event) rkisp1_params_cfg *params = reinterpret_cast<rkisp1_params_cfg *>( - mappedBuffers_.at(bufferId).maps()[0].data()); + mappedBuffers_.at(bufferId).planes()[0].data()); queueRequest(frame, params, event.controls); break; diff --git a/src/libcamera/mapped_framebuffer.cpp b/src/libcamera/mapped_framebuffer.cpp index 4db92b8c..464d35fe 100644 --- a/src/libcamera/mapped_framebuffer.cpp +++ b/src/libcamera/mapped_framebuffer.cpp @@ -113,7 +113,7 @@ MappedBuffer::~MappedBuffer() */ /** - * \fn MappedBuffer::maps() + * \fn MappedBuffer::planes() * \brief Retrieve the mapped planes * * This function retrieves the successfully mapped planes stored as a vector
MappedFrameBuffer::maps() returns planes_. This renames the function name to planes(). Signed-off-by: Hirokazu Honda <hiroh@chromium.org> --- include/libcamera/internal/mapped_framebuffer.h | 3 +-- src/android/jpeg/encoder_libjpeg.cpp | 2 +- src/android/jpeg/thumbnailer.cpp | 2 +- src/android/yuv/post_processor_yuv.cpp | 4 ++-- src/ipa/ipu3/ipu3.cpp | 4 ++-- src/ipa/raspberrypi/raspberrypi.cpp | 4 ++-- src/ipa/rkisp1/rkisp1.cpp | 4 ++-- src/libcamera/mapped_framebuffer.cpp | 2 +- 8 files changed, 12 insertions(+), 13 deletions(-)