linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] media: usb: uvc: Add UVC_GUID_FORMAT_H265
@ 2022-04-18  9:06 James_Lin
  2022-04-19 11:46 ` Ricardo Ribalda
  0 siblings, 1 reply; 7+ messages in thread
From: James_Lin @ 2022-04-18  9:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: Laurent Pinchart, Mauro Carvalho Chehab, Matthias Brugger,
	Hans Verkuil, Ezequiel Garcia, Arnd Bergmann, Ricardo Ribalda,
	Sergey Senozhatsky, Alexandre Courbot, Sakari Ailus, linux-media,
	linux-arm-kernel, linux-mediatek, ping-lei.lin, sherlock.chang,
	lecopzer.chen, max.yan, tm.wu, James_Lin

This patch aims to add UVC_GUID_FORMAT_H265
High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2.
They describe the same video encoding method.
So for handling their behavior is the same.
However, when external camera device describes this encoding method, 
some use hevc, some use h265.
There is no uniform specification to describe this encoding method.
So if an external camera device use h265 to describe this encoding method,
driver will not recognize it.
Therefore, this patch is to enable driver to read HEVC/H265 
and convert it to V4L2_PIX_FMT_HEVC.

Signed-off-by: James_Lin <Ping-lei.Lin@mediatek.com>
---
 drivers/media/usb/uvc/uvc_driver.c | 5 +++++
 drivers/media/usb/uvc/uvcvideo.h   | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index dda0f0aa78b8..e437e9f95890 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -154,6 +154,11 @@ static struct uvc_format_desc uvc_fmts[] = {
 		.guid		= UVC_GUID_FORMAT_H264,
 		.fcc		= V4L2_PIX_FMT_H264,
 	},
+	{
+		.name		= "H.265",
+		.guid		= UVC_GUID_FORMAT_H265,
+		.fcc		= V4L2_PIX_FMT_HEVC,
+	},
 	{
 		.name		= "Greyscale 8 L/R (Y8I)",
 		.guid		= UVC_GUID_FORMAT_Y8I,
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index 143230b3275b..41f4d8c33f2a 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -139,6 +139,9 @@
 #define UVC_GUID_FORMAT_H264 \
 	{ 'H',  '2',  '6',  '4', 0x00, 0x00, 0x10, 0x00, \
 	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_H265 \
+	{ 'H',  '2',  '6',  '5', 0x00, 0x00, 0x10, 0x00, \
+	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
 #define UVC_GUID_FORMAT_Y8I \
 	{ 'Y',  '8',  'I',  ' ', 0x00, 0x00, 0x10, 0x00, \
 	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] media: usb: uvc: Add UVC_GUID_FORMAT_H265
  2022-04-18  9:06 [PATCH v3] media: usb: uvc: Add UVC_GUID_FORMAT_H265 James_Lin
@ 2022-04-19 11:46 ` Ricardo Ribalda
  2022-04-19 12:17   ` Laurent Pinchart
  0 siblings, 1 reply; 7+ messages in thread
From: Ricardo Ribalda @ 2022-04-19 11:46 UTC (permalink / raw)
  To: James_Lin
  Cc: linux-kernel, Laurent Pinchart, Mauro Carvalho Chehab,
	Matthias Brugger, Hans Verkuil, Ezequiel Garcia, Arnd Bergmann,
	Sergey Senozhatsky, Alexandre Courbot, Sakari Ailus, linux-media,
	linux-arm-kernel, linux-mediatek, sherlock.chang, lecopzer.chen,
	max.yan, tm.wu

Hi James

Thanks for your patch

On Mon, 18 Apr 2022 at 11:07, James_Lin <Ping-lei.Lin@mediatek.com> wrote:
>
> This patch aims to add UVC_GUID_FORMAT_H265
> High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2.
> They describe the same video encoding method.
> So for handling their behavior is the same.
> However, when external camera device describes this encoding method,
> some use hevc, some use h265.
> There is no uniform specification to describe this encoding method.
> So if an external camera device use h265 to describe this encoding method,
> driver will not recognize it.
> Therefore, this patch is to enable driver to read HEVC/H265
> and convert it to V4L2_PIX_FMT_HEVC.
>
> Signed-off-by: James_Lin <Ping-lei.Lin@mediatek.com>

Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>

> ---
>  drivers/media/usb/uvc/uvc_driver.c | 5 +++++
>  drivers/media/usb/uvc/uvcvideo.h   | 3 +++
>  2 files changed, 8 insertions(+)
>
> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> index dda0f0aa78b8..e437e9f95890 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -154,6 +154,11 @@ static struct uvc_format_desc uvc_fmts[] = {
>                 .guid           = UVC_GUID_FORMAT_H264,
>                 .fcc            = V4L2_PIX_FMT_H264,
>         },

Maybe I would add a comment here saying that some cameras represent
hevc as h265.

> +       {
> +               .name           = "H.265",
> +               .guid           = UVC_GUID_FORMAT_H265,
> +               .fcc            = V4L2_PIX_FMT_HEVC,
> +       },
>         {
>                 .name           = "Greyscale 8 L/R (Y8I)",
>                 .guid           = UVC_GUID_FORMAT_Y8I,
> diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
> index 143230b3275b..41f4d8c33f2a 100644
> --- a/drivers/media/usb/uvc/uvcvideo.h
> +++ b/drivers/media/usb/uvc/uvcvideo.h
> @@ -139,6 +139,9 @@
>  #define UVC_GUID_FORMAT_H264 \
>         { 'H',  '2',  '6',  '4', 0x00, 0x00, 0x10, 0x00, \
>          0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> +#define UVC_GUID_FORMAT_H265 \
> +       { 'H',  '2',  '6',  '5', 0x00, 0x00, 0x10, 0x00, \
> +        0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
>  #define UVC_GUID_FORMAT_Y8I \
>         { 'Y',  '8',  'I',  ' ', 0x00, 0x00, 0x10, 0x00, \
>          0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> --
> 2.18.0
>


-- 
Ricardo Ribalda

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] media: usb: uvc: Add UVC_GUID_FORMAT_H265
  2022-04-19 11:46 ` Ricardo Ribalda
@ 2022-04-19 12:17   ` Laurent Pinchart
  2022-04-19 12:18     ` Ricardo Ribalda
  0 siblings, 1 reply; 7+ messages in thread
From: Laurent Pinchart @ 2022-04-19 12:17 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: James_Lin, linux-kernel, Mauro Carvalho Chehab, Matthias Brugger,
	Hans Verkuil, Ezequiel Garcia, Arnd Bergmann, Sergey Senozhatsky,
	Alexandre Courbot, Sakari Ailus, linux-media, linux-arm-kernel,
	linux-mediatek, sherlock.chang, lecopzer.chen, max.yan, tm.wu

Hello,

On Tue, Apr 19, 2022 at 01:46:15PM +0200, Ricardo Ribalda wrote:
> On Mon, 18 Apr 2022 at 11:07, James_Lin <Ping-lei.Lin@mediatek.com> wrote:
> >
> > This patch aims to add UVC_GUID_FORMAT_H265
> > High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2.
> > They describe the same video encoding method.
> > So for handling their behavior is the same.
> > However, when external camera device describes this encoding method,
> > some use hevc, some use h265.
> > There is no uniform specification to describe this encoding method.
> > So if an external camera device use h265 to describe this encoding method,
> > driver will not recognize it.
> > Therefore, this patch is to enable driver to read HEVC/H265
> > and convert it to V4L2_PIX_FMT_HEVC.
> >
> > Signed-off-by: James_Lin <Ping-lei.Lin@mediatek.com>
> 
> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
> > ---
> >  drivers/media/usb/uvc/uvc_driver.c | 5 +++++
> >  drivers/media/usb/uvc/uvcvideo.h   | 3 +++
> >  2 files changed, 8 insertions(+)
> >
> > diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> > index dda0f0aa78b8..e437e9f95890 100644
> > --- a/drivers/media/usb/uvc/uvc_driver.c
> > +++ b/drivers/media/usb/uvc/uvc_driver.c
> > @@ -154,6 +154,11 @@ static struct uvc_format_desc uvc_fmts[] = {
> >                 .guid           = UVC_GUID_FORMAT_H264,
> >                 .fcc            = V4L2_PIX_FMT_H264,
> >         },
> 
> Maybe I would add a comment here saying that some cameras represent
> hevc as h265.

