From patchwork Tue Feb 7 16:08:48 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Philipp Zabel
X-Patchwork-Id: 9560541
Return-Path:
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
[172.30.200.125])
by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id
61F4F602B1 for ;
Tue, 7 Feb 2017 16:13:47 +0000 (UTC)
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54728268AE
for ;
Tue, 7 Feb 2017 16:13:47 +0000 (UTC)
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
id 47E7B283B4; Tue, 7 Feb 2017 16:13:47 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
pdx-wl-mail.web.codeaurora.org
X-Spam-Level:
X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI
autolearn=ham version=3.3.1
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBE7E268AE
for ;
Tue, 7 Feb 2017 16:13:46 +0000 (UTC)
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
id S1755162AbdBGQJa (ORCPT
);
Tue, 7 Feb 2017 11:09:30 -0500
Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:58861 "EHLO
metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK)
by vger.kernel.org with ESMTP id S1754321AbdBGQI5 (ORCPT
);
Tue, 7 Feb 2017 11:08:57 -0500
Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]
helo=dude.pengutronix.de.)
by metis.ext.pengutronix.de with esmtp (Exim 4.84_2)
(envelope-from )
id 1cb8K7-0000eC-Nm; Tue, 07 Feb 2017 17:08:55 +0100
From: Philipp Zabel
To: linux-media@vger.kernel.org
Cc: Laurent Pinchart ,
Hans Verkuil ,
Steve Longerbeam ,
Philipp Zabel
Subject: [PATCH 2/4] media-ctl: print the configured frame interval
Date: Tue, 7 Feb 2017 17:08:48 +0100
Message-Id: <20170207160850.10299-3-p.zabel@pengutronix.de>
X-Mailer: git-send-email 2.11.0
In-Reply-To: <20170207160850.10299-1-p.zabel@pengutronix.de>
References: <20170207160850.10299-1-p.zabel@pengutronix.de>
X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7
X-SA-Exim-Mail-From: p.zabel@pengutronix.de
X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de);
SAEximRunCond expanded to false
X-PTX-Original-Recipient: linux-media@vger.kernel.org
Sender: linux-media-owner@vger.kernel.org
Precedence: bulk
List-ID:
X-Mailing-List: linux-media@vger.kernel.org
X-Virus-Scanned: ClamAV using ClamSMTP
After the pad format, also print the frame interval, if already configured.
Signed-off-by: Philipp Zabel
Acked-by: Sakari Ailus
---
utils/media-ctl/media-ctl.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/utils/media-ctl/media-ctl.c b/utils/media-ctl/media-ctl.c
index 50adbe91..1be880c6 100644
--- a/utils/media-ctl/media-ctl.c
+++ b/utils/media-ctl/media-ctl.c
@@ -79,6 +79,7 @@ static void v4l2_subdev_print_format(struct media_entity *entity,
unsigned int pad, enum v4l2_subdev_format_whence which)
{
struct v4l2_mbus_framefmt format;
+ struct v4l2_fract interval = { 0, 0 };
struct v4l2_rect rect;
int ret;
@@ -86,10 +87,17 @@ static void v4l2_subdev_print_format(struct media_entity *entity,
if (ret != 0)
return;
+ ret = v4l2_subdev_get_frame_interval(entity, &interval, pad);
+ if (ret != 0 && ret != -ENOTTY)
+ return;
+
printf("\t\t[fmt:%s/%ux%u",
v4l2_subdev_pixelcode_to_string(format.code),
format.width, format.height);
+ if (interval.numerator || interval.denominator)
+ printf("@%u/%u", interval.numerator, interval.denominator);
+
if (format.field)
printf(" field:%s", v4l2_subdev_field_to_string(format.field));