[{"id":19323,"web_url":"https://patchwork.libcamera.org/comment/19323/","msgid":"<CAO5uPHMFdQwgVY-d9Jorr8H6Gup6jpvKMqdfPt4jr2jKQbhV=A@mail.gmail.com>","date":"2021-09-03T08:34:12","subject":"Re: [libcamera-devel] [PATCH] android: Cleanup libcamera namespace\n\tusage","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Umang, thank you for the patch.\n\n\nOn Fri, Sep 3, 2021 at 4:52 PM Umang Jain <umang.jain@ideasonboard.com> wrote:\n>\n> Usually .cpp files are equipped with using namespace libcamera;\n> Hence, it is unnecessary mentioning the explicit namespace of\n> libcamera at certain places.\n>\n> While at it, a small typo in a comment was noticed and fixed as\n> part of this patch.\n>\n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>  src/android/camera_capabilities.cpp      |  4 ++--\n>  src/android/camera_device.cpp            |  6 +++---\n>  src/android/camera_stream.cpp            |  4 ++--\n>  src/android/camera_worker.cpp            |  2 +-\n>  src/android/mm/cros_camera_buffer.cpp    |  6 +++---\n>  src/android/mm/generic_camera_buffer.cpp | 11 +++++------\n\n$ grep -l -r \"libcamera::\" --include \\*.cpp\ncamera_device.cpp\ncamera_capabilities.cpp\ncamera_worker.cpp\ncamera_stream.cpp\nmm/generic_camera_buffer.cpp\nmm/cros_camera_buffer.cpp\njpeg/encoder_libjpeg.cpp\njpeg/thumbnailer.cpp\n\nThere are also cases in jpeg directories.\nCould you apply this change to them?\n\nThanks,\n-Hiro\n>  6 files changed, 16 insertions(+), 17 deletions(-)\n>\n> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> index c16e755f..e92bca42 100644\n> --- a/src/android/camera_capabilities.cpp\n> +++ b/src/android/camera_capabilities.cpp\n> @@ -378,7 +378,7 @@ void CameraCapabilities::computeHwLevel(\n>         hwLevel_ = hwLevel;\n>  }\n>\n> -int CameraCapabilities::initialize(std::shared_ptr<libcamera::Camera> camera,\n> +int CameraCapabilities::initialize(std::shared_ptr<Camera> camera,\n>                                    int orientation, int facing)\n>  {\n>         camera_ = camera;\n> @@ -429,7 +429,7 @@ CameraCapabilities::initializeYUVResolutions(const PixelFormat &pixelFormat,\n>  }\n>\n>  std::vector<Size>\n> -CameraCapabilities::initializeRawResolutions(const libcamera::PixelFormat &pixelFormat)\n> +CameraCapabilities::initializeRawResolutions(const PixelFormat &pixelFormat)\n>  {\n>         std::unique_ptr<CameraConfiguration> cameraConfig =\n>                 camera_->generateConfiguration({ StreamRole::Raw });\n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index 8ca76719..d782067e 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -746,8 +746,8 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n>  }\n>\n>  FrameBuffer *CameraDevice::createFrameBuffer(const buffer_handle_t camera3buffer,\n> -                                            libcamera::PixelFormat pixelFormat,\n> -                                            const libcamera::Size &size)\n> +                                            PixelFormat pixelFormat,\n> +                                            const Size &size)\n>  {\n>         FileDescriptor fd;\n>         /*\n> @@ -1140,7 +1140,7 @@ void CameraDevice::requestComplete(Request *request)\n>         if (!resultMetadata) {\n>                 notifyError(descriptor.frameNumber_, nullptr, CAMERA3_MSG_ERROR_RESULT);\n>\n> -               /* The camera framework expects an empy metadata pack on error. */\n> +               /* The camera framework expects an empty metadata pack on error. */\n>                 resultMetadata = std::make_unique<CameraMetadata>(0, 0);\n>         }\n>\n> diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp\n> index 01909ec7..0f5ae947 100644\n> --- a/src/android/camera_stream.cpp\n> +++ b/src/android/camera_stream.cpp\n> @@ -98,7 +98,7 @@ int CameraStream::configure()\n>         return 0;\n>  }\n>\n> -int CameraStream::process(const libcamera::FrameBuffer &source,\n> +int CameraStream::process(const FrameBuffer &source,\n>                           buffer_handle_t camera3Dest,\n>                           const CameraMetadata &requestMetadata,\n>                           CameraMetadata *resultMetadata)\n> @@ -139,7 +139,7 @@ FrameBuffer *CameraStream::getBuffer()\n>         return buffer;\n>  }\n>\n> -void CameraStream::putBuffer(libcamera::FrameBuffer *buffer)\n> +void CameraStream::putBuffer(FrameBuffer *buffer)\n>  {\n>         if (!allocator_)\n>                 return;\n> diff --git a/src/android/camera_worker.cpp b/src/android/camera_worker.cpp\n> index 98dddd9e..91313183 100644\n> --- a/src/android/camera_worker.cpp\n> +++ b/src/android/camera_worker.cpp\n> @@ -27,7 +27,7 @@ LOG_DECLARE_CATEGORY(HAL)\n>   * by the CameraWorker which queues it to the libcamera::Camera after handling\n>   * fences.\n>   */\n> -CaptureRequest::CaptureRequest(libcamera::Camera *camera)\n> +CaptureRequest::CaptureRequest(Camera *camera)\n>         : camera_(camera)\n>  {\n>         request_ = camera_->createRequest(reinterpret_cast<uint64_t>(this));\n> diff --git a/src/android/mm/cros_camera_buffer.cpp b/src/android/mm/cros_camera_buffer.cpp\n> index 44993379..ec45e04c 100644\n> --- a/src/android/mm/cros_camera_buffer.cpp\n> +++ b/src/android/mm/cros_camera_buffer.cpp\n> @@ -21,7 +21,7 @@ class CameraBuffer::Private : public Extensible::Private\n>\n>  public:\n>         Private(CameraBuffer *cameraBuffer, buffer_handle_t camera3Buffer,\n> -               libcamera::PixelFormat pixelFormat, const libcamera::Size &size,\n> +               PixelFormat pixelFormat, const Size &size,\n>                 int flags);\n>         ~Private();\n>\n> @@ -53,8 +53,8 @@ private:\n>\n>  CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer,\n>                                buffer_handle_t camera3Buffer,\n> -                              [[maybe_unused]] libcamera::PixelFormat pixelFormat,\n> -                              [[maybe_unused]] const libcamera::Size &size,\n> +                              [[maybe_unused]] PixelFormat pixelFormat,\n> +                              [[maybe_unused]] const Size &size,\n>                                [[maybe_unused]] int flags)\n>         : handle_(camera3Buffer), numPlanes_(0), mapped_(false),\n>           registered_(false)\n> diff --git a/src/android/mm/generic_camera_buffer.cpp b/src/android/mm/generic_camera_buffer.cpp\n> index 22efc4d4..27a30e2d 100644\n> --- a/src/android/mm/generic_camera_buffer.cpp\n> +++ b/src/android/mm/generic_camera_buffer.cpp\n> @@ -20,14 +20,13 @@ using namespace libcamera;\n>  LOG_DECLARE_CATEGORY(HAL)\n>\n>  class CameraBuffer::Private : public Extensible::Private,\n> -                             public libcamera::MappedBuffer\n> +                             public MappedBuffer\n>  {\n>         LIBCAMERA_DECLARE_PUBLIC(CameraBuffer)\n>\n>  public:\n>         Private(CameraBuffer *cameraBuffer, buffer_handle_t camera3Buffer,\n> -               libcamera::PixelFormat pixelFormat, const libcamera::Size &size,\n> -               int flags);\n> +               PixelFormat pixelFormat, const Size &size, int flags);\n>         ~Private();\n>\n>         unsigned int numPlanes() const;\n> @@ -58,13 +57,13 @@ private:\n>\n>  CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer,\n>                                buffer_handle_t camera3Buffer,\n> -                              libcamera::PixelFormat pixelFormat,\n> -                              const libcamera::Size &size, int flags)\n> +                              PixelFormat pixelFormat,\n> +                              const Size &size, int flags)\n>         : fd_(-1), flags_(flags), bufferLength_(-1), mapped_(false)\n>  {\n>         error_ = 0;\n>\n> -       const auto &info = libcamera::PixelFormatInfo::info(pixelFormat);\n> +       const auto &info = PixelFormatInfo::info(pixelFormat);\n>         if (!info.isValid()) {\n>                 error_ = -EINVAL;\n>                 LOG(HAL, Error) << \"Invalid pixel format: \"\n> --\n> 2.31.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 8C489BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 Sep 2021 08:34:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 027466916B;\n\tFri,  3 Sep 2021 10:34:25 +0200 (CEST)","from mail-ej1-x633.google.com (mail-ej1-x633.google.com\n\t[IPv6:2a00:1450:4864:20::633])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8967669165\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Sep 2021 10:34:23 +0200 (CEST)","by mail-ej1-x633.google.com with SMTP id h9so10526004ejs.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 03 Sep 2021 01:34:23 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"c/HCuPN8\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=P6HToIxgz79dPyZftGQRbt95wUJ8aG2zddfwe6YyLYM=;\n\tb=c/HCuPN8aJRHiVt+YwJzzZUcqx8jODEwFDbQszUdKqOd/nIL6FJXlYWobIfzkLiVcM\n\tp1mGtYvmHPS3QO8a/mkyJY/NiiCCKzN5po0eslMPy4K/FZcjgs6eMXZNKCXhr6Xya3mQ\n\tsvbesJpdOgtziELLNQ6GjOg2Ru4myzBLCxKYk=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=P6HToIxgz79dPyZftGQRbt95wUJ8aG2zddfwe6YyLYM=;\n\tb=WgysjniRGkHVKagjNU0DKa2jSzsoVdiK4Th1imHItQKox6/FcElZrZ/NK+i1X5wxHh\n\t2tgj0tKiDk/iJyY/W0Nn5YAlffXLwgy5VCbwWptxiJ+Lb6aVQDN2A7CXjO90CvslSOT8\n\t0HrfZM9lLf/1+Y+OURGvKJY7mKxzlfibsqlK+C9eCCsNd/rZQmugnoBy6jIDIQXtaXsp\n\tTtwCuTy0twvHj7UhW4i/9mbfTp+JUaTtrvzzVRsGyUISFowRFm4XIfiu0qcAndXBj87V\n\tr2c78QrLDnZ5UyCwu4WvMpgxy4e/2kUQ74hfw2EyLiXDEVhFUNJ4Se/on4bKu9PV2hs5\n\tQJQg==","X-Gm-Message-State":"AOAM533B7cjstdDZxd/KThGVZVJvqBAx/DuQ+xI/7SY5DkqmymeeOmue\n\tEea3OYXKfu6bk0Kgs2V3/uT7mfAZm1QdWZn6saPxrw+uWFaqJg==","X-Google-Smtp-Source":"ABdhPJzWjcDxdzon1CsSQSqP4qgnmehvTlkeH0kOybP+5NWMJE6D1sriEzBEiyII2czlvDAFIxrwpZfjU7lnbqowrpc=","X-Received":"by 2002:a17:906:b052:: with SMTP id\n\tbj18mr2954736ejb.55.1630658063116; \n\tFri, 03 Sep 2021 01:34:23 -0700 (PDT)","MIME-Version":"1.0","References":"<20210903075249.1083572-1-umang.jain@ideasonboard.com>","In-Reply-To":"<20210903075249.1083572-1-umang.jain@ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Fri, 3 Sep 2021 17:34:12 +0900","Message-ID":"<CAO5uPHMFdQwgVY-d9Jorr8H6Gup6jpvKMqdfPt4jr2jKQbhV=A@mail.gmail.com>","To":"Umang Jain <umang.jain@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH] android: Cleanup libcamera namespace\n\tusage","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":19326,"web_url":"https://patchwork.libcamera.org/comment/19326/","msgid":"<44c9de81-8909-06fc-4592-159d45144241@ideasonboard.com>","date":"2021-09-03T08:40:03","subject":"Re: [libcamera-devel] [PATCH] android: Cleanup libcamera namespace\n\tusage","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hiro,\n\n\nOn 9/3/21 2:04 PM, Hirokazu Honda wrote:\n> Hi Umang, thank you for the patch.\n>\n>\n> On Fri, Sep 3, 2021 at 4:52 PM Umang Jain <umang.jain@ideasonboard.com> wrote:\n>> Usually .cpp files are equipped with using namespace libcamera;\n>> Hence, it is unnecessary mentioning the explicit namespace of\n>> libcamera at certain places.\n>>\n>> While at it, a small typo in a comment was noticed and fixed as\n>> part of this patch.\n>>\n>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n>> ---\n>>   src/android/camera_capabilities.cpp      |  4 ++--\n>>   src/android/camera_device.cpp            |  6 +++---\n>>   src/android/camera_stream.cpp            |  4 ++--\n>>   src/android/camera_worker.cpp            |  2 +-\n>>   src/android/mm/cros_camera_buffer.cpp    |  6 +++---\n>>   src/android/mm/generic_camera_buffer.cpp | 11 +++++------\n> $ grep -l -r \"libcamera::\" --include \\*.cpp\n> camera_device.cpp\n> camera_capabilities.cpp\n> camera_worker.cpp\n> camera_stream.cpp\n> mm/generic_camera_buffer.cpp\n> mm/cros_camera_buffer.cpp\n> jpeg/encoder_libjpeg.cpp\n> jpeg/thumbnailer.cpp\n>\n> There are also cases in jpeg directories.\n> Could you apply this change to them?\n\nAre you running this with the patch applied? :-)\n\nWith his patch applied here, I get:\n\n[uajain@fedora android]$ grep -l -r \"libcamera::\" --include \\*.cpp\ncamera_device.cpp\ncamera_worker.cpp\ncamera_stream.cpp\n[uajain@fedora android]$ git grep -ni \"libcamera::\" | grep \\.cpp\ncamera_device.cpp:54: * Reorder the configurations so that \nlibcamera::Camera can accept them as much\ncamera_device.cpp:253: * The CameraDevice class wraps a \nlibcamera::Camera instance, and implements\ncamera_device.cpp:315:     * If the libcamera::Camera provides those \ninformation as retrieved\ncamera_device.cpp:1250:     * will have to be passed to the \nlibcamera::Camera and extracted\ncamera_device.cpp:1251:     * from libcamera::Request::metadata.\ncamera_stream.cpp:28: * camera framework to a \nlibcamera::StreamConfiguration.\ncamera_stream.cpp:40: * the associated libcamera::Stream, including the \ncreation of the encoder\ncamera_worker.cpp:23: * \\brief Wrap a libcamera::Request associated with \nbuffers and fences\ncamera_worker.cpp:27: * by the CameraWorker which queues it to the \nlibcamera::Camera after handling\n\nI don't think it would be wise to remove the `libcamera::` on comments. \nThey probably have some \"contextual\" value\n\n\n>\n> Thanks,\n> -Hiro\n>>   6 files changed, 16 insertions(+), 17 deletions(-)\n>>\n>> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n>> index c16e755f..e92bca42 100644\n>> --- a/src/android/camera_capabilities.cpp\n>> +++ b/src/android/camera_capabilities.cpp\n>> @@ -378,7 +378,7 @@ void CameraCapabilities::computeHwLevel(\n>>          hwLevel_ = hwLevel;\n>>   }\n>>\n>> -int CameraCapabilities::initialize(std::shared_ptr<libcamera::Camera> camera,\n>> +int CameraCapabilities::initialize(std::shared_ptr<Camera> camera,\n>>                                     int orientation, int facing)\n>>   {\n>>          camera_ = camera;\n>> @@ -429,7 +429,7 @@ CameraCapabilities::initializeYUVResolutions(const PixelFormat &pixelFormat,\n>>   }\n>>\n>>   std::vector<Size>\n>> -CameraCapabilities::initializeRawResolutions(const libcamera::PixelFormat &pixelFormat)\n>> +CameraCapabilities::initializeRawResolutions(const PixelFormat &pixelFormat)\n>>   {\n>>          std::unique_ptr<CameraConfiguration> cameraConfig =\n>>                  camera_->generateConfiguration({ StreamRole::Raw });\n>> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n>> index 8ca76719..d782067e 100644\n>> --- a/src/android/camera_device.cpp\n>> +++ b/src/android/camera_device.cpp\n>> @@ -746,8 +746,8 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n>>   }\n>>\n>>   FrameBuffer *CameraDevice::createFrameBuffer(const buffer_handle_t camera3buffer,\n>> -                                            libcamera::PixelFormat pixelFormat,\n>> -                                            const libcamera::Size &size)\n>> +                                            PixelFormat pixelFormat,\n>> +                                            const Size &size)\n>>   {\n>>          FileDescriptor fd;\n>>          /*\n>> @@ -1140,7 +1140,7 @@ void CameraDevice::requestComplete(Request *request)\n>>          if (!resultMetadata) {\n>>                  notifyError(descriptor.frameNumber_, nullptr, CAMERA3_MSG_ERROR_RESULT);\n>>\n>> -               /* The camera framework expects an empy metadata pack on error. */\n>> +               /* The camera framework expects an empty metadata pack on error. */\n>>                  resultMetadata = std::make_unique<CameraMetadata>(0, 0);\n>>          }\n>>\n>> diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp\n>> index 01909ec7..0f5ae947 100644\n>> --- a/src/android/camera_stream.cpp\n>> +++ b/src/android/camera_stream.cpp\n>> @@ -98,7 +98,7 @@ int CameraStream::configure()\n>>          return 0;\n>>   }\n>>\n>> -int CameraStream::process(const libcamera::FrameBuffer &source,\n>> +int CameraStream::process(const FrameBuffer &source,\n>>                            buffer_handle_t camera3Dest,\n>>                            const CameraMetadata &requestMetadata,\n>>                            CameraMetadata *resultMetadata)\n>> @@ -139,7 +139,7 @@ FrameBuffer *CameraStream::getBuffer()\n>>          return buffer;\n>>   }\n>>\n>> -void CameraStream::putBuffer(libcamera::FrameBuffer *buffer)\n>> +void CameraStream::putBuffer(FrameBuffer *buffer)\n>>   {\n>>          if (!allocator_)\n>>                  return;\n>> diff --git a/src/android/camera_worker.cpp b/src/android/camera_worker.cpp\n>> index 98dddd9e..91313183 100644\n>> --- a/src/android/camera_worker.cpp\n>> +++ b/src/android/camera_worker.cpp\n>> @@ -27,7 +27,7 @@ LOG_DECLARE_CATEGORY(HAL)\n>>    * by the CameraWorker which queues it to the libcamera::Camera after handling\n>>    * fences.\n>>    */\n>> -CaptureRequest::CaptureRequest(libcamera::Camera *camera)\n>> +CaptureRequest::CaptureRequest(Camera *camera)\n>>          : camera_(camera)\n>>   {\n>>          request_ = camera_->createRequest(reinterpret_cast<uint64_t>(this));\n>> diff --git a/src/android/mm/cros_camera_buffer.cpp b/src/android/mm/cros_camera_buffer.cpp\n>> index 44993379..ec45e04c 100644\n>> --- a/src/android/mm/cros_camera_buffer.cpp\n>> +++ b/src/android/mm/cros_camera_buffer.cpp\n>> @@ -21,7 +21,7 @@ class CameraBuffer::Private : public Extensible::Private\n>>\n>>   public:\n>>          Private(CameraBuffer *cameraBuffer, buffer_handle_t camera3Buffer,\n>> -               libcamera::PixelFormat pixelFormat, const libcamera::Size &size,\n>> +               PixelFormat pixelFormat, const Size &size,\n>>                  int flags);\n>>          ~Private();\n>>\n>> @@ -53,8 +53,8 @@ private:\n>>\n>>   CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer,\n>>                                 buffer_handle_t camera3Buffer,\n>> -                              [[maybe_unused]] libcamera::PixelFormat pixelFormat,\n>> -                              [[maybe_unused]] const libcamera::Size &size,\n>> +                              [[maybe_unused]] PixelFormat pixelFormat,\n>> +                              [[maybe_unused]] const Size &size,\n>>                                 [[maybe_unused]] int flags)\n>>          : handle_(camera3Buffer), numPlanes_(0), mapped_(false),\n>>            registered_(false)\n>> diff --git a/src/android/mm/generic_camera_buffer.cpp b/src/android/mm/generic_camera_buffer.cpp\n>> index 22efc4d4..27a30e2d 100644\n>> --- a/src/android/mm/generic_camera_buffer.cpp\n>> +++ b/src/android/mm/generic_camera_buffer.cpp\n>> @@ -20,14 +20,13 @@ using namespace libcamera;\n>>   LOG_DECLARE_CATEGORY(HAL)\n>>\n>>   class CameraBuffer::Private : public Extensible::Private,\n>> -                             public libcamera::MappedBuffer\n>> +                             public MappedBuffer\n>>   {\n>>          LIBCAMERA_DECLARE_PUBLIC(CameraBuffer)\n>>\n>>   public:\n>>          Private(CameraBuffer *cameraBuffer, buffer_handle_t camera3Buffer,\n>> -               libcamera::PixelFormat pixelFormat, const libcamera::Size &size,\n>> -               int flags);\n>> +               PixelFormat pixelFormat, const Size &size, int flags);\n>>          ~Private();\n>>\n>>          unsigned int numPlanes() const;\n>> @@ -58,13 +57,13 @@ private:\n>>\n>>   CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer,\n>>                                 buffer_handle_t camera3Buffer,\n>> -                              libcamera::PixelFormat pixelFormat,\n>> -                              const libcamera::Size &size, int flags)\n>> +                              PixelFormat pixelFormat,\n>> +                              const Size &size, int flags)\n>>          : fd_(-1), flags_(flags), bufferLength_(-1), mapped_(false)\n>>   {\n>>          error_ = 0;\n>>\n>> -       const auto &info = libcamera::PixelFormatInfo::info(pixelFormat);\n>> +       const auto &info = PixelFormatInfo::info(pixelFormat);\n>>          if (!info.isValid()) {\n>>                  error_ = -EINVAL;\n>>                  LOG(HAL, Error) << \"Invalid pixel format: \"\n>> --\n>> 2.31.0\n>>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id D7EA2BD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 Sep 2021 08:40:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8F8F66916D;\n\tFri,  3 Sep 2021 10:40:11 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 89EA969165\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Sep 2021 10:40:09 +0200 (CEST)","from [192.168.1.104] (unknown [103.251.226.107])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A96101308;\n\tFri,  3 Sep 2021 10:40:08 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"SEG9sbX0\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1630658409;\n\tbh=5NdJZcSr025ycEuahjGHicUpFJv492jNbyfRjU3TxEc=;\n\th=Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=SEG9sbX0KdTe9IZHZ9lSDurXQcyXx2AhLxI1pU3oJ6VWsVt+vkQN/XB2gAm8Fjbhl\n\t0Fb+C9zPe4OBGFpkCiLB7P5PpJRQ51slc54syP9in5zdejCY6j6HIKF2XwF3v4jk5f\n\tH5QIGzhE6jLpebcK+nyzp1ayz6Ri3Eg6tH4STq3s=","To":"Hirokazu Honda <hiroh@chromium.org>","References":"<20210903075249.1083572-1-umang.jain@ideasonboard.com>\n\t<CAO5uPHMFdQwgVY-d9Jorr8H6Gup6jpvKMqdfPt4jr2jKQbhV=A@mail.gmail.com>","From":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<44c9de81-8909-06fc-4592-159d45144241@ideasonboard.com>","Date":"Fri, 3 Sep 2021 14:10:03 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.10.2","MIME-Version":"1.0","In-Reply-To":"<CAO5uPHMFdQwgVY-d9Jorr8H6Gup6jpvKMqdfPt4jr2jKQbhV=A@mail.gmail.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"8bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH] android: Cleanup libcamera namespace\n\tusage","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":19333,"web_url":"https://patchwork.libcamera.org/comment/19333/","msgid":"<CAO5uPHPNLuGZJFYFc1RaVeqhekkgaRUdF70Q=d5bg+=KYc4adw@mail.gmail.com>","date":"2021-09-03T09:07:16","subject":"Re: [libcamera-devel] [PATCH] android: Cleanup libcamera namespace\n\tusage","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Umang,\n\nOn Fri, Sep 3, 2021 at 5:40 PM Umang Jain <umang.jain@ideasonboard.com> wrote:\n>\n> Hiro,\n>\n>\n> On 9/3/21 2:04 PM, Hirokazu Honda wrote:\n> > Hi Umang, thank you for the patch.\n> >\n> >\n> > On Fri, Sep 3, 2021 at 4:52 PM Umang Jain <umang.jain@ideasonboard.com> wrote:\n> >> Usually .cpp files are equipped with using namespace libcamera;\n> >> Hence, it is unnecessary mentioning the explicit namespace of\n> >> libcamera at certain places.\n> >>\n> >> While at it, a small typo in a comment was noticed and fixed as\n> >> part of this patch.\n> >>\n> >> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> >> ---\n> >>   src/android/camera_capabilities.cpp      |  4 ++--\n> >>   src/android/camera_device.cpp            |  6 +++---\n> >>   src/android/camera_stream.cpp            |  4 ++--\n> >>   src/android/camera_worker.cpp            |  2 +-\n> >>   src/android/mm/cros_camera_buffer.cpp    |  6 +++---\n> >>   src/android/mm/generic_camera_buffer.cpp | 11 +++++------\n> > $ grep -l -r \"libcamera::\" --include \\*.cpp\n> > camera_device.cpp\n> > camera_capabilities.cpp\n> > camera_worker.cpp\n> > camera_stream.cpp\n> > mm/generic_camera_buffer.cpp\n> > mm/cros_camera_buffer.cpp\n> > jpeg/encoder_libjpeg.cpp\n> > jpeg/thumbnailer.cpp\n> >\n> > There are also cases in jpeg directories.\n> > Could you apply this change to them?\n>\n> Are you running this with the patch applied? :-)\n>\n\nSorry, I executed grep with my patch series\nhttps://patchwork.libcamera.org/project/libcamera/list/?series=2423.\nIt contains the unnecessary \"libcamera::\" in the change. I am\ndefinitely going to remove them in my patch series.\n\nI confirmed all the unnecessary libcamera in top of tree are removed\nin android with this patch.\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\n\nBest Regards,\n-Hiro\n> With his patch applied here, I get:\n>\n> [uajain@fedora android]$ grep -l -r \"libcamera::\" --include \\*.cpp\n> camera_device.cpp\n> camera_worker.cpp\n> camera_stream.cpp\n> [uajain@fedora android]$ git grep -ni \"libcamera::\" | grep \\.cpp\n> camera_device.cpp:54: * Reorder the configurations so that\n> libcamera::Camera can accept them as much\n> camera_device.cpp:253: * The CameraDevice class wraps a\n> libcamera::Camera instance, and implements\n> camera_device.cpp:315:     * If the libcamera::Camera provides those\n> information as retrieved\n> camera_device.cpp:1250:     * will have to be passed to the\n> libcamera::Camera and extracted\n> camera_device.cpp:1251:     * from libcamera::Request::metadata.\n> camera_stream.cpp:28: * camera framework to a\n> libcamera::StreamConfiguration.\n> camera_stream.cpp:40: * the associated libcamera::Stream, including the\n> creation of the encoder\n> camera_worker.cpp:23: * \\brief Wrap a libcamera::Request associated with\n> buffers and fences\n> camera_worker.cpp:27: * by the CameraWorker which queues it to the\n> libcamera::Camera after handling\n>\n> I don't think it would be wise to remove the `libcamera::` on comments.\n> They probably have some \"contextual\" value\n>\n>\n> >\n> > Thanks,\n> > -Hiro\n> >>   6 files changed, 16 insertions(+), 17 deletions(-)\n> >>\n> >> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> >> index c16e755f..e92bca42 100644\n> >> --- a/src/android/camera_capabilities.cpp\n> >> +++ b/src/android/camera_capabilities.cpp\n> >> @@ -378,7 +378,7 @@ void CameraCapabilities::computeHwLevel(\n> >>          hwLevel_ = hwLevel;\n> >>   }\n> >>\n> >> -int CameraCapabilities::initialize(std::shared_ptr<libcamera::Camera> camera,\n> >> +int CameraCapabilities::initialize(std::shared_ptr<Camera> camera,\n> >>                                     int orientation, int facing)\n> >>   {\n> >>          camera_ = camera;\n> >> @@ -429,7 +429,7 @@ CameraCapabilities::initializeYUVResolutions(const PixelFormat &pixelFormat,\n> >>   }\n> >>\n> >>   std::vector<Size>\n> >> -CameraCapabilities::initializeRawResolutions(const libcamera::PixelFormat &pixelFormat)\n> >> +CameraCapabilities::initializeRawResolutions(const PixelFormat &pixelFormat)\n> >>   {\n> >>          std::unique_ptr<CameraConfiguration> cameraConfig =\n> >>                  camera_->generateConfiguration({ StreamRole::Raw });\n> >> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> >> index 8ca76719..d782067e 100644\n> >> --- a/src/android/camera_device.cpp\n> >> +++ b/src/android/camera_device.cpp\n> >> @@ -746,8 +746,8 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n> >>   }\n> >>\n> >>   FrameBuffer *CameraDevice::createFrameBuffer(const buffer_handle_t camera3buffer,\n> >> -                                            libcamera::PixelFormat pixelFormat,\n> >> -                                            const libcamera::Size &size)\n> >> +                                            PixelFormat pixelFormat,\n> >> +                                            const Size &size)\n> >>   {\n> >>          FileDescriptor fd;\n> >>          /*\n> >> @@ -1140,7 +1140,7 @@ void CameraDevice::requestComplete(Request *request)\n> >>          if (!resultMetadata) {\n> >>                  notifyError(descriptor.frameNumber_, nullptr, CAMERA3_MSG_ERROR_RESULT);\n> >>\n> >> -               /* The camera framework expects an empy metadata pack on error. */\n> >> +               /* The camera framework expects an empty metadata pack on error. */\n> >>                  resultMetadata = std::make_unique<CameraMetadata>(0, 0);\n> >>          }\n> >>\n> >> diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp\n> >> index 01909ec7..0f5ae947 100644\n> >> --- a/src/android/camera_stream.cpp\n> >> +++ b/src/android/camera_stream.cpp\n> >> @@ -98,7 +98,7 @@ int CameraStream::configure()\n> >>          return 0;\n> >>   }\n> >>\n> >> -int CameraStream::process(const libcamera::FrameBuffer &source,\n> >> +int CameraStream::process(const FrameBuffer &source,\n> >>                            buffer_handle_t camera3Dest,\n> >>                            const CameraMetadata &requestMetadata,\n> >>                            CameraMetadata *resultMetadata)\n> >> @@ -139,7 +139,7 @@ FrameBuffer *CameraStream::getBuffer()\n> >>          return buffer;\n> >>   }\n> >>\n> >> -void CameraStream::putBuffer(libcamera::FrameBuffer *buffer)\n> >> +void CameraStream::putBuffer(FrameBuffer *buffer)\n> >>   {\n> >>          if (!allocator_)\n> >>                  return;\n> >> diff --git a/src/android/camera_worker.cpp b/src/android/camera_worker.cpp\n> >> index 98dddd9e..91313183 100644\n> >> --- a/src/android/camera_worker.cpp\n> >> +++ b/src/android/camera_worker.cpp\n> >> @@ -27,7 +27,7 @@ LOG_DECLARE_CATEGORY(HAL)\n> >>    * by the CameraWorker which queues it to the libcamera::Camera after handling\n> >>    * fences.\n> >>    */\n> >> -CaptureRequest::CaptureRequest(libcamera::Camera *camera)\n> >> +CaptureRequest::CaptureRequest(Camera *camera)\n> >>          : camera_(camera)\n> >>   {\n> >>          request_ = camera_->createRequest(reinterpret_cast<uint64_t>(this));\n> >> diff --git a/src/android/mm/cros_camera_buffer.cpp b/src/android/mm/cros_camera_buffer.cpp\n> >> index 44993379..ec45e04c 100644\n> >> --- a/src/android/mm/cros_camera_buffer.cpp\n> >> +++ b/src/android/mm/cros_camera_buffer.cpp\n> >> @@ -21,7 +21,7 @@ class CameraBuffer::Private : public Extensible::Private\n> >>\n> >>   public:\n> >>          Private(CameraBuffer *cameraBuffer, buffer_handle_t camera3Buffer,\n> >> -               libcamera::PixelFormat pixelFormat, const libcamera::Size &size,\n> >> +               PixelFormat pixelFormat, const Size &size,\n> >>                  int flags);\n> >>          ~Private();\n> >>\n> >> @@ -53,8 +53,8 @@ private:\n> >>\n> >>   CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer,\n> >>                                 buffer_handle_t camera3Buffer,\n> >> -                              [[maybe_unused]] libcamera::PixelFormat pixelFormat,\n> >> -                              [[maybe_unused]] const libcamera::Size &size,\n> >> +                              [[maybe_unused]] PixelFormat pixelFormat,\n> >> +                              [[maybe_unused]] const Size &size,\n> >>                                 [[maybe_unused]] int flags)\n> >>          : handle_(camera3Buffer), numPlanes_(0), mapped_(false),\n> >>            registered_(false)\n> >> diff --git a/src/android/mm/generic_camera_buffer.cpp b/src/android/mm/generic_camera_buffer.cpp\n> >> index 22efc4d4..27a30e2d 100644\n> >> --- a/src/android/mm/generic_camera_buffer.cpp\n> >> +++ b/src/android/mm/generic_camera_buffer.cpp\n> >> @@ -20,14 +20,13 @@ using namespace libcamera;\n> >>   LOG_DECLARE_CATEGORY(HAL)\n> >>\n> >>   class CameraBuffer::Private : public Extensible::Private,\n> >> -                             public libcamera::MappedBuffer\n> >> +                             public MappedBuffer\n> >>   {\n> >>          LIBCAMERA_DECLARE_PUBLIC(CameraBuffer)\n> >>\n> >>   public:\n> >>          Private(CameraBuffer *cameraBuffer, buffer_handle_t camera3Buffer,\n> >> -               libcamera::PixelFormat pixelFormat, const libcamera::Size &size,\n> >> -               int flags);\n> >> +               PixelFormat pixelFormat, const Size &size, int flags);\n> >>          ~Private();\n> >>\n> >>          unsigned int numPlanes() const;\n> >> @@ -58,13 +57,13 @@ private:\n> >>\n> >>   CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer,\n> >>                                 buffer_handle_t camera3Buffer,\n> >> -                              libcamera::PixelFormat pixelFormat,\n> >> -                              const libcamera::Size &size, int flags)\n> >> +                              PixelFormat pixelFormat,\n> >> +                              const Size &size, int flags)\n> >>          : fd_(-1), flags_(flags), bufferLength_(-1), mapped_(false)\n> >>   {\n> >>          error_ = 0;\n> >>\n> >> -       const auto &info = libcamera::PixelFormatInfo::info(pixelFormat);\n> >> +       const auto &info = PixelFormatInfo::info(pixelFormat);\n> >>          if (!info.isValid()) {\n> >>                  error_ = -EINVAL;\n> >>                  LOG(HAL, Error) << \"Invalid pixel format: \"\n> >> --\n> >> 2.31.0\n> >>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 26130BD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 Sep 2021 09:07:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 85C816916A;\n\tFri,  3 Sep 2021 11:07:29 +0200 (CEST)","from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com\n\t[IPv6:2a00:1450:4864:20::62c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3931C60251\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Sep 2021 11:07:28 +0200 (CEST)","by mail-ej1-x62c.google.com with SMTP id bt14so10701425ejb.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 03 Sep 2021 02:07:28 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"BnB3en8X\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=vUS+/y6/EewPGCfQhLb0C0OJSkGNjxfHHdMmfUujzVw=;\n\tb=BnB3en8XjeWDmcakyALndKlq+JVnT17miPRh5QFileh38JfzZXZuUyJsddQul3hSUh\n\tLLoKE0Y3VtPS0zC437az8FMGoelItmy+zANKiV8AXtsERkhpbKxxs/EX2s+cGSMwGIq2\n\tw39JeCqIhNC7Hqlb358loPnLVJuvBZ/xIGLc0=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=vUS+/y6/EewPGCfQhLb0C0OJSkGNjxfHHdMmfUujzVw=;\n\tb=Qa+1KAz8rjMhj1g3uvRCHGkBMgKxp6MKCBFlZZzekR7hTbXiS2nWNE+OBKl+gVI8wP\n\tK70FhxKW4CpbUeF1ub23aGdA22ChKht7f8hw/TJWoT68XKQYNLH8d3A2Xe1ToDTG4FkT\n\tv/UsLD+e/O+QjQI4+UYUfjYjYHq97ynGMt4KOlLKyc1cQNOEbV7e69W0gttEKXeSbV+G\n\tHsON9Jv/sUkN01FEHn/S3R+aKFk8gBB0DEMmHaYzAbIzaA5bFrMqhNE0Hr75HRaHfszw\n\tO/kus1UzY2HZv74w9WrzSsM98Wj/Dz/SN33PuOVE9wFlHgdP8t9w3abCn2+ug1gpotcR\n\tKXHQ==","X-Gm-Message-State":"AOAM532vd+2i49ryS+Xrs4JlRhH77wMqFbedfIHKygiKr4pHPnAfeZY8\n\t+jK1SIfJ1zOxZl0jKyplBKi+u6zGfVCR+ebEE5qrnv6LRnpwzg==","X-Google-Smtp-Source":"ABdhPJzO9PtrYVwl0vo5l3WH2sBIiTNL4XLYB6GA2JCe0MNzNj6MQYem3iF+wkvalDT8Vf7TLMQKSOo7i82EuodNqxo=","X-Received":"by 2002:a17:906:ec9:: with SMTP id\n\tu9mr2954851eji.243.1630660047689; \n\tFri, 03 Sep 2021 02:07:27 -0700 (PDT)","MIME-Version":"1.0","References":"<20210903075249.1083572-1-umang.jain@ideasonboard.com>\n\t<CAO5uPHMFdQwgVY-d9Jorr8H6Gup6jpvKMqdfPt4jr2jKQbhV=A@mail.gmail.com>\n\t<44c9de81-8909-06fc-4592-159d45144241@ideasonboard.com>","In-Reply-To":"<44c9de81-8909-06fc-4592-159d45144241@ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Fri, 3 Sep 2021 18:07:16 +0900","Message-ID":"<CAO5uPHPNLuGZJFYFc1RaVeqhekkgaRUdF70Q=d5bg+=KYc4adw@mail.gmail.com>","To":"Umang Jain <umang.jain@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH] android: Cleanup libcamera namespace\n\tusage","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":19388,"web_url":"https://patchwork.libcamera.org/comment/19388/","msgid":"<YTVOgpwEX3OJrKKN@pendragon.ideasonboard.com>","date":"2021-09-05T23:10:58","subject":"Re: [libcamera-devel] [PATCH] android: Cleanup libcamera namespace\n\tusage","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Umang,\n\nThank you for the patch.\n\nOn Fri, Sep 03, 2021 at 01:22:49PM +0530, Umang Jain wrote:\n> Usually .cpp files are equipped with using namespace libcamera;\n> Hence, it is unnecessary mentioning the explicit namespace of\n> libcamera at certain places.\n> \n> While at it, a small typo in a comment was noticed and fixed as\n> part of this patch.\n> \n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/android/camera_capabilities.cpp      |  4 ++--\n>  src/android/camera_device.cpp            |  6 +++---\n>  src/android/camera_stream.cpp            |  4 ++--\n>  src/android/camera_worker.cpp            |  2 +-\n>  src/android/mm/cros_camera_buffer.cpp    |  6 +++---\n>  src/android/mm/generic_camera_buffer.cpp | 11 +++++------\n>  6 files changed, 16 insertions(+), 17 deletions(-)\n> \n> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> index c16e755f..e92bca42 100644\n> --- a/src/android/camera_capabilities.cpp\n> +++ b/src/android/camera_capabilities.cpp\n> @@ -378,7 +378,7 @@ void CameraCapabilities::computeHwLevel(\n>  \thwLevel_ = hwLevel;\n>  }\n>  \n> -int CameraCapabilities::initialize(std::shared_ptr<libcamera::Camera> camera,\n> +int CameraCapabilities::initialize(std::shared_ptr<Camera> camera,\n>  \t\t\t\t   int orientation, int facing)\n>  {\n>  \tcamera_ = camera;\n> @@ -429,7 +429,7 @@ CameraCapabilities::initializeYUVResolutions(const PixelFormat &pixelFormat,\n>  }\n>  \n>  std::vector<Size>\n> -CameraCapabilities::initializeRawResolutions(const libcamera::PixelFormat &pixelFormat)\n> +CameraCapabilities::initializeRawResolutions(const PixelFormat &pixelFormat)\n>  {\n>  \tstd::unique_ptr<CameraConfiguration> cameraConfig =\n>  \t\tcamera_->generateConfiguration({ StreamRole::Raw });\n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index 8ca76719..d782067e 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -746,8 +746,8 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n>  }\n>  \n>  FrameBuffer *CameraDevice::createFrameBuffer(const buffer_handle_t camera3buffer,\n> -\t\t\t\t\t     libcamera::PixelFormat pixelFormat,\n> -\t\t\t\t\t     const libcamera::Size &size)\n> +\t\t\t\t\t     PixelFormat pixelFormat,\n> +\t\t\t\t\t     const Size &size)\n>  {\n>  \tFileDescriptor fd;\n>  \t/*\n> @@ -1140,7 +1140,7 @@ void CameraDevice::requestComplete(Request *request)\n>  \tif (!resultMetadata) {\n>  \t\tnotifyError(descriptor.frameNumber_, nullptr, CAMERA3_MSG_ERROR_RESULT);\n>  \n> -\t\t/* The camera framework expects an empy metadata pack on error. */\n> +\t\t/* The camera framework expects an empty metadata pack on error. */\n>  \t\tresultMetadata = std::make_unique<CameraMetadata>(0, 0);\n>  \t}\n>  \n> diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp\n> index 01909ec7..0f5ae947 100644\n> --- a/src/android/camera_stream.cpp\n> +++ b/src/android/camera_stream.cpp\n> @@ -98,7 +98,7 @@ int CameraStream::configure()\n>  \treturn 0;\n>  }\n>  \n> -int CameraStream::process(const libcamera::FrameBuffer &source,\n> +int CameraStream::process(const FrameBuffer &source,\n>  \t\t\t  buffer_handle_t camera3Dest,\n>  \t\t\t  const CameraMetadata &requestMetadata,\n>  \t\t\t  CameraMetadata *resultMetadata)\n> @@ -139,7 +139,7 @@ FrameBuffer *CameraStream::getBuffer()\n>  \treturn buffer;\n>  }\n>  \n> -void CameraStream::putBuffer(libcamera::FrameBuffer *buffer)\n> +void CameraStream::putBuffer(FrameBuffer *buffer)\n>  {\n>  \tif (!allocator_)\n>  \t\treturn;\n> diff --git a/src/android/camera_worker.cpp b/src/android/camera_worker.cpp\n> index 98dddd9e..91313183 100644\n> --- a/src/android/camera_worker.cpp\n> +++ b/src/android/camera_worker.cpp\n> @@ -27,7 +27,7 @@ LOG_DECLARE_CATEGORY(HAL)\n>   * by the CameraWorker which queues it to the libcamera::Camera after handling\n>   * fences.\n>   */\n> -CaptureRequest::CaptureRequest(libcamera::Camera *camera)\n> +CaptureRequest::CaptureRequest(Camera *camera)\n>  \t: camera_(camera)\n>  {\n>  \trequest_ = camera_->createRequest(reinterpret_cast<uint64_t>(this));\n> diff --git a/src/android/mm/cros_camera_buffer.cpp b/src/android/mm/cros_camera_buffer.cpp\n> index 44993379..ec45e04c 100644\n> --- a/src/android/mm/cros_camera_buffer.cpp\n> +++ b/src/android/mm/cros_camera_buffer.cpp\n> @@ -21,7 +21,7 @@ class CameraBuffer::Private : public Extensible::Private\n>  \n>  public:\n>  \tPrivate(CameraBuffer *cameraBuffer, buffer_handle_t camera3Buffer,\n> -\t\tlibcamera::PixelFormat pixelFormat, const libcamera::Size &size,\n> +\t\tPixelFormat pixelFormat, const Size &size,\n>  \t\tint flags);\n>  \t~Private();\n>  \n> @@ -53,8 +53,8 @@ private:\n>  \n>  CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer,\n>  \t\t\t       buffer_handle_t camera3Buffer,\n> -\t\t\t       [[maybe_unused]] libcamera::PixelFormat pixelFormat,\n> -\t\t\t       [[maybe_unused]] const libcamera::Size &size,\n> +\t\t\t       [[maybe_unused]] PixelFormat pixelFormat,\n> +\t\t\t       [[maybe_unused]] const Size &size,\n>  \t\t\t       [[maybe_unused]] int flags)\n>  \t: handle_(camera3Buffer), numPlanes_(0), mapped_(false),\n>  \t  registered_(false)\n> diff --git a/src/android/mm/generic_camera_buffer.cpp b/src/android/mm/generic_camera_buffer.cpp\n> index 22efc4d4..27a30e2d 100644\n> --- a/src/android/mm/generic_camera_buffer.cpp\n> +++ b/src/android/mm/generic_camera_buffer.cpp\n> @@ -20,14 +20,13 @@ using namespace libcamera;\n>  LOG_DECLARE_CATEGORY(HAL)\n>  \n>  class CameraBuffer::Private : public Extensible::Private,\n> -\t\t\t      public libcamera::MappedBuffer\n> +\t\t\t      public MappedBuffer\n>  {\n>  \tLIBCAMERA_DECLARE_PUBLIC(CameraBuffer)\n>  \n>  public:\n>  \tPrivate(CameraBuffer *cameraBuffer, buffer_handle_t camera3Buffer,\n> -\t\tlibcamera::PixelFormat pixelFormat, const libcamera::Size &size,\n> -\t\tint flags);\n> +\t\tPixelFormat pixelFormat, const Size &size, int flags);\n>  \t~Private();\n>  \n>  \tunsigned int numPlanes() const;\n> @@ -58,13 +57,13 @@ private:\n>  \n>  CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer,\n>  \t\t\t       buffer_handle_t camera3Buffer,\n> -\t\t\t       libcamera::PixelFormat pixelFormat,\n> -\t\t\t       const libcamera::Size &size, int flags)\n> +\t\t\t       PixelFormat pixelFormat,\n> +\t\t\t       const Size &size, int flags)\n>  \t: fd_(-1), flags_(flags), bufferLength_(-1), mapped_(false)\n>  {\n>  \terror_ = 0;\n>  \n> -\tconst auto &info = libcamera::PixelFormatInfo::info(pixelFormat);\n> +\tconst auto &info = PixelFormatInfo::info(pixelFormat);\n>  \tif (!info.isValid()) {\n>  \t\terror_ = -EINVAL;\n>  \t\tLOG(HAL, Error) << \"Invalid pixel format: \"","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 6AA73BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun,  5 Sep 2021 23:11:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DC9306916A;\n\tMon,  6 Sep 2021 01:11:17 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 75B5860254\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Sep 2021 01:11:16 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E0C0CD88;\n\tMon,  6 Sep 2021 01:11:15 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Z6NLJxWM\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1630883476;\n\tbh=tF1Q63iiKpbYAdtLgjhQN4aTDqO/nXLRc4sZrrN8F6g=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Z6NLJxWMq80alxkBbV4yRgy3uwWlVtsfKRsZS4r8wxs+U7X6520KleL6tSDZKeeJT\n\t6luBZwDeUo9Tkxu25T03Yzxhx1O8Lv8dNiGDe1OG4Bfh4L3PaxnXJbgCDUzD5AjfVK\n\teCxs0OVYKwFus6hMoZQXoGUMdRPBPhdAxlqWYElA=","Date":"Mon, 6 Sep 2021 02:10:58 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<YTVOgpwEX3OJrKKN@pendragon.ideasonboard.com>","References":"<20210903075249.1083572-1-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210903075249.1083572-1-umang.jain@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] android: Cleanup libcamera namespace\n\tusage","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]