I wish there would be a 4CC and GUID standard with a centralized
registry...

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> > +       {
> > +               .name           = "H.265",
> > +               .guid           = UVC_GUID_FORMAT_H265,
> > +               .fcc            = V4L2_PIX_FMT_HEVC,
> > +       },
> >         {
> >                 .name           = "Greyscale 8 L/R (Y8I)",
> >                 .guid           = UVC_GUID_FORMAT_Y8I,
> > diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
> > index 143230b3275b..41f4d8c33f2a 100644
> > --- a/drivers/media/usb/uvc/uvcvideo.h
> > +++ b/drivers/media/usb/uvc/uvcvideo.h
> > @@ -139,6 +139,9 @@
> >  #define UVC_GUID_FORMAT_H264 \
> >         { 'H',  '2',  '6',  '4', 0x00, 0x00, 0x10, 0x00, \
> >          0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > +#define UVC_GUID_FORMAT_H265 \
> > +       { 'H',  '2',  '6',  '5', 0x00, 0x00, 0x10, 0x00, \
> > +        0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> >  #define UVC_GUID_FORMAT_Y8I \
> >         { 'Y',  '8',  'I',  ' ', 0x00, 0x00, 0x10, 0x00, \
> >          0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] media: usb: uvc: Add UVC_GUID_FORMAT_H265
  2022-04-19 12:17   ` Laurent Pinchart
@ 2022-04-19 12:18     ` Ricardo Ribalda
  2022-04-19 17:36       ` Nicolas Dufresne
  0 siblings, 1 reply; 7+ messages in thread
From: Ricardo Ribalda @ 2022-04-19 12:18 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: James_Lin, linux-kernel, Mauro Carvalho Chehab, Matthias Brugger,
	Hans Verkuil, Ezequiel Garcia, Arnd Bergmann, Sergey Senozhatsky,
	Alexandre Courbot, Sakari Ailus, linux-media, linux-arm-kernel,
	linux-mediatek, sherlock.chang, lecopzer.chen, max.yan, tm.wu

On Tue, 19 Apr 2022 at 14:17, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hello,
>
> On Tue, Apr 19, 2022 at 01:46:15PM +0200, Ricardo Ribalda wrote:
> > On Mon, 18 Apr 2022 at 11:07, James_Lin <Ping-lei.Lin@mediatek.com> wrote:
> > >
> > > This patch aims to add UVC_GUID_FORMAT_H265
> > > High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2.
> > > They describe the same video encoding method.
> > > So for handling their behavior is the same.
> > > However, when external camera device describes this encoding method,
> > > some use hevc, some use h265.
> > > There is no uniform specification to describe this encoding method.
> > > So if an external camera device use h265 to describe this encoding method,
> > > driver will not recognize it.
> > > Therefore, this patch is to enable driver to read HEVC/H265
> > > and convert it to V4L2_PIX_FMT_HEVC.
> > >
> > > Signed-off-by: James_Lin <Ping-lei.Lin@mediatek.com>
> >
> > Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
> > > ---
> > >  drivers/media/usb/uvc/uvc_driver.c | 5 +++++
> > >  drivers/media/usb/uvc/uvcvideo.h   | 3 +++
> > >  2 files changed, 8 insertions(+)
> > >
> > > diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> > > index dda0f0aa78b8..e437e9f95890 100644
> > > --- a/drivers/media/usb/uvc/uvc_driver.c
> > > +++ b/drivers/media/usb/uvc/uvc_driver.c
> > > @@ -154,6 +154,11 @@ static struct uvc_format_desc uvc_fmts[] = {
> > >                 .guid           = UVC_GUID_FORMAT_H264,
> > >                 .fcc            = V4L2_PIX_FMT_H264,
> > >         },
> >
> > Maybe I would add a comment here saying that some cameras represent
> > hevc as h265.
>
> I wish there would be a 4CC and GUID standard with a centralized
> registry...

Thought that was the kernel codebase :)

>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> > > +       {
> > > +               .name           = "H.265",
> > > +               .guid           = UVC_GUID_FORMAT_H265,
> > > +               .fcc            = V4L2_PIX_FMT_HEVC,
> > > +       },
> > >         {
> > >                 .name           = "Greyscale 8 L/R (Y8I)",
> > >                 .guid           = UVC_GUID_FORMAT_Y8I,
> > > diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
> > > index 143230b3275b..41f4d8c33f2a 100644
> > > --- a/drivers/media/usb/uvc/uvcvideo.h
> > > +++ b/drivers/media/usb/uvc/uvcvideo.h
> > > @@ -139,6 +139,9 @@
> > >  #define UVC_GUID_FORMAT_H264 \
> > >         { 'H',  '2',  '6',  '4', 0x00, 0x00, 0x10, 0x00, \
> > >          0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > > +#define UVC_GUID_FORMAT_H265 \
> > > +       { 'H',  '2',  '6',  '5', 0x00, 0x00, 0x10, 0x00, \
> > > +        0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > >  #define UVC_GUID_FORMAT_Y8I \
> > >         { 'Y',  '8',  'I',  ' ', 0x00, 0x00, 0x10, 0x00, \
> > >          0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
>
> --
> Regards,
>
> Laurent Pinchart



-- 
Ricardo Ribalda

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] media: usb: uvc: Add UVC_GUID_FORMAT_H265
  2022-04-19 12:18     ` Ricardo Ribalda
@ 2022-04-19 17:36       ` Nicolas Dufresne
  2022-04-21  9:23         ` James_Lin
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Dufresne @ 2022-04-19 17:36 UTC (permalink / raw)
  To: Ricardo Ribalda, Laurent Pinchart
  Cc: James_Lin, linux-kernel, Mauro Carvalho Chehab, Matthias Brugger,
	Hans Verkuil, Ezequiel Garcia, Arnd Bergmann, Sergey Senozhatsky,
	Alexandre Courbot, Sakari Ailus, linux-media, linux-arm-kernel,
	linux-mediatek, sherlock.chang, lecopzer.chen, max.yan, tm.wu

Le mardi 19 avril 2022 à 14:18 +0200, Ricardo Ribalda a écrit :
> On Tue, 19 Apr 2022 at 14:17, Laurent Pinchart
> <laurent.pinchart@ideasonboard.com> wrote:
> > 
> > Hello,
> > 
> > On Tue, Apr 19, 2022 at 01:46:15PM +0200, Ricardo Ribalda wrote:
> > > On Mon, 18 Apr 2022 at 11:07, James_Lin <Ping-lei.Lin@mediatek.com> wrote:
> > > > 
> > > > This patch aims to add UVC_GUID_FORMAT_H265
> > > > High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2.
> > > > They describe the same video encoding method.
> > > > So for handling their behavior is the same.
> > > > However, when external camera device describes this encoding method,
> > > > some use hevc, some use h265.
> > > > There is no uniform specification to describe this encoding method.
> > > > So if an external camera device use h265 to describe this encoding method,
> > > > driver will not recognize it.
> > > > Therefore, this patch is to enable driver to read HEVC/H265
> > > > and convert it to V4L2_PIX_FMT_HEVC.
> > > > 
> > > > Signed-off-by: James_Lin <Ping-lei.Lin@mediatek.com>
> > > 
> > > Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
> > > > ---
> > > >  drivers/media/usb/uvc/uvc_driver.c | 5 +++++
> > > >  drivers/media/usb/uvc/uvcvideo.h   | 3 +++
> > > >  2 files changed, 8 insertions(+)
> > > > 
> > > > diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> > > > index dda0f0aa78b8..e437e9f95890 100644
> > > > --- a/drivers/media/usb/uvc/uvc_driver.c
> > > > +++ b/drivers/media/usb/uvc/uvc_driver.c
> > > > @@ -154,6 +154,11 @@ static struct uvc_format_desc uvc_fmts[] = {
> > > >                 .guid           = UVC_GUID_FORMAT_H264,
> > > >                 .fcc            = V4L2_PIX_FMT_H264,
> > > >         },
> > > 
> > > Maybe I would add a comment here saying that some cameras represent
> > > hevc as h265.
> > 
> > I wish there would be a 4CC and GUID standard with a centralized
> > registry...
> 
> Thought that was the kernel codebase :)

You'll find multiple fourcc for the same thing in the linux kernel ;-P

> 
> > 
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > 
> > > > +       {
> > > > +               .name           = "H.265",
> > > > +               .guid           = UVC_GUID_FORMAT_H265,
> > > > +               .fcc            = V4L2_PIX_FMT_HEVC,
> > > > +       },
> > > >         {
> > > >                 .name           = "Greyscale 8 L/R (Y8I)",
> > > >                 .guid           = UVC_GUID_FORMAT_Y8I,
> > > > diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
> > > > index 143230b3275b..41f4d8c33f2a 100644
> > > > --- a/drivers/media/usb/uvc/uvcvideo.h
> > > > +++ b/drivers/media/usb/uvc/uvcvideo.h
> > > > @@ -139,6 +139,9 @@
> > > >  #define UVC_GUID_FORMAT_H264 \
> > > >         { 'H',  '2',  '6',  '4', 0x00, 0x00, 0x10, 0x00, \
> > > >          0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > > > +#define UVC_GUID_FORMAT_H265 \
> > > > +       { 'H',  '2',  '6',  '5', 0x00, 0x00, 0x10, 0x00, \
> > > > +        0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > > >  #define UVC_GUID_FORMAT_Y8I \
> > > >         { 'Y',  '8',  'I',  ' ', 0x00, 0x00, 0x10, 0x00, \
> > > >          0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > 
> > --
> > Regards,
> > 
> > Laurent Pinchart
> 
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] media: usb: uvc: Add UVC_GUID_FORMAT_H265
  2022-04-19 17:36       ` Nicolas Dufresne
@ 2022-04-21  9:23         ` James_Lin
  2022-04-24 22:04           ` Laurent Pinchart
  0 siblings, 1 reply; 7+ messages in thread
From: James_Lin @ 2022-04-21  9:23 UTC (permalink / raw)
  To: nicolas
  Cc: Ping-lei.Lin, acourbot, arnd, ezequiel, hverkuil-cisco,
	laurent.pinchart, lecopzer.chen, linux-arm-kernel, linux-kernel,
	linux-media, linux-mediatek, matthias.bgg, max.yan, mchehab,
	ribalda, sakari.ailus, senozhatsky, sherlock.chang, tm.wu

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="y", Size: 3895 bytes --]

Hi All,

Do I need to add the comment 
"some cameras represent hevc as h265"
at /drivers/media/usb/uvc/uvc_driver.c ?
Also, is there anything else that needs to be modified?

Or can it move to queue on next merged window?
thanks for your reply

Best regards,
James_Lin

On WED, 20 Apr 2022 at 01:37, Nicolas Dufresne <nicolas@ndufresne.ca> wrote:
> Le mardi 19 avril 2022 à 14:18 +0200, Ricardo Ribalda a écrit :
> > On Tue, 19 Apr 2022 at 14:17, Laurent Pinchart 
> > <laurent.pinchart@ideasonboard.com> wrote:
> > > 
> > > Hello,
> > > 
> > > On Tue, Apr 19, 2022 at 01:46:15PM +0200, Ricardo Ribalda wrote:
> > > > On Mon, 18 Apr 2022 at 11:07, James_Lin <Ping-lei.Lin@mediatek.com> wrote:
> > > > > 
> > > > > This patch aims to add UVC_GUID_FORMAT_H265 High Efficiency 
> > > > > Video Coding (HEVC), also known as H.265 and MPEG-H Part 2.
> > > > > They describe the same video encoding method.
> > > > > So for handling their behavior is the same.
> > > > > However, when external camera device describes this encoding 
> > > > > method, some use hevc, some use h265.
> > > > > There is no uniform specification to describe this encoding method.
> > > > > So if an external camera device use h265 to describe this 
> > > > > encoding method, driver will not recognize it.
> > > > > Therefore, this patch is to enable driver to read HEVC/H265 and 
> > > > > convert it to V4L2_PIX_FMT_HEVC.
> > > > > 
> > > > > Signed-off-by: James_Lin <Ping-lei.Lin@mediatek.com>
> > > > 
> > > > Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
> > > > > ---
> > > > >  drivers/media/usb/uvc/uvc_driver.c | 5 +++++
> > > > >  drivers/media/usb/uvc/uvcvideo.h   | 3 +++
> > > > >  2 files changed, 8 insertions(+)
> > > > > 
> > > > > diff --git a/drivers/media/usb/uvc/uvc_driver.c 
> > > > > b/drivers/media/usb/uvc/uvc_driver.c
> > > > > index dda0f0aa78b8..e437e9f95890 100644
> > > > > --- a/drivers/media/usb/uvc/uvc_driver.c
> > > > > +++ b/drivers/media/usb/uvc/uvc_driver.c
> > > > > @@ -154,6 +154,11 @@ static struct uvc_format_desc uvc_fmts[] = {
> > > > >                 .guid           = UVC_GUID_FORMAT_H264,
> > > > >                 .fcc            = V4L2_PIX_FMT_H264,
> > > > >         },
> > > > 
> > > > Maybe I would add a comment here saying that some cameras 
> > > > represent hevc as h265.
> > > 
> > > I wish there would be a 4CC and GUID standard with a centralized 
> > > registry...
> > 
> > Thought that was the kernel codebase :)
> 
> You'll find multiple fourcc for the same thing in the linux kernel ;-P
> 
> > 
> > > 
> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > 
> > > > > +       {
> > > > > +               .name           = "H.265",
> > > > > +               .guid           = UVC_GUID_FORMAT_H265,
> > > > > +               .fcc            = V4L2_PIX_FMT_HEVC,
> > > > > +       },
> > > > >         {
> > > > >                 .name           = "Greyscale 8 L/R (Y8I)",
> > > > >                 .guid           = UVC_GUID_FORMAT_Y8I,
> > > > > diff --git a/drivers/media/usb/uvc/uvcvideo.h 
> > > > > b/drivers/media/usb/uvc/uvcvideo.h
> > > > > index 143230b3275b..41f4d8c33f2a 100644
> > > > > --- a/drivers/media/usb/uvc/uvcvideo.h
> > > > > +++ b/drivers/media/usb/uvc/uvcvideo.h
> > > > > @@ -139,6 +139,9 @@
> > > > >  #define UVC_GUID_FORMAT_H264 \
> > > > >         { 'H',  '2',  '6',  '4', 0x00, 0x00, 0x10, 0x00, \
> > > > >          0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > > > > +#define UVC_GUID_FORMAT_H265 \
> > > > > +       { 'H',  '2',  '6',  '5', 0x00, 0x00, 0x10, 0x00, \
> > > > > +        0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > > > >  #define UVC_GUID_FORMAT_Y8I \
> > > > >         { 'Y',  '8',  'I',  ' ', 0x00, 0x00, 0x10, 0x00, \
> > > > >          0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > > 
> > > --
> > > Regards,
> > > 
> > > Laurent Pinchart
> > 
> > 
> > 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] media: usb: uvc: Add UVC_GUID_FORMAT_H265
  2022-04-21  9:23         ` James_Lin
@ 2022-04-24 22:04           ` Laurent Pinchart
  0 siblings, 0 replies; 7+ messages in thread
From: Laurent Pinchart @ 2022-04-24 22:04 UTC (permalink / raw)
  To: James_Lin
  Cc: nicolas, acourbot, arnd, ezequiel, hverkuil-cisco, lecopzer.chen,
	linux-arm-kernel, linux-kernel, linux-media, linux-mediatek,
	matthias.bgg, max.yan, mchehab, ribalda, sakari.ailus,
	senozhatsky, sherlock.chang, tm.wu

Hi James,

On Thu, Apr 21, 2022 at 05:23:54PM +0800, James_Lin wrote:
> Hi All,
> 
> Do I need to add the comment 
> "some cameras represent hevc as h265"
> at /drivers/media/usb/uvc/uvc_driver.c ?
> Also, is there anything else that needs to be modified?
> 
> Or can it move to queue on next merged window?
> thanks for your reply

I've queued the patch in my tree and will send a pull request. I don't
think we need an additional comment, H.265 and HEVC being used
interchangeably isn't specific to UVC, and if someone gets puzzled by
this in the uvcvideo driver, there's always the git history.

> On WED, 20 Apr 2022 at 01:37, Nicolas Dufresne wrote:
> > Le mardi 19 avril 2022 à 14:18 +0200, Ricardo Ribalda a écrit :
> > > On Tue, 19 Apr 2022 at 14:17, Laurent Pinchart wrote:
> > > > On Tue, Apr 19, 2022 at 01:46:15PM +0200, Ricardo Ribalda wrote:
> > > > > On Mon, 18 Apr 2022 at 11:07, James_Lin <Ping-lei.Lin@mediatek.com> wrote:
> > > > > > 
> > > > > > This patch aims to add UVC_GUID_FORMAT_H265 High Efficiency 
> > > > > > Video Coding (HEVC), also known as H.265 and MPEG-H Part 2.
> > > > > > They describe the same video encoding method.
> > > > > > So for handling their behavior is the same.
> > > > > > However, when external camera device describes this encoding 
> > > > > > method, some use hevc, some use h265.
> > > > > > There is no uniform specification to describe this encoding method.
> > > > > > So if an external camera device use h265 to describe this 
> > > > > > encoding method, driver will not recognize it.
> > > > > > Therefore, this patch is to enable driver to read HEVC/H265 and 
> > > > > > convert it to V4L2_PIX_FMT_HEVC.
> > > > > > 
> > > > > > Signed-off-by: James_Lin <Ping-lei.Lin@mediatek.com>
> > > > > 
> > > > > Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
> > > > > > ---
> > > > > >  drivers/media/usb/uvc/uvc_driver.c | 5 +++++
> > > > > >  drivers/media/usb/uvc/uvcvideo.h   | 3 +++
> > > > > >  2 files changed, 8 insertions(+)
> > > > > > 
> > > > > > diff --git a/drivers/media/usb/uvc/uvc_driver.c 
> > > > > > b/drivers/media/usb/uvc/uvc_driver.c
> > > > > > index dda0f0aa78b8..e437e9f95890 100644
> > > > > > --- a/drivers/media/usb/uvc/uvc_driver.c
> > > > > > +++ b/drivers/media/usb/uvc/uvc_driver.c
> > > > > > @@ -154,6 +154,11 @@ static struct uvc_format_desc uvc_fmts[] = {
> > > > > >                 .guid           = UVC_GUID_FORMAT_H264,
> > > > > >                 .fcc            = V4L2_PIX_FMT_H264,
> > > > > >         },
> > > > > 
> > > > > Maybe I would add a comment here saying that some cameras 
> > > > > represent hevc as h265.
> > > > 
> > > > I wish there would be a 4CC and GUID standard with a centralized 
> > > > registry...
> > > 
> > > Thought that was the kernel codebase :)
> > 
> > You'll find multiple fourcc for the same thing in the linux kernel ;-P
> > 
> > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > > 
> > > > > > +       {
> > > > > > +               .name           = "H.265",
> > > > > > +               .guid           = UVC_GUID_FORMAT_H265,
> > > > > > +               .fcc            = V4L2_PIX_FMT_HEVC,
> > > > > > +       },
> > > > > >         {
> > > > > >                 .name           = "Greyscale 8 L/R (Y8I)",
> > > > > >                 .guid           = UVC_GUID_FORMAT_Y8I,
> > > > > > diff --git a/drivers/media/usb/uvc/uvcvideo.h 
> > > > > > b/drivers/media/usb/uvc/uvcvideo.h
> > > > > > index 143230b3275b..41f4d8c33f2a 100644
> > > > > > --- a/drivers/media/usb/uvc/uvcvideo.h
> > > > > > +++ b/drivers/media/usb/uvc/uvcvideo.h
> > > > > > @@ -139,6 +139,9 @@
> > > > > >  #define UVC_GUID_FORMAT_H264 \
> > > > > >         { 'H',  '2',  '6',  '4', 0x00, 0x00, 0x10, 0x00, \
> > > > > >          0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > > > > > +#define UVC_GUID_FORMAT_H265 \
> > > > > > +       { 'H',  '2',  '6',  '5', 0x00, 0x00, 0x10, 0x00, \
> > > > > > +        0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > > > > >  #define UVC_GUID_FORMAT_Y8I \
> > > > > >         { 'Y',  '8',  'I',  ' ', 0x00, 0x00, 0x10, 0x00, \
> > > > > >          0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-04-24 22:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-18  9:06 [PATCH v3] media: usb: uvc: Add UVC_GUID_FORMAT_H265 James_Lin
2022-04-19 11:46 ` Ricardo Ribalda
2022-04-19 12:17   ` Laurent Pinchart
2022-04-19 12:18     ` Ricardo Ribalda
2022-04-19 17:36       ` Nicolas Dufresne
2022-04-21  9:23         ` James_Lin
2022-04-24 22:04           ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).