Message ID | 20200902152236.69770-10-jacopo@jmondi.org |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
Hi Jacopo, Thank you for the patch. On Wed, Sep 02, 2020 at 05:22:33PM +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. I'm not sure what you want to protest against. The second hunk is a small optimization, so I think that's good (and could be squashed with 08/12), but I'm not sure how the first hunk helps. Maybe the commit message should be expanded a bit ? The change itself is fine, Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> > --- > 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 7fc61e3e4da7..3630e87e8814 100644 > --- a/src/android/camera_device.cpp > +++ b/src/android/camera_device.cpp > @@ -1216,7 +1216,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; > @@ -1230,10 +1230,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 */
Hi Laurent, On Sun, Sep 06, 2020 at 12:42:32AM +0300, Laurent Pinchart wrote: > Hi Jacopo, > > Thank you for the patch. > > On Wed, Sep 02, 2020 at 05:22:33PM +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. > > I'm not sure what you want to protest against. The second hunk is a Against the fact we assume _BLOB -> MJPEG. Going forward I presume there will be more available JPEG mappings, right ? To my understanding MJPEG != JPEG, in example. > small optimization, so I think that's good (and could be squashed with > 08/12), but I'm not sure how the first hunk helps. Maybe the commit > message should be expanded a bit ? > > The change itself is fine, > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> > > --- > > 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 7fc61e3e4da7..3630e87e8814 100644 > > --- a/src/android/camera_device.cpp > > +++ b/src/android/camera_device.cpp > > @@ -1216,7 +1216,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; > > @@ -1230,10 +1230,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 */ > > -- > Regards, > > Laurent Pinchart
Hi Jacopo, On Mon, Sep 07, 2020 at 10:44:25AM +0200, Jacopo Mondi wrote: > On Sun, Sep 06, 2020 at 12:42:32AM +0300, Laurent Pinchart wrote: > > On Wed, Sep 02, 2020 at 05:22:33PM +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. > > > > I'm not sure what you want to protest against. The second hunk is a This should have read "protect" of course, not "protest" :-) > Against the fact we assume _BLOB -> MJPEG. Going forward I presume > there will be more available JPEG mappings, right ? To my > understanding MJPEG != JPEG, in example. BLOB == JPEG, and I don't foresee pipeline handlers provided anything else than formats::MJPEG (which may well be JFIF images, not MJPEG, but that's another story). > > small optimization, so I think that's good (and could be squashed with > > 08/12), but I'm not sure how the first hunk helps. Maybe the commit > > message should be expanded a bit ? > > > > The change itself is fine, > > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > > > > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> > > > --- > > > 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 7fc61e3e4da7..3630e87e8814 100644 > > > --- a/src/android/camera_device.cpp > > > +++ b/src/android/camera_device.cpp > > > @@ -1216,7 +1216,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; > > > @@ -1230,10 +1230,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 */
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 7fc61e3e4da7..3630e87e8814 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1216,7 +1216,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; @@ -1230,10 +1230,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 */