linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] New V4L2 CIDs for OMAP class of Devices.
@ 2009-03-20  5:19 Hardik Shah
  2009-03-30 11:58 ` Hans Verkuil
  0 siblings, 1 reply; 4+ messages in thread
From: Hardik Shah @ 2009-03-20  5:19 UTC (permalink / raw)
  To: linux-media; +Cc: linux-omap, Hardik Shah, Brijesh Jadav, Vaibhav Hiremath

Added V4L2_CID_BG_COLOR for background color setting.
Added V4L2_CID_ROTATION for rotation setting.
Above two ioclts are indepth discussed. Posting
again with the driver usage.

V4L2 supports chroma keying added new flags for the
source chroma keying which is exactly opposite of the
chorma keying supported by V4L2.  In current implementation
video data is replaced by the graphics buffer data for some
specific color.  While for the source chroma keying grahics
data is replaced by the video data for some specific color.
Both are exactly opposite so are mutually exclusive

Signed-off-by: Brijesh Jadav <brijesh.j@ti.com>
Signed-off-by: Hardik Shah <hardik.shah@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
---
 linux/drivers/media/video/v4l2-common.c |    7 +++++++
 linux/include/linux/videodev2.h         |    6 +++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/linux/drivers/media/video/v4l2-common.c b/linux/drivers/media/video/v4l2-common.c
index 3c42316..fa408f0 100644
--- a/linux/drivers/media/video/v4l2-common.c
+++ b/linux/drivers/media/video/v4l2-common.c
@@ -422,6 +422,8 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_CHROMA_AGC:		return "Chroma AGC";
 	case V4L2_CID_COLOR_KILLER:		return "Color Killer";
 	case V4L2_CID_COLORFX:			return "Color Effects";
+	case V4L2_CID_ROTATION:                 return "Rotation";
+	case V4L2_CID_BG_COLOR:                 return "Background color";

 	/* MPEG controls */
 	case V4L2_CID_MPEG_CLASS: 		return "MPEG Encoder Controls";
@@ -547,6 +549,10 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste
 		qctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
 		min = max = step = def = 0;
 		break;
+	case V4L2_CID_BG_COLOR:
+		 qctrl->type = V4L2_CTRL_TYPE_INTEGER;
+		 step = 1;
+		 break;
 	default:
 		qctrl->type = V4L2_CTRL_TYPE_INTEGER;
 		break;
@@ -571,6 +577,7 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste
 	case V4L2_CID_BLUE_BALANCE:
 	case V4L2_CID_GAMMA:
 	case V4L2_CID_SHARPNESS:
+	case V4L2_CID_BG_COLOR:
 		qctrl->flags |= V4L2_CTRL_FLAG_SLIDER;
 		break;
 	case V4L2_CID_PAN_RELATIVE:
diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h
index 2c83935..592d1c8 100644
--- a/linux/include/linux/videodev2.h
+++ b/linux/include/linux/videodev2.h
@@ -548,6 +548,7 @@ struct v4l2_framebuffer {
 #define V4L2_FBUF_CAP_LOCAL_ALPHA	0x0010
 #define V4L2_FBUF_CAP_GLOBAL_ALPHA	0x0020
 #define V4L2_FBUF_CAP_LOCAL_INV_ALPHA	0x0040
+#define V4L2_FBUF_CAP_SRC_CHROMAKEY	0x0080
 /*  Flags for the 'flags' field. */
 #define V4L2_FBUF_FLAG_PRIMARY		0x0001
 #define V4L2_FBUF_FLAG_OVERLAY		0x0002
@@ -555,6 +556,7 @@ struct v4l2_framebuffer {
 #define V4L2_FBUF_FLAG_LOCAL_ALPHA	0x0008
 #define V4L2_FBUF_FLAG_GLOBAL_ALPHA	0x0010
 #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA	0x0020
+#define V4L2_FBUF_FLAG_SRC_CHROMAKEY	0x0040

 struct v4l2_clip {
 	struct v4l2_rect        c;
@@ -882,6 +884,8 @@ enum v4l2_power_line_frequency {
 #define V4L2_CID_CHROMA_AGC                     (V4L2_CID_BASE+29)
 #define V4L2_CID_COLOR_KILLER                   (V4L2_CID_BASE+30)
 #define V4L2_CID_COLORFX			(V4L2_CID_BASE+31)
+#define V4L2_CID_ROTATION                     	(V4L2_CID_BASE+32)
+#define V4L2_CID_BG_COLOR                       (V4L2_CID_BASE+33)
 enum v4l2_colorfx {
 	V4L2_COLORFX_NONE	= 0,
 	V4L2_COLORFX_BW		= 1,
@@ -889,7 +893,7 @@ enum v4l2_colorfx {
 };

 /* last CID + 1 */
-#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+32)
+#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+34)

 /*  MPEG-class control IDs defined by V4L2 */
 #define V4L2_CID_MPEG_BASE 			(V4L2_CTRL_CLASS_MPEG | 0x900)
--
1.5.6


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

* Re: [PATCH 2/3] New V4L2 CIDs for OMAP class of Devices.
  2009-03-20  5:19 [PATCH 2/3] New V4L2 CIDs for OMAP class of Devices Hardik Shah
@ 2009-03-30 11:58 ` Hans Verkuil
  2009-04-06 11:51   ` Shah, Hardik
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Verkuil @ 2009-03-30 11:58 UTC (permalink / raw)
  To: Hardik Shah; +Cc: linux-media, linux-omap, Brijesh Jadav, Vaibhav Hiremath

On Friday 20 March 2009 06:19:57 Hardik Shah wrote:
> Added V4L2_CID_BG_COLOR for background color setting.
> Added V4L2_CID_ROTATION for rotation setting.
> Above two ioclts are indepth discussed. Posting
> again with the driver usage.
> 
> V4L2 supports chroma keying added new flags for the
> source chroma keying which is exactly opposite of the
> chorma keying supported by V4L2.  In current implementation
> video data is replaced by the graphics buffer data for some
> specific color.  While for the source chroma keying grahics
> data is replaced by the video data for some specific color.
> Both are exactly opposite so are mutually exclusive
> 
> Signed-off-by: Brijesh Jadav <brijesh.j@ti.com>
> Signed-off-by: Hardik Shah <hardik.shah@ti.com>
> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> ---
>  linux/drivers/media/video/v4l2-common.c |    7 +++++++
>  linux/include/linux/videodev2.h         |    6 +++++-
>  2 files changed, 12 insertions(+), 1 deletions(-)
> 
> diff --git a/linux/drivers/media/video/v4l2-common.c b/linux/drivers/media/video/v4l2-common.c
> index 3c42316..fa408f0 100644
> --- a/linux/drivers/media/video/v4l2-common.c
> +++ b/linux/drivers/media/video/v4l2-common.c
> @@ -422,6 +422,8 @@ const char *v4l2_ctrl_get_name(u32 id)
>  	case V4L2_CID_CHROMA_AGC:		return "Chroma AGC";
>  	case V4L2_CID_COLOR_KILLER:		return "Color Killer";
>  	case V4L2_CID_COLORFX:			return "Color Effects";
> +	case V4L2_CID_ROTATION:                 return "Rotation";

I'm having second thoughts about this name. I think V4L2_CID_ROTATE is better,
since it is an action ('you rotate an image') rather than a status ('what is
the rotation of an image').

What do you think?

> +	case V4L2_CID_BG_COLOR:                 return "Background color";
> 
>  	/* MPEG controls */
>  	case V4L2_CID_MPEG_CLASS: 		return "MPEG Encoder Controls";
> @@ -547,6 +549,10 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste
>  		qctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
>  		min = max = step = def = 0;
>  		break;
> +	case V4L2_CID_BG_COLOR:
> +		 qctrl->type = V4L2_CTRL_TYPE_INTEGER;
> +		 step = 1;
> +		 break;

Set the min to 0 and max to 0xffffff.

>  	default:
>  		qctrl->type = V4L2_CTRL_TYPE_INTEGER;
>  		break;
> @@ -571,6 +577,7 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste
>  	case V4L2_CID_BLUE_BALANCE:
>  	case V4L2_CID_GAMMA:
>  	case V4L2_CID_SHARPNESS:
> +	case V4L2_CID_BG_COLOR:

This definitely isn't a slider control.

>  		qctrl->flags |= V4L2_CTRL_FLAG_SLIDER;
>  		break;
>  	case V4L2_CID_PAN_RELATIVE:
> diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h
> index 2c83935..592d1c8 100644
> --- a/linux/include/linux/videodev2.h
> +++ b/linux/include/linux/videodev2.h
> @@ -548,6 +548,7 @@ struct v4l2_framebuffer {
>  #define V4L2_FBUF_CAP_LOCAL_ALPHA	0x0010
>  #define V4L2_FBUF_CAP_GLOBAL_ALPHA	0x0020
>  #define V4L2_FBUF_CAP_LOCAL_INV_ALPHA	0x0040
> +#define V4L2_FBUF_CAP_SRC_CHROMAKEY	0x0080
>  /*  Flags for the 'flags' field. */
>  #define V4L2_FBUF_FLAG_PRIMARY		0x0001
>  #define V4L2_FBUF_FLAG_OVERLAY		0x0002
> @@ -555,6 +556,7 @@ struct v4l2_framebuffer {
>  #define V4L2_FBUF_FLAG_LOCAL_ALPHA	0x0008
>  #define V4L2_FBUF_FLAG_GLOBAL_ALPHA	0x0010
>  #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA	0x0020
> +#define V4L2_FBUF_FLAG_SRC_CHROMAKEY	0x0040
> 
>  struct v4l2_clip {
>  	struct v4l2_rect        c;
> @@ -882,6 +884,8 @@ enum v4l2_power_line_frequency {
>  #define V4L2_CID_CHROMA_AGC                     (V4L2_CID_BASE+29)
>  #define V4L2_CID_COLOR_KILLER                   (V4L2_CID_BASE+30)
>  #define V4L2_CID_COLORFX			(V4L2_CID_BASE+31)
> +#define V4L2_CID_ROTATION                     	(V4L2_CID_BASE+32)
> +#define V4L2_CID_BG_COLOR                       (V4L2_CID_BASE+33)
>  enum v4l2_colorfx {
>  	V4L2_COLORFX_NONE	= 0,
>  	V4L2_COLORFX_BW		= 1,
> @@ -889,7 +893,7 @@ enum v4l2_colorfx {
>  };
> 
>  /* last CID + 1 */
> -#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+32)
> +#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+34)
> 
>  /*  MPEG-class control IDs defined by V4L2 */
>  #define V4L2_CID_MPEG_BASE 			(V4L2_CTRL_CLASS_MPEG | 0x900)
> --
> 1.5.6

Regards,

	Hans

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG

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

* RE: [PATCH 2/3] New V4L2 CIDs for OMAP class of Devices.
  2009-03-30 11:58 ` Hans Verkuil
