diff mbox series

media-ctl: Add MEDIA_BUS_FMT_JPEG_1X8

Message ID 20220328135628.96966-1-jacopo@jmondi.org (mailing list archive)
State New, archived
Headers show
Series media-ctl: Add MEDIA_BUS_FMT_JPEG_1X8 | expand

Commit Message

Jacopo Mondi March 28, 2022, 1:56 p.m. UTC
Add the "JPEG" identifier to enable setting MEDIA_BUS_FMT_JPEG_1X8
media bus code.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 utils/media-ctl/libv4l2subdev.c | 1 +
 1 file changed, 1 insertion(+)

--
2.35.1

Comments

Laurent Pinchart March 28, 2022, 3:52 p.m. UTC | #1
Hi Jacopo,

Thank you for the patch.

On Mon, Mar 28, 2022 at 03:56:28PM +0200, Jacopo Mondi wrote:
> Add the "JPEG" identifier to enable setting MEDIA_BUS_FMT_JPEG_1X8
> media bus code.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> ---
>  utils/media-ctl/libv4l2subdev.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/utils/media-ctl/libv4l2subdev.c b/utils/media-ctl/libv4l2subdev.c
> index eb9e1cc43b7e..0f9ccc0a1552 100644
> --- a/utils/media-ctl/libv4l2subdev.c
> +++ b/utils/media-ctl/libv4l2subdev.c
> @@ -1084,6 +1084,7 @@ static const struct {
>  	{ "RBG24", MEDIA_BUS_FMT_RBG888_1X24 },
>  	{ "RGB32", MEDIA_BUS_FMT_RGB888_1X32_PADHI },
>  	{ "ARGB32", MEDIA_BUS_FMT_ARGB8888_1X32 },
> +	{ "JPEG", MEDIA_BUS_FMT_JPEG_1X8 },

I've just realized that media-ctl already supports JPEG, with the
"JPEG_1X8" format name. It looks like adding a shorter name isn't
needed.

>  };
> 
>  const char *v4l2_subdev_pixelcode_to_string(enum v4l2_mbus_pixelcode code)
Jacopo Mondi March 28, 2022, 4:01 p.m. UTC | #2
Hi Laurent

On Mon, Mar 28, 2022 at 06:52:50PM +0300, Laurent Pinchart wrote:
> Hi Jacopo,
>
> Thank you for the patch.
>
> On Mon, Mar 28, 2022 at 03:56:28PM +0200, Jacopo Mondi wrote:
> > Add the "JPEG" identifier to enable setting MEDIA_BUS_FMT_JPEG_1X8
> > media bus code.
> >
> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> > ---
> >  utils/media-ctl/libv4l2subdev.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/utils/media-ctl/libv4l2subdev.c b/utils/media-ctl/libv4l2subdev.c
> > index eb9e1cc43b7e..0f9ccc0a1552 100644
> > --- a/utils/media-ctl/libv4l2subdev.c
> > +++ b/utils/media-ctl/libv4l2subdev.c
> > @@ -1084,6 +1084,7 @@ static const struct {
> >  	{ "RBG24", MEDIA_BUS_FMT_RBG888_1X24 },
> >  	{ "RGB32", MEDIA_BUS_FMT_RGB888_1X32_PADHI },
> >  	{ "ARGB32", MEDIA_BUS_FMT_ARGB8888_1X32 },
> > +	{ "JPEG", MEDIA_BUS_FMT_JPEG_1X8 },
>
> I've just realized that media-ctl already supports JPEG, with the
> "JPEG_1X8" format name. It looks like adding a shorter name isn't
> needed.

$ git remote -v | grep origin
origin	git://linuxtv.org/v4l-utils.git (fetch)

$ git grep JPEG origin/master  -- utils/media-ctl/
origin/master:utils/media-ctl/libv4l2subdev.c:  { "jpeg", V4L2_COLORSPACE_JPEG },

What am I missing ?

>
> >  };
> >
> >  const char *v4l2_subdev_pixelcode_to_string(enum v4l2_mbus_pixelcode code)
>
> --
> Regards,
>
> Laurent Pinchart
Laurent Pinchart March 28, 2022, 4:07 p.m. UTC | #3
On Mon, Mar 28, 2022 at 06:01:59PM +0200, Jacopo Mondi wrote:
> On Mon, Mar 28, 2022 at 06:52:50PM +0300, Laurent Pinchart wrote:
> > On Mon, Mar 28, 2022 at 03:56:28PM +0200, Jacopo Mondi wrote:
> > > Add the "JPEG" identifier to enable setting MEDIA_BUS_FMT_JPEG_1X8
> > > media bus code.
> > >
> > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> > > ---
> > >  utils/media-ctl/libv4l2subdev.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/utils/media-ctl/libv4l2subdev.c b/utils/media-ctl/libv4l2subdev.c
> > > index eb9e1cc43b7e..0f9ccc0a1552 100644
> > > --- a/utils/media-ctl/libv4l2subdev.c
> > > +++ b/utils/media-ctl/libv4l2subdev.c
> > > @@ -1084,6 +1084,7 @@ static const struct {
> > >  	{ "RBG24", MEDIA_BUS_FMT_RBG888_1X24 },
> > >  	{ "RGB32", MEDIA_BUS_FMT_RGB888_1X32_PADHI },
> > >  	{ "ARGB32", MEDIA_BUS_FMT_ARGB8888_1X32 },
> > > +	{ "JPEG", MEDIA_BUS_FMT_JPEG_1X8 },
> >
> > I've just realized that media-ctl already supports JPEG, with the
> > "JPEG_1X8" format name. It looks like adding a shorter name isn't
> > needed.
> 
> $ git remote -v | grep origin
> origin	git://linuxtv.org/v4l-utils.git (fetch)
> 
> $ git grep JPEG origin/master  -- utils/media-ctl/
> origin/master:utils/media-ctl/libv4l2subdev.c:  { "jpeg", V4L2_COLORSPACE_JPEG },
> 
> What am I missing ?

#include "media-bus-format-names.h"

in utils/media-ctl/libv4l2subdev.c. That header is generated
automatically from the kernel headers.

> > >  };
> > >
> > >  const char *v4l2_subdev_pixelcode_to_string(enum v4l2_mbus_pixelcode code)
diff mbox series

Patch

diff --git a/utils/media-ctl/libv4l2subdev.c b/utils/media-ctl/libv4l2subdev.c
index eb9e1cc43b7e..0f9ccc0a1552 100644
--- a/utils/media-ctl/libv4l2subdev.c
+++ b/utils/media-ctl/libv4l2subdev.c
@@ -1084,6 +1084,7 @@  static const struct {
 	{ "RBG24", MEDIA_BUS_FMT_RBG888_1X24 },
 	{ "RGB32", MEDIA_BUS_FMT_RGB888_1X32_PADHI },
 	{ "ARGB32", MEDIA_BUS_FMT_ARGB8888_1X32 },
+	{ "JPEG", MEDIA_BUS_FMT_JPEG_1X8 },
 };

 const char *v4l2_subdev_pixelcode_to_string(enum v4l2_mbus_pixelcode code)