Message ID | 20200908134142.27470-9-jacopo@jmondi.org |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
Hi Jacopo, Thanks for your work. On 2020-09-08 15:41:39 +0200, Jacopo Mondi wrote: > We assumed HAL_PIXEL_FORMAT_BLOB is always mapped to libcamera::MJPEG > and at the moment this is true. To protect against future changes in the > mapping, inspect the Android format instead of the libcamera one. > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> > --- > src/android/camera_device.cpp | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp > index 2cad4fe76c3c..eab01d808917 100644 > --- a/src/android/camera_device.cpp > +++ b/src/android/camera_device.cpp > @@ -1210,7 +1210,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) > stream->priv = static_cast<void *>(&streams_[i]); > > /* Defer handling of MJPEG streams until all others are known. */ > - if (format == formats::MJPEG) > + if (stream->format == HAL_PIXEL_FORMAT_BLOB) > continue; > > StreamConfiguration streamConfiguration; > @@ -1225,10 +1225,9 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) > /* Now handle MJPEG streams, adding a new stream if required. */ > for (unsigned int i = 0; i < stream_list->num_streams; ++i) { > camera3_stream_t *stream = stream_list->streams[i]; > - PixelFormat format = toPixelFormat(stream->format); > bool match = false; > > - if (format != formats::MJPEG) > + if (stream->format != HAL_PIXEL_FORMAT_BLOB) > continue; > > /* Search for a compatible stream */ > -- > 2.28.0 > > _______________________________________________ > libcamera-devel mailing list > libcamera-devel@lists.libcamera.org > https://lists.libcamera.org/listinfo/libcamera-devel
Thanks for the patch. On Thu, Sep 10, 2020 at 7:52 PM Niklas Söderlund <niklas.soderlund@ragnatech.se> wrote: > > Hi Jacopo, > > Thanks for your work. > > On 2020-09-08 15:41:39 +0200, Jacopo Mondi wrote: > > We assumed HAL_PIXEL_FORMAT_BLOB is always mapped to libcamera::MJPEG > > and at the moment this is true. To protect against future changes in the > > mapping, inspect the Android format instead of the libcamera one. > > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> > > Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> > > > --- > > src/android/camera_device.cpp | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp > > index 2cad4fe76c3c..eab01d808917 100644 > > --- a/src/android/camera_device.cpp > > +++ b/src/android/camera_device.cpp > > @@ -1210,7 +1210,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) > > stream->priv = static_cast<void *>(&streams_[i]); > > > > /* Defer handling of MJPEG streams until all others are known. */ > > - if (format == formats::MJPEG) > > + if (stream->format == HAL_PIXEL_FORMAT_BLOB) > > continue; > > > > StreamConfiguration streamConfiguration; > > @@ -1225,10 +1225,9 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) > > /* Now handle MJPEG streams, adding a new stream if required. */ > > for (unsigned int i = 0; i < stream_list->num_streams; ++i) { > > camera3_stream_t *stream = stream_list->streams[i]; > > - PixelFormat format = toPixelFormat(stream->format); > > bool match = false; > > > > - if (format != formats::MJPEG) > > + if (stream->format != HAL_PIXEL_FORMAT_BLOB) > > continue; > > > > /* Search for a compatible stream */ > > -- > > 2.28.0 > > nit: This reverts the change on the patch 07/12. I would squash 07 and 08. Reviewed-by: Hirokazu Honda <hiroh@chromium.org> > > _______________________________________________ > > libcamera-devel mailing list > > libcamera-devel@lists.libcamera.org > > https://lists.libcamera.org/listinfo/libcamera-devel > > -- > Regards, > Niklas Söderlund > _______________________________________________ > libcamera-devel mailing list > libcamera-devel@lists.libcamera.org > https://lists.libcamera.org/listinfo/libcamera-devel
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 2cad4fe76c3c..eab01d808917 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1210,7 +1210,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) stream->priv = static_cast<void *>(&streams_[i]); /* Defer handling of MJPEG streams until all others are known. */ - if (format == formats::MJPEG) + if (stream->format == HAL_PIXEL_FORMAT_BLOB) continue; StreamConfiguration streamConfiguration; @@ -1225,10 +1225,9 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) /* Now handle MJPEG streams, adding a new stream if required. */ for (unsigned int i = 0; i < stream_list->num_streams; ++i) { camera3_stream_t *stream = stream_list->streams[i]; - PixelFormat format = toPixelFormat(stream->format); bool match = false; - if (format != formats::MJPEG) + if (stream->format != HAL_PIXEL_FORMAT_BLOB) continue; /* Search for a compatible stream */