[libcamera-devel,RFC,0/6] android: jpeg / software streams
mbox series

Message ID 20200721220126.202065-1-kieran.bingham@ideasonboard.com
Headers show
Series
  • android: jpeg / software streams
Related show

Message

Kieran Bingham July 21, 2020, 10:01 p.m. UTC
These patches are posted just for discussion points, they are most
certainly unfinished, and in a state of flux, but plumbing multiple
streams or software streams is becoming a blocker to others, and so to
is the lack of being able to run the Camera application.

With these patches, at least the camera application can run, albeit not
successfully write out a captured image yet.

The compression of the image is successfull, and has been tested by
directly writing the compressed data to temporary files.


At least the following is known to still warrant more work:

 - JPEG compression should use the raw interfaces to reduce conversions
   I hope to work on this next, but I have been keen to get the plumbing
   working, so performance improvements can happen after.

 - Error handling from libjpeg needs improving, and a custom error
   handler implementing.

 - I was going to strip out the non NV12 conversion functions, for rfc,
   but they're not actually that big. But they should be replaced by the
   raw interface where possible.

 - Added software streams likely need a validation cycle to determine
   what can be achieved by the libcamera streams.

 - Ideally the JPEG_MAX_SIZE should come from libjpeg, but that's a bit
   chicken and egg, as the JPEG_MAX_SIZE is a static property before we
   have knowledge of what stream size we will encode.

 - There's debug prints everywhere ;-)

 - It would be nice to not have to duplicate the PixelFormat information
   tables.

 - The JPEG compressor isn't actaully destructed yet, and I think there
   will be benefit to more refactoring of the CameraStream class and
   perhaps moving code to the CameraStream to handle actual frame
   processing.

 - The JPEG compression should be moved to happen in it's own thread to
   prevent blocking of any other processing.

Kieran Bingham (6):
  android: Introduce JPEG compression
  android: camera_device: Report configuration changes from validate()
  android: camera_device: Add ANDROID_JPEG_MAX_SIZE
  android: camera_device: Support MJPEG stream construction
  [HACK]: android: camera_device: Define JPEG size and quality
  android: camera_device: Provide a MappedCamera3Buffer

 src/android/camera_device.cpp        | 169 +++++++++++++++-
 src/android/camera_device.h          |   8 +
 src/android/jpeg/compressor.h        |  28 +++
 src/android/jpeg/compressor_jpeg.cpp | 279 +++++++++++++++++++++++++++
 src/android/jpeg/compressor_jpeg.h   |  44 +++++
 src/android/meson.build              |   1 +
 src/libcamera/meson.build            |   2 +
 7 files changed, 522 insertions(+), 9 deletions(-)
 create mode 100644 src/android/jpeg/compressor.h
 create mode 100644 src/android/jpeg/compressor_jpeg.cpp
 create mode 100644 src/android/jpeg/compressor_jpeg.h