From patchwork Tue Nov 27 21:57:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 1812871 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 73734DF254 for ; Tue, 27 Nov 2012 21:57:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754326Ab2K0V5i (ORCPT ); Tue, 27 Nov 2012 16:57:38 -0500 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:43898 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753143Ab2K0V5h (ORCPT ); Tue, 27 Nov 2012 16:57:37 -0500 Received: from salottisipuli.retiisi.org.uk (salottisipuli.retiisi.org.uk [IPv6:2001:1bc8:102:6d9a::83:2]) by hillosipuli.retiisi.org.uk (Postfix) with ESMTP id B799E6009F; Tue, 27 Nov 2012 23:57:34 +0200 (EET) Received: by salottisipuli.retiisi.org.uk (Postfix, from userid 1000) id 80EA123912; Tue, 27 Nov 2012 23:57:34 +0200 (EET) From: Sakari Ailus To: laurent.pinchart@ideasonboard.com Cc: linux-media@vger.kernel.org, hverkuil@xs4all.nl Subject: [yavta PATCH v1.1 2/2] Print v4l2_buffer timestamp type Date: Tue, 27 Nov 2012 23:57:34 +0200 Message-Id: <1354053454-18347-1-git-send-email-sakari.ailus@iki.fi> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1389859.pZ9IpEcYuE@avalon> References: <1389859.pZ9IpEcYuE@avalon> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Signed-off-by: Sakari Ailus --- Fixed. yavta.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/yavta.c b/yavta.c index bf3e096..b4d1df6 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; memset(&buf, 0, sizeof buf); buf.index = i; buf.type = dev->type; @@ -474,7 +475,18 @@ 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; + default: + ts_type = "invalid"; + } + printf("length: %u offset: %u timestamp type: %s\n", + buf.length, buf.m.offset, ts_type); switch (dev->memtype) { case V4L2_MEMORY_MMAP: