<div dir="ltr"><div dir="ltr">Hi Jacopo,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 16, 2024 at 3:35 PM Jacopo Mondi <<a href="mailto:jacopo.mondi@ideasonboard.com">jacopo.mondi@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Harvey<br>
<br>
On Mon, Sep 16, 2024 at 04:51:54AM GMT, Harvey Yang wrote:<br>
> Hi folks,<br>
><br>
> Currently applications set resolutions, pixelFormat, bufferCount, etc,<br>
> into StreamConfigurations, and Pipeline Handler decides which streams<br>
> they're assigned to. However, it doesn't allow application to assign<br>
> streams that cannot be distinguished by those arguments into<br>
> VideoRecording or StillCapture (say YUV/NV12 format), which is needed in<br>
> mtkisp7.<br>
<br>
Could you explain in a bit more detail why this "is needed" and how<br>
you plan to use StreamRole as part of the stream configuration ?<br>
<br>
><br>
> This patch allows application to set the desired StreamRole directly.<br>
><br>
> This patch passed gitlab pipeline:<br>
> <a href="https://gitlab.freedesktop.org/chenghaoyang/libcamera/-/pipelines/1271770" rel="noreferrer" target="_blank">https://gitlab.freedesktop.org/chenghaoyang/libcamera/-/pipelines/1271770</a><br>
><br>
> It might be controversial. Let me know the concerns. Thanks!<br>
><br>
<br>
The fact is that roles are designed to hint libcamera about how to<br>
populate the CameraConfiguration, after that point they have no<br>
meaning anymore for the library.<br>
<br>
I presum you need this for Android, right ?</blockquote><div><br>Correct :)<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> Isn't it better to keep<br>
the association between the Android role and the libcamera Stream in<br>
the Android HAL instead ? </blockquote><div><br>Sorry, I don't quite get your point. What's the Android role?<br>When doing `validate()` or `configure()`, how does Android HAL/adapter let</div><div>Pipeline Handler know which StreamConfiguration the HAL desires it to</div><div>belong to?<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Be aware that the CameraConfiguration should<br>
be populated with StreamConfigurations in the same order as the<br>
StreamRole order the application asked for.<br></blockquote><div><br>Yes, I remember that.<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
If instead we want to keep the Role in Stream, it shouldn't be up to<br>
the application to populate it, but it should be the pipeline's<br>
generateConfiguration() function that should do this probably.<br>
<br></blockquote><div><br>Yes, actually in mtkisp7's implementation, that's how we do it [1].</div><div>Basically Android HAL/adapter will not change the StreamRole in</div><div>StreamConfiguration, while IIUC the API is designed in the way that</div><div>applications can change any attribute in a StreamConfiguration,</div><div>before calling `validate()` or `configuration()`, and </div><div>`Camera::generateConfiguration()` only provides the initial/suggested</div><div>configuration, right?</div><div><br></div><div>[1]: <a href="https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/third_party/libcamera/mtkisp7/src/libcamera/pipeline/mtkisp7/mtkisp7.cpp;l=563">https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/third_party/libcamera/mtkisp7/src/libcamera/pipeline/mtkisp7/mtkisp7.cpp;l=563</a><br> </div><div>BR,<br>Harvey</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Thanks<br>
j<br>
<br>
> BR,<br>
> Harvey<br>
><br>
><br>
><br>
> Han-Lin Chen (1):<br>
> libcamera: Add StreamRole into StreamConfiguration<br>
><br>
> include/libcamera/stream.h | 2 ++<br>
> src/libcamera/stream.cpp | 12 ++++++++++--<br>
> 2 files changed, 12 insertions(+), 2 deletions(-)<br>
><br>
> --<br>
> 2.46.0.662.g92d0881bb0-goog<br>
><br>
</blockquote></div></div>