diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2020-09-02 12:17:09 +0200 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2020-09-18 11:31:56 +0200 |
commit | 45fe8e99c83889816df320c6d27f7a2019744693 (patch) | |
tree | 85905a9a7f873d362f782977d2fc742942b985d4 /src/android/camera_device.cpp | |
parent | facadb188efa32e0846fb59b73d8d669b7686e29 (diff) |
android: camera_device: Make CameraStream a class
Complete the transformation of CameraStream into a class and provide
a read-only interface that allows to access its parameters but not
modify them at run-time.
No functional changes intended but this change aims to make the code
more robust by enforcing a stricter interface in the CameraStream class.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android/camera_device.cpp')
-rw-r--r-- | src/android/camera_device.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index b245c9a1..70d77a17 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -169,8 +169,9 @@ MappedCamera3Buffer::MappedCamera3Buffer(const buffer_handle_t camera3buffer, } } -CameraStream::CameraStream(PixelFormat f, Size s, unsigned int i, Encoder *e) - : format(f), size(s), index_(i), encoder_(e) +CameraStream::CameraStream(PixelFormat format, Size size, + unsigned int index, Encoder *encoder) + : format_(format), size_(size), index_(index), encoder_(encoder) { } @@ -1409,7 +1410,7 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques descriptor->buffers[i].buffer = camera3Buffers[i].buffer; /* Software streams are handled after hardware streams complete. */ - if (cameraStream->format == formats::MJPEG) + if (cameraStream->format() == formats::MJPEG) continue; /* @@ -1473,7 +1474,7 @@ void CameraDevice::requestComplete(Request *request) CameraStream *cameraStream = static_cast<CameraStream *>(descriptor->buffers[i].stream->priv); - if (cameraStream->format != formats::MJPEG) + if (cameraStream->format() != formats::MJPEG) continue; Encoder *encoder = cameraStream->encoder(); @@ -1508,7 +1509,7 @@ void CameraDevice::requestComplete(Request *request) exif.setMake("libcamera"); exif.setModel("cameraModel"); exif.setOrientation(orientation_); - exif.setSize(cameraStream->size); + exif.setSize(cameraStream->size()); /* * We set the frame's EXIF timestamp as the time of encode. * Since the precision we need for EXIF timestamp is only one |