android: camera_device: Provide a toPixelFormat helper

Rather than converting pixelformats through the map, and then
dereferencing the iterator later, create a helper to explicitly return a
PixelFormat type.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Kieran Bingham 2020-06-26 09:58:49 +01:00
parent d35cf6e4e4
commit 43e3b8002b
2 changed files with 21 additions and 8 deletions

View file

@ -72,6 +72,7 @@ private:
std::tuple<uint32_t, uint32_t> calculateStaticMetadataSize();
void notifyShutter(uint32_t frameNumber, uint64_t timestamp);
void notifyError(uint32_t frameNumber, camera3_stream_t *stream);
libcamera::PixelFormat toPixelFormat(int format);
std::unique_ptr<CameraMetadata> getResultMetadata(int frame_number,
int64_t timestamp);