[libcamera-devel] [PATCH 1/2] android: jpeg: Drop "libcamera::" namespace from functions' arguments
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Fri Oct 23 07:15:57 CEST 2020
Hi Umang,
Thank you for the patch.
On Fri, Oct 23, 2020 at 10:44:10AM +0530, Umang Jain wrote:
> Drop "libcamera::" from functions' arguments for *.cpp files as they are
> already declared via the function signatures in their respective header
> files.
This isn't the reason they can be dropped, it's because the .cpp files
has a
using namespace libcamera;
directive at the beginning.
> Signed-off-by: Umang Jain <email at uajain.com>
> ---
> src/android/jpeg/encoder_libjpeg.cpp | 9 ++++-----
> src/android/jpeg/post_processor_jpeg.cpp | 4 ++--
> 2 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/src/android/jpeg/encoder_libjpeg.cpp b/src/android/jpeg/encoder_libjpeg.cpp
> index 5a2f88f..4bea10c 100644
> --- a/src/android/jpeg/encoder_libjpeg.cpp
> +++ b/src/android/jpeg/encoder_libjpeg.cpp
> @@ -104,7 +104,7 @@ int EncoderLibJpeg::configure(const StreamConfiguration &cfg)
> return 0;
> }
>
> -void EncoderLibJpeg::compressRGB(const libcamera::MappedBuffer *frame)
> +void EncoderLibJpeg::compressRGB(const MappedBuffer *frame)
> {
> unsigned char *src = static_cast<unsigned char *>(frame->maps()[0].data());
> /* \todo Stride information should come from buffer configuration. */
> @@ -122,7 +122,7 @@ void EncoderLibJpeg::compressRGB(const libcamera::MappedBuffer *frame)
> * Compress the incoming buffer from a supported NV format.
> * This naively unpacks the semi-planar NV12 to a YUV888 format for libjpeg.
> */
> -void EncoderLibJpeg::compressNV(const libcamera::MappedBuffer *frame)
> +void EncoderLibJpeg::compressNV(const MappedBuffer *frame)
> {
> uint8_t tmprowbuf[compress_.image_width * 3];
>
> @@ -179,9 +179,8 @@ void EncoderLibJpeg::compressNV(const libcamera::MappedBuffer *frame)
> }
> }
>
> -int EncoderLibJpeg::encode(const FrameBuffer &source,
> - libcamera::Span<uint8_t> dest,
> - const libcamera::Span<const uint8_t> &exifData)
> +int EncoderLibJpeg::encode(const FrameBuffer &source, Span<uint8_t> dest,
> + const Span<const uint8_t> &exifData)
> {
> MappedFrameBuffer frame(&source, PROT_READ);
> if (!frame.isValid()) {
> diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp
> index fd1c7be..93acfe5 100644
> --- a/src/android/jpeg/post_processor_jpeg.cpp
> +++ b/src/android/jpeg/post_processor_jpeg.cpp
> @@ -44,8 +44,8 @@ int PostProcessorJpeg::configure(const StreamConfiguration &inCfg,
> return encoder_->configure(inCfg);
> }
>
> -int PostProcessorJpeg::process(const libcamera::FrameBuffer &source,
> - libcamera::Span<uint8_t> destination,
> +int PostProcessorJpeg::process(const FrameBuffer &source,
> + Span<uint8_t> destination,
> CameraMetadata *metadata)
> {
> if (!encoder_)
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list