From patchwork Mon Sep 25 11:31:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Rapp X-Patchwork-Id: 5260 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.36.26 with SMTP id f26csp2517468jaa; Mon, 25 Sep 2017 04:38:00 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBh9f753NYM9KkI6gf25pMXnwizkB9irQYtzoPIEFkDKvJumc6kAr3+0SV83dYIRBwRYg7X X-Received: by 10.223.169.247 with SMTP id b110mr5570660wrd.31.1506339480843; Mon, 25 Sep 2017 04:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506339480; cv=none; d=google.com; s=arc-20160816; b=iLyyTJjU7YtvWzMsQ8odUrOnZnBJBCdFjgH4ZXZ+b6dSwfu6on2YRJ3pPAkWPqHE4P HwGT7qDWUC5dDBk4fTxSiX48XYMaj+fFKo4X38dEYVdc1nZI4BCqNj8vrpPNpX8rVbZ1 Pc9X4hkrVBZF5TNREtlxkm3UoZyTbYpSSsy2oXrPWbOCBmWEPWIirxMpQy2VeAHCI48l pm8ggJ4CWmYfc4ETrDP5RyqJ5DprQzYVDVpxC2yxtfOxV6Gdz3KYSx5orQrq+VFMg8ee yD72pcE/nmfQ7U3/JNBKlznRN5ur70UfqYfq42ylvXGRggureRpNSy3fu9YAgyBgYZbb Ywgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=mPIZ43NwQWFtCnEMEfcLxwZxOBsn+KW876nHylbxeXg=; b=LjANIp7/vJ2WYf4eWWOvUJTLQzF4gdFEbKD+XAIINSmMtABdTNy6GjWuOHai4EFeQC yp16KhqIDzXAi44K0HpC1s/uJUarvmw0cB6Nzso5xNTvAbbOxoqEzhLgs5JGti2ewfBC AjACC35H6r3xBZ1ydetY5N9uG6iFB+v9EekMpGIRlumO2/XQkeHkKoE6nP/ss/Xmkw6P ggvMI1jUF6SenHPnrpn6dHnqi3CsWE4T1EZFLZteru3UfCvEqqnLl0XnIedhJ8sfzWGC p/w8cfIcdJ6SgUEVCB1ZgBEusncSJiFKSvnGEzlC/XWiKUlqRe6hXkZHU9CsVhUHNKvW GgRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id z62si4288897wmc.6.2017.09.25.04.38.00; Mon, 25 Sep 2017 04:38:00 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EBF93688325; Mon, 25 Sep 2017 14:37:47 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mx02.mail.netstorage.at (mx02.mail.netstorage.at [89.207.146.155]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EFD9368022C for ; Mon, 25 Sep 2017 14:37:41 +0300 (EEST) Received: from p1002.netstorage.at (p1002.netstorage.at [89.207.146.186]) by mx02.mail.netstorage.at (Postfix) with ESMTPS id 1D5A4A1959 for ; Mon, 25 Sep 2017 13:31:20 +0200 (CEST) Received: from mailix (noaport.de [46.237.252.213]) by p1002.netstorage.at (Postfix) with ESMTPA id BD1D181614 for ; Mon, 25 Sep 2017 13:31:19 +0200 (CEST) Received: from frogstar-a.kuhnle.local (frogstar-a.kuhnle.local [192.168.0.26]) by mailix with ESMTPA ; Mon, 25 Sep 2017 13:31:19 +0200 From: Tobias Rapp To: ffmpeg-devel@ffmpeg.org Date: Mon, 25 Sep 2017 13:31:18 +0200 Message-Id: <1506339079-14869-1-git-send-email-t.rapp@noa-archive.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506005752-14650-1-git-send-email-t.rapp@noa-archive.com> References: <1506005752-14650-1-git-send-email-t.rapp@noa-archive.com> X-PPP-Message-ID: <20170925113120.19414.60469@p1002.netstorage.at> X-PPP-Vhost: noa-archive.com X-NetStorage-MailScanner-Information: Please contact the ISP for more information X-NetStorage-MailScanner-ID: 1D5A4A1959.A3CCD X-NetStorage-MailScanner: Found to be clean X-NetStorage-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (nicht zwischen gespeichert, Wertung=-0.5, benoetigt 6, autolearn=not spam, BAYES_00 -0.50) X-NetStorage-MailScanner-From: t.rapp@noa-archive.com X-Spam-Status: No Subject: [FFmpeg-devel] [PATCH v2 1/2] avfilter/vf_fps: clean-up filter options X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Align order of "start_time" option within filter documentation to actual implementation and add missing AV_OPT_FLAG_FILTERING_PARAM flag. Fix indent of "round" named constants and clear unused field values. Also fix some documentation cosmetics. Signed-off-by: Tobias Rapp --- doc/filters.texi | 22 +++++++++++----------- libavfilter/vf_fps.c | 12 ++++++------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index b09c3a0..a46865f 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -8669,13 +8669,21 @@ It accepts the following parameters: @item fps The desired output frame rate. The default is @code{25}. +@item start_time +Assume the first PTS should be the given value, in seconds. This allows for +padding/trimming at the start of stream. By default, no assumption is made +about the first frame's expected PTS, so no padding or trimming is done. +For example, this could be set to 0 to pad the beginning with duplicates of +the first frame if a video stream starts after the audio stream or to trim any +frames with a negative PTS. + @item round -Rounding method. +Timestamp (PTS) rounding method. Possible values are: @table @option @item zero -zero round towards 0 +round towards 0 @item inf round away from 0 @item down @@ -8687,18 +8695,10 @@ round to nearest @end table The default is @code{near}. -@item start_time -Assume the first PTS should be the given value, in seconds. This allows for -padding/trimming at the start of stream. By default, no assumption is made -about the first frame's expected PTS, so no padding or trimming is done. -For example, this could be set to 0 to pad the beginning with duplicates of -the first frame if a video stream starts after the audio stream or to trim any -frames with a negative PTS. - @end table Alternatively, the options can be specified as a flat string: -@var{fps}[:@var{round}]. +@var{fps}[:@var{start_time}[:@var{round}]]. See also the @ref{setpts} filter. diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c index 1e5d07e..a5e51c3 100644 --- a/libavfilter/vf_fps.c +++ b/libavfilter/vf_fps.c @@ -65,13 +65,13 @@ typedef struct FPSContext { #define F AV_OPT_FLAG_FILTERING_PARAM static const AVOption fps_options[] = { { "fps", "A string describing desired output framerate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, 0, INT_MAX, V|F }, - { "start_time", "Assume the first PTS should be this value.", OFFSET(start_time), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX}, -DBL_MAX, DBL_MAX, V }, + { "start_time", "Assume the first PTS should be this value.", OFFSET(start_time), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX}, -DBL_MAX, DBL_MAX, V|F }, { "round", "set rounding method for timestamps", OFFSET(rounding), AV_OPT_TYPE_INT, { .i64 = AV_ROUND_NEAR_INF }, 0, 5, V|F, "round" }, - { "zero", "round towards 0", OFFSET(rounding), AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_ZERO }, 0, 5, V|F, "round" }, - { "inf", "round away from 0", OFFSET(rounding), AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_INF }, 0, 5, V|F, "round" }, - { "down", "round towards -infty", OFFSET(rounding), AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_DOWN }, 0, 5, V|F, "round" }, - { "up", "round towards +infty", OFFSET(rounding), AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_UP }, 0, 5, V|F, "round" }, - { "near", "round to nearest", OFFSET(rounding), AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_NEAR_INF }, 0, 5, V|F, "round" }, + { "zero", "round towards 0", 0, AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_ZERO }, 0, 0, V|F, "round" }, + { "inf", "round away from 0", 0, AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_INF }, 0, 0, V|F, "round" }, + { "down", "round towards -infty", 0, AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_DOWN }, 0, 0, V|F, "round" }, + { "up", "round towards +infty", 0, AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_UP }, 0, 0, V|F, "round" }, + { "near", "round to nearest", 0, AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_NEAR_INF }, 0, 0, V|F, "round" }, { NULL } };