From patchwork Tue Nov 12 13:47:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 3172361 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EA6C2C045B for ; Tue, 12 Nov 2013 13:45:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 984D220459 for ; Tue, 12 Nov 2013 13:45:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1779320212 for ; Tue, 12 Nov 2013 13:45:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752847Ab3KLNpl (ORCPT ); Tue, 12 Nov 2013 08:45:41 -0500 Received: from mga11.intel.com ([192.55.52.93]:3936 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751534Ab3KLNpl (ORCPT ); Tue, 12 Nov 2013 08:45:41 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 12 Nov 2013 05:45:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,685,1378882800"; d="scan'208";a="432055272" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by fmsmga002.fm.intel.com with ESMTP; 12 Nov 2013 05:45:27 -0800 Received: from nauris.fi.intel.com (nauris.localdomain [192.168.240.2]) by paasikivi.fi.intel.com (Postfix) with ESMTP id 4627C201B1; Tue, 12 Nov 2013 15:45:26 +0200 (EET) Received: by nauris.fi.intel.com (Postfix, from userid 1000) id 3FE6820114; Tue, 12 Nov 2013 15:47:06 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, vinod.govindapillai@intel.com Subject: [PATCH v2 1/1] v4l: Add frame end event Date: Tue, 12 Nov 2013 15:47:06 +0200 Message-Id: <1384264026-9648-1-git-send-email-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1383311443-7863-1-git-send-email-sakari.ailus@linux.intel.com> References: <1383311443-7863-1-git-send-email-sakari.ailus@linux.intel.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add an event to signal frame end. This is not necessarily the same timestamp as the video buffer done timestamp, and can be also subscribed by other processes than the one controlling streaming and buffer (de)queueing. Also make all event type constants appear as constants in documentation and move frame sync event struct documentation after all control event documentation. Signed-off-by: Sakari Ailus --- Hi, I decided it'd be better not to use the id field to tell it's frame end --- that field would be better used for stream id (and we're not exactly running out of possible values for type). As discussed previously, I don't know when this would be needed in mainline. Regards, Sakari Documentation/DocBook/media/v4l/vidioc-dqevent.xml | 39 +++++++++++----------- .../DocBook/media/v4l/vidioc-subscribe-event.xml | 18 +++++++++- include/uapi/linux/videodev2.h | 2 ++ 3 files changed, 39 insertions(+), 20 deletions(-) diff --git a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml index 89891ad..0fdaa2e 100644 --- a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml +++ b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml @@ -76,21 +76,22 @@ &v4l2-event-vsync; vsync - Event data for event V4L2_EVENT_VSYNC. + Event data for event V4L2_EVENT_VSYNC. &v4l2-event-ctrl; ctrl - Event data for event V4L2_EVENT_CTRL. + Event data for event V4L2_EVENT_CTRL. &v4l2-event-frame-sync; frame_sync - Event data for event V4L2_EVENT_FRAME_SYNC. + Event data for event V4L2_EVENT_FRAME_SYNC + and V4L2_EVENT_FRAME_END. @@ -226,22 +227,6 @@ - - struct <structname>v4l2_event_frame_sync</structname> - - &cs-str; - - - __u32 - frame_sequence - - The sequence number of the frame being received. - - - - -
- Changes @@ -270,6 +255,22 @@
+ + + struct <structname>v4l2_event_frame_sync</structname> + + &cs-str; + + + __u32 + frame_sequence + + The sequence number of the frame being received. + + + + +
&return-value; diff --git a/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml b/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml index 5c70b61..406e5e0 100644 --- a/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml +++ b/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml @@ -150,7 +150,23 @@ buffer underrun it might not be able to generate this event. In such cases the frame_sequence field in &v4l2-event-frame-sync; will not be incremented. This - causes two consecutive frame sequence numbers to have n times + causes two consecutive frame sync events to have n times + frame interval in between them. +
+ + + V4L2_EVENT_FRAME_END + 5 + + Triggered immediately when the reception of a + frame has ended. This event has a + &v4l2-event-frame-sync; associated with it. + + If the hardware needs to be stopped in the case of a + buffer underrun it might not be able to generate this event. + In such cases the frame_sequence + field in &v4l2-event-frame-sync; will not be incremented. This + causes two consecutive frame end events to have n times frame interval in between them. diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 437f1b0..2307e1a 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -1733,6 +1733,7 @@ struct v4l2_streamparm { #define V4L2_EVENT_EOS 2 #define V4L2_EVENT_CTRL 3 #define V4L2_EVENT_FRAME_SYNC 4 +#define V4L2_EVENT_FRAME_END 5 #define V4L2_EVENT_PRIVATE_START 0x08000000 /* Payload for V4L2_EVENT_VSYNC */ @@ -1760,6 +1761,7 @@ struct v4l2_event_ctrl { __s32 default_value; }; +/* V4L2_EVENT_FRAME_SYNC or V4L2_EVENT_FRAME_END */ struct v4l2_event_frame_sync { __u32 frame_sequence; };