[PATCH 0/1] Add StreamRole into StreamConfiguration

Cheng-Hao Yang chenghaoyang at chromium.org
Mon Sep 16 09:51:00 CEST 2024


Hi Jacopo,

On Mon, Sep 16, 2024 at 3:35 PM Jacopo Mondi <jacopo.mondi at ideasonboard.com>
wrote:

> Hi Harvey
>
> On Mon, Sep 16, 2024 at 04:51:54AM GMT, Harvey Yang wrote:
> > Hi folks,
> >
> > Currently applications set resolutions, pixelFormat, bufferCount, etc,
> > into StreamConfigurations, and Pipeline Handler decides which streams
> > they're assigned to. However, it doesn't allow application to assign
> > streams that cannot be distinguished by those arguments into
> > VideoRecording or StillCapture (say YUV/NV12 format), which is needed in
> > mtkisp7.
>
> Could you explain in a bit more detail why this "is needed" and how
> you plan to use StreamRole as part of the stream configuration ?
>
> >
> > This patch allows application to set the desired StreamRole directly.
> >
> > This patch passed gitlab pipeline:
> >
> https://gitlab.freedesktop.org/chenghaoyang/libcamera/-/pipelines/1271770
> >
> > It might be controversial. Let me know the concerns. Thanks!
> >
>
> The fact is that roles are designed to hint libcamera about how to
> populate the CameraConfiguration, after that point they have no
> meaning anymore for the library.
>
> I presum you need this for Android, right ?


Correct :)


> Isn't it better to keep
> the association between the Android role and the libcamera Stream in
> the Android HAL instead ?


Sorry, I don't quite get your point. What's the Android role?
When doing `validate()` or `configure()`, how does Android HAL/adapter let
Pipeline Handler know which StreamConfiguration the HAL desires it to
belong to?


> Be aware that the CameraConfiguration should
> be populated with StreamConfigurations in the same order as the
> StreamRole order the application asked for.
>

Yes, I remember that.


>
> If instead we want to keep the Role in Stream, it shouldn't be up to
> the application to populate it, but it should be the pipeline's
> generateConfiguration() function that should do this probably.
>
>
Yes, actually in mtkisp7's implementation, that's how we do it [1].
Basically Android HAL/adapter will not change the StreamRole in
StreamConfiguration, while IIUC the API is designed in the way that
applications can change any attribute in a StreamConfiguration,
before calling `validate()` or `configuration()`, and
`Camera::generateConfiguration()` only provides the initial/suggested
configuration, right?

[1]:
https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/third_party/libcamera/mtkisp7/src/libcamera/pipeline/mtkisp7/mtkisp7.cpp;l=563

BR,
Harvey

Thanks
>   j
>
> > BR,
> > Harvey
> >
> >
> >
> > Han-Lin Chen (1):
> >   libcamera: Add StreamRole into StreamConfiguration
> >
> >  include/libcamera/stream.h |  2 ++
> >  src/libcamera/stream.cpp   | 12 ++++++++++--
> >  2 files changed, 12 insertions(+), 2 deletions(-)
> >
> > --
> > 2.46.0.662.g92d0881bb0-goog
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20240916/9a97fa8a/attachment.htm>


More information about the libcamera-devel mailing list