[libcamera-devel] [PATCH v2 0/4] Improve BayerFormat class

Sebastian Fricke sebastian.fricke.linux at gmail.com
Thu Dec 31 16:53:32 CET 2020


Improve BayerFormat class

This patch series adds unit-tests, the `fromV4L2PixelFormat` static
member function and the ==/!= operators to the BayerFormat class.

---

Changes since version 1:
* Convert the `fromV4L2PixelFormat` to a static member function, as it doesn't
  contain any self use.
* Adjust the current user of the old constructor (raspberryPi pipeline) to use
  the new function.
* Add the ==/!= operators to improve tests and to add helpful helper functions.
* Change the logic of `fromV4L2PixelFormat` by replace the search of a matching
  bayer format to a v4l2 pixel format with a search for a matching v4l2 pixel
  format to a bayer format.
* Remove the v4l2ToBayer mapping table as it lost it's last user
* Remove 'TEST \d:' & 'TEST \d: FAIL:' pattern from comments and messages
  within the unit tests.
* Convert variable names from snake_case to camelCase.
* Add an additional to test to confirm that we cannot get a V4L2PixelFormat
  from a BayerFormat not found in the mapping table.
* Add tests for the == & != operators
* Change the test within the Transform unit tests from a comparision of string
  formats to a direct compare of the BayerFormat objects.
* Unify the test error messages by enclosing the expected and actual string
  representations in ''
* Fix checkstyle errors.
* Add explaination for why the transpose functionality was ignored
  within the unit test.

---

Sebastian Fricke (4):
  libcamera: Add the fromV4L2PixelFormat function
  libcamera: Overload ==/!= operators for BayerFormats
  libcamera: pipeline: rpi: Adjust to new implementation
  test: Add unit tests for the BayerFormat class

 include/libcamera/internal/bayer_format.h     |   8 +
 src/libcamera/bayer_format.cpp                |  73 +++----
 .../pipeline/raspberrypi/raspberrypi.cpp      |   4 +-
 test/bayer_format.cpp                         | 202 ++++++++++++++++++
 test/meson.build                              |   1 +
 5 files changed, 241 insertions(+), 47 deletions(-)
 create mode 100644 test/bayer_format.cpp

-- 
2.25.1



More information about the libcamera-devel mailing list