[v1,1/1] gstreamer: Add raw support to libcamerasrc stream-role property
diff mbox series

Message ID 20251215145305.4187195-2-julien.vuillaumier@nxp.com
State Accepted
Commit 34c5cf2480bb096689424c404ec0c1949f38b279
Headers show
Series
  • gstreamer: Add raw support to libcamerasrc stream-role property
Related show

Commit Message

Julien Vuillaumier Dec. 15, 2025, 2:53 p.m. UTC
The current definition of the stream-role property of libcamerasrc
element does not allow for the Raw (0) value to be assigned.
That property is used to query the pipeline handlers through
generateConfiguration(roles) to retrieve the formats exposed to
the user. Not being able to specify the raw stream-role, bayer
formats are not reported so can not be used for caps negotiation.

Adding value stream-role=raw enables usage of bayer GStreamer pipelines
like:

`gst-launch-1.0 libcamerasrc camera-name=<name> src::stream-role=raw !
    video/x-bayer, format=bggr16le ! ...`

Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
---
 src/gstreamer/gstlibcamerapad.cpp | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Nicolas Dufresne Dec. 15, 2025, 3 p.m. UTC | #1
Hi Julien,

Le lundi 15 décembre 2025 à 15:53 +0100, Julien Vuillaumier a écrit :
> The current definition of the stream-role property of libcamerasrc
> element does not allow for the Raw (0) value to be assigned.
> That property is used to query the pipeline handlers through
> generateConfiguration(roles) to retrieve the formats exposed to
> the user. Not being able to specify the raw stream-role, bayer
> formats are not reported so can not be used for caps negotiation.
> 
> Adding value stream-role=raw enables usage of bayer GStreamer pipelines
> like:
> 
> `gst-launch-1.0 libcamerasrc camera-name=<name> src::stream-role=raw !
>     video/x-bayer, format=bggr16le ! ...`
> 
> Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>

Appreciated, patch looks good.

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

> ---
>  src/gstreamer/gstlibcamerapad.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/gstreamer/gstlibcamerapad.cpp
> b/src/gstreamer/gstlibcamerapad.cpp
> index b37c4b340..c1f7f16e8 100644
> --- a/src/gstreamer/gstlibcamerapad.cpp
> +++ b/src/gstreamer/gstlibcamerapad.cpp
> @@ -95,6 +95,10 @@ gst_libcamera_stream_role_get_type()
>  	static GType type = 0;
>  	static const GEnumValue values[] = {
>  		{
> +			static_cast<gint>(StreamRole::Raw),
> +			"libcamera::Raw",
> +			"raw",
> +		}, {
>  			static_cast<gint>(StreamRole::StillCapture),
>  			"libcamera::StillCapture",
>  			"still-capture",
Jacopo Mondi Dec. 15, 2025, 3:53 p.m. UTC | #2
Hi Julien

On Mon, Dec 15, 2025 at 10:00:49AM -0500, Nicolas Dufresne wrote:
> Hi Julien,
>
> Le lundi 15 décembre 2025 à 15:53 +0100, Julien Vuillaumier a écrit :
> > The current definition of the stream-role property of libcamerasrc
> > element does not allow for the Raw (0) value to be assigned.
> > That property is used to query the pipeline handlers through
> > generateConfiguration(roles) to retrieve the formats exposed to
> > the user. Not being able to specify the raw stream-role, bayer
> > formats are not reported so can not be used for caps negotiation.
> >
> > Adding value stream-role=raw enables usage of bayer GStreamer pipelines
> > like:
> >
> > `gst-launch-1.0 libcamerasrc camera-name=<name> src::stream-role=raw !
> >     video/x-bayer, format=bggr16le ! ...`
> >
> > Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
>
> Appreciated, patch looks good.
>
> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
>

Thanks, I still wonder if this was intentionally left out or not..

Anyway, looks sane indeed
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Thanks
  j

> > ---
> >  src/gstreamer/gstlibcamerapad.cpp | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/src/gstreamer/gstlibcamerapad.cpp
> > b/src/gstreamer/gstlibcamerapad.cpp
> > index b37c4b340..c1f7f16e8 100644
> > --- a/src/gstreamer/gstlibcamerapad.cpp
> > +++ b/src/gstreamer/gstlibcamerapad.cpp
> > @@ -95,6 +95,10 @@ gst_libcamera_stream_role_get_type()
> >  	static GType type = 0;
> >  	static const GEnumValue values[] = {
> >  		{
> > +			static_cast<gint>(StreamRole::Raw),
> > +			"libcamera::Raw",
> > +			"raw",
> > +		}, {
> >  			static_cast<gint>(StreamRole::StillCapture),
> >  			"libcamera::StillCapture",
> >  			"still-capture",

Patch
diff mbox series

diff --git a/src/gstreamer/gstlibcamerapad.cpp b/src/gstreamer/gstlibcamerapad.cpp
index b37c4b340..c1f7f16e8 100644
--- a/src/gstreamer/gstlibcamerapad.cpp
+++ b/src/gstreamer/gstlibcamerapad.cpp
@@ -95,6 +95,10 @@  gst_libcamera_stream_role_get_type()
 	static GType type = 0;
 	static const GEnumValue values[] = {
 		{
+			static_cast<gint>(StreamRole::Raw),
+			"libcamera::Raw",
+			"raw",
+		}, {
 			static_cast<gint>(StreamRole::StillCapture),
 			"libcamera::StillCapture",
 			"still-capture",