diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2020-10-02 20:48:35 +0200 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2020-10-07 16:07:44 +0200 |
commit | 160bb0998bc47abefeb876be1ecbff9534960dbc (patch) | |
tree | a839b7dd82c276123286d674a899703afad48ebf /src/android/camera_device.cpp | |
parent | 3c84d88193c8807feb6cd426ce1bfc1d12e66ffa (diff) |
android: camera_stream: Construct with Android stream
Pass the android camera3_stream_t, and a libcamera::StreamConfiguration
to identify the source and destination parameters of this stream.
Pass a CameraDevice pointer to the CameraStream constructor to allow
retrieval of the StreamConfiguration associated with the CameraStream.
Also change the format on which the CameraDevice performs checks to
decide if post-processing is required, as the libcamera facing format is
not meaningful anymore, but the Android requested format should be used
instead.
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, 5 insertions, 6 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 9c9a5cfa..68970eb4 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1216,8 +1216,8 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) config_->addConfiguration(streamConfiguration); unsigned int index = config_->size() - 1; - streams_.emplace_back(format, size, CameraStream::Type::Direct, - index); + streams_.emplace_back(this, stream, streamConfiguration, + CameraStream::Type::Direct, index); stream->priv = static_cast<void *>(&streams_.back()); } @@ -1272,8 +1272,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) } StreamConfiguration &cfg = config_->at(index); - - streams_.emplace_back(formats::MJPEG, cfg.size, type, index); + streams_.emplace_back(this, jpegStream, cfg, type, index); jpegStream->priv = static_cast<void *>(&streams_.back()); } @@ -1405,7 +1404,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->camera3Stream().format == HAL_PIXEL_FORMAT_BLOB) continue; /* @@ -1469,7 +1468,7 @@ void CameraDevice::requestComplete(Request *request) CameraStream *cameraStream = static_cast<CameraStream *>(descriptor->buffers[i].stream->priv); - if (cameraStream->format() != formats::MJPEG) + if (cameraStream->camera3Stream().format != HAL_PIXEL_FORMAT_BLOB) continue; Encoder *encoder = cameraStream->encoder(); |