@ 2009-04-06 11:51   ` Shah, Hardik
  0 siblings, 0 replies; 4+ messages in thread
From: Shah, Hardik @ 2009-04-06 11:51 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media, linux-omap, Jadav, Brijesh R, Hiremath, Vaibhav

Hi Hans,
Please find my comments inline.

Regards,
Hardik Shah

> -----Original Message-----
> From: Hans Verkuil [mailto:hverkuil@xs4all.nl]
> Sent: Monday, March 30, 2009 5:29 PM
> To: Shah, Hardik
> Cc: linux-media@vger.kernel.org; linux-omap@vger.kernel.org; Jadav, Brijesh R;
> Hiremath, Vaibhav
> Subject: Re: [PATCH 2/3] New V4L2 CIDs for OMAP class of Devices.
> 
> On Friday 20 March 2009 06:19:57 Hardik Shah wrote:
> > Added V4L2_CID_BG_COLOR for background color setting.
> > Added V4L2_CID_ROTATION for rotation setting.
> > Above two ioclts are indepth discussed. Posting
> > again with the driver usage.
> >
> > ---
> >  linux/drivers/media/video/v4l2-common.c |    7 +++++++
> >  linux/include/linux/videodev2.h         |    6 +++++-
> >  2 files changed, 12 insertions(+), 1 deletions(-)
> >
> > diff --git a/linux/drivers/media/video/v4l2-common.c
> b/linux/drivers/media/video/v4l2-common.c
> > index 3c42316..fa408f0 100644
> > --- a/linux/drivers/media/video/v4l2-common.c
> > +++ b/linux/drivers/media/video/v4l2-common.c
> > @@ -422,6 +422,8 @@ const char *v4l2_ctrl_get_name(u32 id)
> >  	case V4L2_CID_CHROMA_AGC:		return "Chroma AGC";
> >  	case V4L2_CID_COLOR_KILLER:		return "Color Killer";
> >  	case V4L2_CID_COLORFX:			return "Color Effects";
> > +	case V4L2_CID_ROTATION:                 return "Rotation";
> 
> I'm having second thoughts about this name. I think V4L2_CID_ROTATE is better,
> since it is an action ('you rotate an image') rather than a status ('what is
> the rotation of an image').
> 
> What do you think?
[Shah, Hardik] Yes, it should be V4L2_CID_ROTATE as V4L2_CID_HFLIP.
> 
> > +	case V4L2_CID_BG_COLOR:                 return "Background color";
> >
> >  	/* MPEG controls */
> >  	case V4L2_CID_MPEG_CLASS: 		return "MPEG Encoder Controls";
> > @@ -547,6 +549,10 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl,
> s32 min, s32 max, s32 ste
> >  		qctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
> >  		min = max = step = def = 0;
> >  		break;
> > +	case V4L2_CID_BG_COLOR:
> > +		 qctrl->type = V4L2_CTRL_TYPE_INTEGER;
> > +		 step = 1;
> > +		 break;
> 
> Set the min to 0 and max to 0xffffff.
[Shah, Hardik] Added
> 
> >  	default:
> >  		qctrl->type = V4L2_CTRL_TYPE_INTEGER;
> >  		break;
> > @@ -571,6 +577,7 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl,
> s32 min, s32 max, s32 ste
> >  	case V4L2_CID_BLUE_BALANCE:
> >  	case V4L2_CID_GAMMA:
> >  	case V4L2_CID_SHARPNESS:
> > +	case V4L2_CID_BG_COLOR:
> 
> This definitely isn't a slider control.
[Shah, Hardik] Removed
> 
> > --
> > 1.5.6
> 
> Regards,
> 
> 	Hans
> 
> --
> Hans Verkuil - video4linux developer - sponsored by TANDBERG


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

* [PATCH 2/3] New V4L2 CIDs for OMAP class of Devices.
@ 2009-04-06 12:40 Hardik Shah
  0 siblings, 0 replies; 4+ messages in thread
From: Hardik Shah @ 2009-04-06 12:40 UTC (permalink / raw)
  To: linux-media; +Cc: linux-omap, Hardik Shah, Brijesh Jadav, Vaibhav Hiremath

Added V4L2_CID_BG_COLOR for background color setting.
Added V4L2_CID_ROTATION for rotation setting.
Above two ioclts are indepth discussed. Posting
again with the driver usage.

V4L2 supports chroma keying added new flags for the
source chroma keying which is exactly opposite of the
chorma keying supported by V4L2.

In current implementation framebuffer pixels with
the chromakey color are replaced by video pixels.

While for the source chroma keying video pixels with
the chromakey color are replaced by the framebuffer
pixels.

Both are exactly opposite and so are mutually exclusive

Community Comments fixed in this post
1. Replaced V4L2_CID_ROTATION by V4L2_CID_ROTATE.
2. Initilize min and max values for V4L2_CID_BG_COLOR
control id.
3. Other minor comments fixed

Signed-off-by: Brijesh Jadav <brijesh.j@ti.com>
Signed-off-by: Hardik Shah <hardik.shah@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
---
 linux/drivers/media/video/v4l2-common.c |    9 +++++++++
 linux/include/linux/videodev2.h         |    6 +++++-
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/linux/drivers/media/video/v4l2-common.c b/linux/drivers/media/video/v4l2-common.c
index d75d89c..e44b432 100644
--- a/linux/drivers/media/video/v4l2-common.c
+++ b/linux/drivers/media/video/v4l2-common.c
@@ -422,6 +422,8 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_CHROMA_AGC:		return "Chroma AGC";
 	case V4L2_CID_COLOR_KILLER:		return "Color Killer";
 	case V4L2_CID_COLORFX:			return "Color Effects";
+	case V4L2_CID_ROTATE:	                return "Rotate";
+	case V4L2_CID_BG_COLOR:                 return "Background color";

 	/* MPEG controls */
 	case V4L2_CID_MPEG_CLASS: 		return "MPEG Encoder Controls";
@@ -547,6 +549,13 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste
 		qctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
 		min = max = step = def = 0;
 		break;
+	case V4L2_CID_BG_COLOR:
+		 qctrl->type = V4L2_CTRL_TYPE_INTEGER;
+		 step = 1;
+		 min = 0;
+		 /* Max is calculated as RGB888 that is 2^12*/
+		 max = 0xFFFFFF;
+		 break;
 	default:
 		qctrl->type = V4L2_CTRL_TYPE_INTEGER;
 		break;
diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h
index 82f9e72..f4cd39b 100644
--- a/linux/include/linux/videodev2.h
+++ b/linux/include/linux/videodev2.h
@@ -549,6 +549,7 @@ struct v4l2_framebuffer {
 #define V4L2_FBUF_CAP_LOCAL_ALPHA	0x0010
 #define V4L2_FBUF_CAP_GLOBAL_ALPHA	0x0020
 #define V4L2_FBUF_CAP_LOCAL_INV_ALPHA	0x0040
+#define V4L2_FBUF_CAP_SRC_CHROMAKEY	0x0080
 /*  Flags for the 'flags' field. */
 #define V4L2_FBUF_FLAG_PRIMARY		0x0001
 #define V4L2_FBUF_FLAG_OVERLAY		0x0002
@@ -556,6 +557,7 @@ struct v4l2_framebuffer {
 #define V4L2_FBUF_FLAG_LOCAL_ALPHA	0x0008
 #define V4L2_FBUF_FLAG_GLOBAL_ALPHA	0x0010
 #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA	0x0020
+#define V4L2_FBUF_FLAG_SRC_CHROMAKEY	0x0040

 struct v4l2_clip {
 	struct v4l2_rect        c;
@@ -888,6 +890,8 @@ enum v4l2_power_line_frequency {
 #define V4L2_CID_CHROMA_AGC                     (V4L2_CID_BASE+29)
 #define V4L2_CID_COLOR_KILLER                   (V4L2_CID_BASE+30)
 #define V4L2_CID_COLORFX			(V4L2_CID_BASE+31)
+#define V4L2_CID_ROTATE                     	(V4L2_CID_BASE+32)
+#define V4L2_CID_BG_COLOR                       (V4L2_CID_BASE+33)
 enum v4l2_colorfx {
 	V4L2_COLORFX_NONE	= 0,
 	V4L2_COLORFX_BW		= 1,
@@ -895,7 +899,7 @@ enum v4l2_colorfx {
 };

 /* last CID + 1 */
-#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+32)
+#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+34)

 /*  MPEG-class control IDs defined by V4L2 */
 #define V4L2_CID_MPEG_BASE 			(V4L2_CTRL_CLASS_MPEG | 0x900)
--
1.6.0.3


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

end of thread, other threads:[~2009-04-06 12:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-20  5:19 [PATCH 2/3] New V4L2 CIDs for OMAP class of Devices Hardik Shah
2009-03-30 11:58 ` Hans Verkuil
2009-04-06 11:51   ` Shah, Hardik
2009-04-06 12:40 Hardik Shah

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).