From patchwork Thu Nov 15 22:09:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 1752061 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 0C20CDF2AB for ; Thu, 15 Nov 2012 22:09:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751365Ab2KOWJr (ORCPT ); Thu, 15 Nov 2012 17:09:47 -0500 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:38761 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750918Ab2KOWJr (ORCPT ); Thu, 15 Nov 2012 17:09:47 -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 2D151600A1; Fri, 16 Nov 2012 00:09:45 +0200 (EET) Received: by salottisipuli.retiisi.org.uk (Postfix, from userid 1000) id CF09D20B4E; Fri, 16 Nov 2012 00:09:44 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com Subject: [yavta PATCH 2/2] Print v4l2_buffer timestamp type Date: Fri, 16 Nov 2012 00:09:44 +0200 Message-Id: <1353017384-472-2-git-send-email-sakari.ailus@iki.fi> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <20121115220932.GC29863@valkosipuli.retiisi.org.uk> References: <20121115220932.GC29863@valkosipuli.retiisi.org.uk> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Signed-off-by: Sakari Ailus --- 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"; 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: