All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/9] Provide -Q option for setting the queue type
@ 2014-04-10 22:06 Sakari Ailus
  2014-04-10 22:06 ` [PATCH v2 2/9] Zero dev in main() Sakari Ailus
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Sakari Ailus @ 2014-04-10 22:06 UTC (permalink / raw)
  To: linux-media; +Cc: laurent.pinchart

Instead of guessing the queue type, allow setting it explicitly.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
---
 yavta.c |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/yavta.c b/yavta.c
index 739463d..d7bccfd 100644
--- a/yavta.c
+++ b/yavta.c
@@ -1501,6 +1501,8 @@ static void usage(const char *argv0)
 	printf("-n, --nbufs n			Set the number of video buffers\n");
 	printf("-p, --pause			Pause before starting the video stream\n");
 	printf("-q, --quality n			MJPEG quality (0-100)\n");
+	printf("-Q, --queue-type		Buffer queue type (\"capture\", \"overlay\" or a\n");
+	printf("                                number)\n");
 	printf("-r, --get-control ctrl		Get control 'ctrl'\n");
 	printf("-R, --realtime=[priority]	Enable realtime RR scheduling\n");
 	printf("-s, --size WxH			Set the frame size\n");
@@ -1543,6 +1545,7 @@ static struct option opts[] = {
 	{"offset", 1, 0, OPT_USERPTR_OFFSET},
 	{"pause", 0, 0, 'p'},
 	{"quality", 1, 0, 'q'},
+	{"queue-type", 1, 0, 'Q'},
 	{"get-control", 1, 0, 'r'},
 	{"requeue-last", 0, 0, OPT_REQUEUE_LAST},
 	{"realtime", 2, 0, 'R'},
@@ -1564,7 +1567,7 @@ int main(int argc, char *argv[])
 
 	/* Options parsings */
 	const struct v4l2_format_info *info;
-	int do_file = 0, do_capture = 0, do_pause = 0;
+	int do_file = 0, do_capture = 0, do_pause = 0, queue_type = -1;
 	int do_set_time_per_frame = 0;
 	int do_enum_formats = 0, do_set_format = 0;
 	int do_enum_inputs = 0, do_set_input = 0;
@@ -1600,7 +1603,7 @@ int main(int argc, char *argv[])
 	unsigned int rt_priority = 1;
 
 	opterr = 0;
-	while ((c = getopt_long(argc, argv, "c::Cd:f:F::hi:Iln:pq:r:R::s:t:uw:", opts, NULL)) != -1) {
+	while ((c = getopt_long(argc, argv, "c::Cd:f:F::hi:Iln:pq:Q:r:R::s:t:uw:", opts, NULL)) != -1) {
 
 		switch (c) {
 		case 'c':
@@ -1652,6 +1655,14 @@ int main(int argc, char *argv[])
 		case 'q':
 			quality = atoi(optarg);
 			break;
+		case 'Q':
+			if (!strcmp(optarg, "capture"))
+				queue_type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+			else if (!strcmp(optarg, "output"))
+				queue_type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+			else
+				queue_type = atoi(optarg);
+			break;
 		case 'r':
 			ctrl_name = strtol(optarg, &endptr, 0);
 			if (*endptr != 0) {
@@ -1761,6 +1772,9 @@ int main(int argc, char *argv[])
 	if (dev.type == (enum v4l2_buf_type)-1)
 		no_query = 1;
 
+	if (queue_type != -1)
+		dev.type = queue_type;
+
 	dev.memtype = memtype;
 
 	if (do_get_control) {
-- 
1.7.10.4


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

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

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-10 22:06 [PATCH v2 1/9] Provide -Q option for setting the queue type Sakari Ailus
2014-04-10 22:06 ` [PATCH v2 2/9] Zero dev in main() Sakari Ailus
2014-04-10 22:06 ` [PATCH v2 3/9] Use int for buffer queue type Sakari Ailus
2014-04-10 22:06 ` [PATCH v2 4/9] Separate querying capabilities and determining " Sakari Ailus
2014-04-10 22:06 ` [PATCH v2 5/9] Allow passing file descriptors to yavta Sakari Ailus
2014-04-10 22:06 ` [PATCH v2 6/9] Timestamp source for output buffers Sakari Ailus
2014-04-10 22:06 ` [PATCH v2 7/9] Print timestamp type and source for dequeued buffers Sakari Ailus
2014-04-10 22:06 ` [PATCH v2 8/9] Support copy timestamps Sakari Ailus
2014-04-10 22:06 ` [PATCH v2 9/9] Set timestamp for output buffers if the timestamp type is copy Sakari Ailus
2014-04-10 22:22 ` [PATCH v2 1/9] Provide -Q option for setting the queue type Sakari Ailus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.