<div dir="ltr"><div dir="ltr"><br></div>Hi Kieran,<div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 20 Jan 2023 at 10:40, Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com">kieran.bingham@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">Quoting Naushir Patuck (2023-01-20 08:04:41)<br>
> Hi all,<br>
> <br>
> <br>
> On Wed, 18 Jan 2023 at 10:09, Kieran Bingham <<br>
> <a href="mailto:kieran.bingham@ideasonboard.com" target="_blank">kieran.bingham@ideasonboard.com</a>> wrote:<br>
> <br>
> > Hi Naush,<br>
> ><br>
> > Quoting Naushir Patuck via libcamera-devel (2023-01-18 08:59:42)<br>
> > > Add a new hints flags field in the StreamConfiguration structure to<br>
> > allow the<br>
> > > application to specify certain intended behavior when driving libcamera.<br>
> > > Pipeline handlers are expected to look at these hint flags and may<br>
> > optimise<br>
> > > internal operations based on them.<br>
> > ><br>
> > > Currently, only one flag is listed, OptionalStream, which the<br>
> > application can<br>
> > > set to inform the pipeline handler that a buffer may not be provided on<br>
> > every<br>
> > > Request for a given stream.<br>
> ><br>
> > Sorry - Laurent had comments on this yesterday when I was discussing<br>
> > with him, so I don't know which way it will go yet...<br>
> ><br>
> > I still think this is the better way around, but we'll have to consider<br>
> > that this is an 'ABI' breakage, as now apps that were able to use two<br>
> > streams won't unless they explicitly provide all buffers or inform<br>
> > libcamera that they won't provide all buffers....<br>
> ><br>
> <br>
> Has there been any consensus reached on this?<br>
> I'm keen to get out an updated patch by the end of the day if any other<br>
> changes are needed.<br>
<br>
I'm still trying to get to the bottom of all the consequences either<br>
way.<br>
<br>
I'm afraid now I have a worry about 'my' suggestion to require<br>
applications to specify optional streams.<br>
<br>
At the moment, I think the only way to directly configure the sensor<br>
mode is to configure a raw stream, and then simply not request buffers<br>
on that stream. If we make it so applictions must declare that the<br>
stream is an OptionalStream - setting the raw sensor mode would likely<br>
have to directly inform that the raw buffers are not going to be<br>
provided.<br>
<br>
That might not be a bad thing, but I wanted to highlight it.<br>
<br>
Are there any other / better options to configure the sensor mode?<br></blockquote><div><br></div><div>This is the only way to configure a particular sensor mode with the existing API.</div><div><br></div><div>Regards,</div><div>Naush</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
--<br>
Kieran<br>
<br>
<br>
<br>
> <br>
> Regards,<br>
> Naush<br>
> <br>
> <br>
> ><br>
> ><br>
> > > Signed-off-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com" target="_blank">naush@raspberrypi.com</a>><br>
> > > ---<br>
> > > include/libcamera/stream.h | 8 ++++++++<br>
> > > src/libcamera/stream.cpp | 24 ++++++++++++++++++++++++<br>
> > > 2 files changed, 32 insertions(+)<br>
> > ><br>
> > > diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h<br>
> > > index 29235ddf0d8a..233ff0450451 100644<br>
> > > --- a/include/libcamera/stream.h<br>
> > > +++ b/include/libcamera/stream.h<br>
> > > @@ -13,6 +13,8 @@<br>
> > > #include <string><br>
> > > #include <vector><br>
> > ><br>
> > > +#include <libcamera/base/flags.h><br>
> > > +<br>
> > > #include <libcamera/color_space.h><br>
> > > #include <libcamera/framebuffer.h><br>
> > > #include <libcamera/geometry.h><br>
> > > @@ -51,6 +53,12 @@ struct StreamConfiguration {<br>
> > ><br>
> > > std::optional<ColorSpace> colorSpace;<br>
> > ><br>
> > > + enum class Hint {<br>
> > > + None = 0,<br>
> > > + OptionalStream = (1 << 0),<br>
> > > + };<br>
> > > + Flags<Hint> hints;<br>
> > > +<br>
> > > Stream *stream() const { return stream_; }<br>
> > > void setStream(Stream *stream) { stream_ = stream; }<br>
> > > const StreamFormats &formats() const { return formats_; }<br>
> > > diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp<br>
> > > index 67f308157fbf..b7de85f8b9c7 100644<br>
> > > --- a/src/libcamera/stream.cpp<br>
> > > +++ b/src/libcamera/stream.cpp<br>
> > > @@ -349,6 +349,30 @@ StreamConfiguration::StreamConfiguration(const<br>
> > StreamFormats &formats)<br>
> > > * color spaces can be supported and in what combinations.<br>
> > > */<br>
> > ><br>
> > > +/**<br>
> > > + * \enum StreamConfiguration::Hint<br>
> > > + * \brief List of available hint flags provided by the application for<br>
> > a stream<br>
> > > + *<br>
> > > + * \var StreamConfiguration::Hint::None<br>
> > > + * No hints for this stream.<br>
> > > + * \var StreamConfiguration::Hint::OptionalStream<br>
> > > + * Informs the pipeline handler that the application may not always<br>
> > provide a<br>
> > > + * buffer for the configured stream in every Request. This may ensure<br>
> > the<br>
> > > + * pipeline handler allocates additional stream buffers for internal<br>
> > use.<br>
> > > + */<br>
> > > +<br>
> > > +/**<br>
> > > + * \var StreamConfiguration::hints<br>
> > > + * \brief Application provided StreamConfiguration::Hint flags for<br>
> > specific<br>
> > > + * stream behavior<br>
> > > + *<br>
> > > + * Provides hints from the application to the pipeline handlers on how<br>
> > it<br>
> > > + * intends on handling a given configured stream. These hints may alter<br>
> > the<br>
> > > + * behavior of the pipeline handlers, for example, by allocating<br>
> > additional<br>
> > > + * buffers for internal use if an application does not guarantee<br>
> > buffers will be<br>
> > > + * provided in every Request for a stream.<br>
> > > + */<br>
> > > +<br>
> > > /**<br>
> > > * \fn StreamConfiguration::stream()<br>
> > > * \brief Retrieve the stream associated with the configuration<br>
> > > --<br>
> > > 2.25.1<br>
> > ><br>
> ><br>
</blockquote></div></div></div>