From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: linux-media@vger.kernel.org, hverkuil@xs4all.nl
Subject: Re: [yavta PATCH 2/2] Print v4l2_buffer timestamp type
Date: Tue, 27 Nov 2012 17:33:43 +0100 [thread overview]
Message-ID: <1389859.pZ9IpEcYuE@avalon> (raw)
In-Reply-To: <1353017384-472-2-git-send-email-sakari.ailus@iki.fi>
Hi Sakari,
Thanks for the patch.
On Friday 16 November 2012 00:09:44 Sakari Ailus wrote:
> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
> ---
> yavta.c | 12 +++++++++++-
> 1 files changed, 11 insertions(+), 1 deletions(-)
>
> diff --git a/yavta.c b/yavta.c
> index bf3e096..a50f11e 100644
> --- a/yavta.c
> +++ b/yavta.c
> @@ -464,6 +464,7 @@ static int video_alloc_buffers(struct device *dev, int
> nbufs,
>
> /* Map the buffers. */
> for (i = 0; i < rb.count; ++i) {
> + const char *ts_type = "invalid";
Any reason for not moving this to a default case ? That shouldn't be the most
common case, it will nearly always get overwritten so that's hardly an
optimization :-)
> memset(&buf, 0, sizeof buf);
> buf.index = i;
> buf.type = dev->type;
> @@ -474,7 +475,16 @@ static int video_alloc_buffers(struct device *dev, int
> nbufs, strerror(errno), errno);
> return ret;
> }
> - printf("length: %u offset: %u\n", buf.length, buf.m.offset);
> + switch (buf.flags & V4L2_BUF_FLAG_TIMESTAMP_MASK) {
> + case V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN:
> + ts_type = "unknown";
> + break;
> + case V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC:
> + ts_type = "monotonic";
> + break;
> + }
> + printf("length: %u offset: %u timestamp type: %s\n",
> + buf.length, buf.m.offset, ts_type);
>
> switch (dev->memtype) {
> case V4L2_MEMORY_MMAP:
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2012-11-27 16:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-15 22:09 [yavta PATCH 0/2] Timestamp type support Sakari Ailus
2012-11-15 22:09 ` [yavta PATCH 1/2] Update kernel header files Sakari Ailus
2012-11-15 22:09 ` [yavta PATCH 2/2] Print v4l2_buffer timestamp type Sakari Ailus
2012-11-27 16:33 ` Laurent Pinchart [this message]
2012-11-27 21:57 ` [yavta PATCH v1.1 " Sakari Ailus
2012-11-27 16:32 ` [yavta PATCH 0/2] Timestamp type support Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1389859.pZ9IpEcYuE@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox