public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] V4L: fix ENUMSTD ioctl to report all supported standards
@ 2010-03-26  7:06 Guennadi Liakhovetski
  2010-03-26 10:52 ` Mauro Carvalho Chehab
  2010-03-26 11:19 ` Hans Verkuil
  0 siblings, 2 replies; 5+ messages in thread
From: Guennadi Liakhovetski @ 2010-03-26  7:06 UTC (permalink / raw)
  To: Linux Media Mailing List

V4L2_STD_PAL, V4L2_STD_SECAM, and V4L2_STD_NTSC are not the only composite 
standards. Currently, e.g., if a driver supports all of V4L2_STD_PAL_B, 
V4L2_STD_PAL_B1 and V4L2_STD_PAL_G, the enumeration will report 
V4L2_STD_PAL_BG and not the single standards, which can confuse 
applications. Fix this by only clearing simple standards from the mask. 
This, of course, will only work, if composite standards are listed before 
simple ones in the standards array in v4l2-ioctl.c, which is currently 
the case.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index 4b11257..2389df0 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -1065,9 +1065,7 @@ static long __video_do_ioctl(struct file *file,
 			j++;
 			if (curr_id == 0)
 				break;
-			if (curr_id != V4L2_STD_PAL &&
-			    curr_id != V4L2_STD_SECAM &&
-			    curr_id != V4L2_STD_NTSC)
+			if (is_power_of_2(curr_id))
 				id &= ~curr_id;
 		}
 		if (i <= index)

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

end of thread, other threads:[~2010-03-26 12:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-26  7:06 [PATCH] V4L: fix ENUMSTD ioctl to report all supported standards Guennadi Liakhovetski
2010-03-26 10:52 ` Mauro Carvalho Chehab
2010-03-26 11:19 ` Hans Verkuil
2010-03-26 11:24   ` Guennadi Liakhovetski
2010-03-26 12:03     ` Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox