From patchwork Wed Jul 13 09:17:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 36767 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:6da0:b0:8b:e47:9dbf with SMTP id wl32csp225659pzb; Wed, 13 Jul 2022 02:17:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sjMb7posVxtAqnqIdl3Vo4tAeYApD+VeayVdtGLq61WOpS7KilzcLT6CCvBeNJhGzkvswc X-Received: by 2002:a05:6402:1d97:b0:43a:7b45:8e14 with SMTP id dk23-20020a0564021d9700b0043a7b458e14mr3507693edb.418.1657703863784; Wed, 13 Jul 2022 02:17:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657703863; cv=none; d=google.com; s=arc-20160816; b=gi+OBZhhrOlZE5FSjNBksisfCV1rUBbmJSVEfse+SJ/R2WvFyR0ZEyexpvVCF3w9pk IoRk50Dd3ZM4ky262oBr8KNModXWawIeGwhpq1DJjBViR4uDpIl4mbidDTpkvTpkZk7s sd2OKfCiVwkHZ/OJovomY9/d68z4IV93n5rrHK0ZZjwuZpiQC3AIOlnLLcK31tnCu8hT ru9ee52Q6bVVpItjZtDbCi06w+HlSeQtlmrsfpIpAQu5EG3J0ioXKB9bDAFjAmeCpeYk 3IUYlxdB/ToTHamGgtqLcwZWP6Qd6U1PlMwgyE1g2iZJCsT/mgWkyuyEbNpfOkuFLArn Ffiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=rAAFlTp4TWfXzbocGt8EFZo3KrHKAS2t9WeTCNtsRqg=; b=CGiU4fxocHAKNnxW9z7MtANdrXsxefvAf+k6Od4zjqmm6a2NRAroMlZZkm7RfGri/O OlJPgOcszwobMlzNz4JLeOebaxqR5dpnzmPZdkNHJTtGn1aPokD5vaMOirqrjGo6UILC 5IcQARr/huYBUOC1GPINYJJ7UVOUkqbLwHrztqBrjHhdMTi+9Ln/1rYNxyC66K85jNdm 6X2iTHy/O3sKg/7nCJA5YUR9Sy2+G2Ut1cdlA2B6i1n3hBHmbyqKLDRfocfFR6+PvpyO 492iByFa+FB+qepZUT96U8+SahLRsDMaCaQzL++mVMqeMViA63967n/UlJP1Om3CWNVc jXUg== 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 hw8-20020a170907a0c800b0070c519c7b69si1991121ejc.409.2022.07.13.02.17.42; Wed, 13 Jul 2022 02:17:43 -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 1002A68B8E7; Wed, 13 Jul 2022 12:17:38 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A858A68B63E for ; Wed, 13 Jul 2022 12:17:31 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id BDD37240179 for ; Wed, 13 Jul 2022 11:17:30 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id BR5nELKFU0JH for ; Wed, 13 Jul 2022 11:17:30 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 490A724017C for ; Wed, 13 Jul 2022 11:17:28 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id C76933A030D; Wed, 13 Jul 2022 11:17:27 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 13 Jul 2022 11:17:17 +0200 Message-Id: <20220713091725.16638-1-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/9] lavu/frame: add a duration field to AVFrame X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: v0oN0lrPDvVP The only duration field currently present in AVFrame is pkt_duration, which is semantically restricted to those frames that are output by decoders. Add a new field that stores the frame's duration without regard for how that frame was produced. Deprecate pkt_duration. --- doc/APIchanges | 3 +++ libavutil/frame.c | 10 ++++++++++ libavutil/frame.h | 10 ++++++++++ libavutil/version.h | 3 ++- 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/doc/APIchanges b/doc/APIchanges index 20b944933a..656362b40d 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -14,6 +14,9 @@ libavutil: 2021-04-27 API changes, most recent first: +2022-07-xx - xxxxxxxxxx - lavu 57.28.100 - frame.h + Add AVFrame.duration, deprecate AVFrame.pkt_duration. + 2022-06-12 - xxxxxxxxxx - lavf 59.25.100 - avio.h Add avio_vprintf(), similar to avio_printf() but allow to use it from within a function taking a variable argument list as input. diff --git a/libavutil/frame.c b/libavutil/frame.c index 4c16488c66..9c9bab3fcf 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -59,7 +59,12 @@ static void get_frame_defaults(AVFrame *frame) frame->pts = frame->pkt_dts = AV_NOPTS_VALUE; frame->best_effort_timestamp = AV_NOPTS_VALUE; + frame->duration = 0; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS frame->pkt_duration = 0; +FF_ENABLE_DEPRECATION_WARNINGS +#endif frame->pkt_pos = -1; frame->pkt_size = -1; frame->time_base = (AVRational){ 0, 1 }; @@ -283,6 +288,7 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy) dst->crop_left = src->crop_left; dst->crop_right = src->crop_right; dst->pts = src->pts; + dst->duration = src->duration; dst->repeat_pict = src->repeat_pict; dst->interlaced_frame = src->interlaced_frame; dst->top_field_first = src->top_field_first; @@ -292,7 +298,11 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy) dst->pkt_dts = src->pkt_dts; dst->pkt_pos = src->pkt_pos; dst->pkt_size = src->pkt_size; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS dst->pkt_duration = src->pkt_duration; +FF_ENABLE_DEPRECATION_WARNINGS +#endif dst->time_base = src->time_base; dst->reordered_opaque = src->reordered_opaque; dst->quality = src->quality; diff --git a/libavutil/frame.h b/libavutil/frame.h index 33fac2054c..856959f979 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -604,13 +604,18 @@ typedef struct AVFrame { */ int64_t pkt_pos; +#if FF_API_PKT_DURATION /** * duration of the corresponding packet, expressed in * AVStream->time_base units, 0 if unknown. * - encoding: unused * - decoding: Read by user. + * + * @deprecated use duration instead */ + attribute_deprecated int64_t pkt_duration; +#endif /** * metadata. @@ -702,6 +707,11 @@ typedef struct AVFrame { * Channel layout of the audio data. */ AVChannelLayout ch_layout; + + /** + * Duration of the frame, in the same units as pts. 0 if unknown. + */ + int64_t duration; } AVFrame; diff --git a/libavutil/version.h b/libavutil/version.h index 2e9e02dda8..1722f0427f 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 57 -#define LIBAVUTIL_VERSION_MINOR 27 +#define LIBAVUTIL_VERSION_MINOR 28 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ @@ -114,6 +114,7 @@ #define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 58) #define FF_API_OLD_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_MAJOR < 58) #define FF_API_AV_FOPEN_UTF8 (LIBAVUTIL_VERSION_MAJOR < 58) +#define FF_API_PKT_DURATION (LIBAVUTIL_VERSION_MAJOR < 58) /** * @} From patchwork Wed Jul 13 09:17:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 36773 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:6da0:b0:8b:e47:9dbf with SMTP id wl32csp226091pzb; Wed, 13 Jul 2022 02:18:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sLy4sXKl7vyVdar9khgse7Y53tL5JX7cWGR+Oktql23fkvbo9IxcTD/vE7PM/LW1QNKaAw X-Received: by 2002:a05:6402:510e:b0:43a:c671:7cd0 with SMTP id m14-20020a056402510e00b0043ac6717cd0mr3483383edd.103.1657703925369; Wed, 13 Jul 2022 02:18:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657703925; cv=none; d=google.com; s=arc-20160816; b=zn6aSeGS+ZkZGrbUQBAnI5iXYFWSpVk9af7sxMZwrQL9QaNwFqc0RNTkQNpPye7pDf BPM8qAd3b36YX4gzzwzIZ2TuE2ZcaeTf4S6wN2zNeQwOWzL6QtvLP2SG5rt1q0v/2B0u cEM2a3ogys2CS6be0eWgFsGAGP8fFW4+ND0e2HEXggHaCXdBt7S0bhazc4ZTaWDZBmBS 1wxg7A/iEUMez5sFOGE5JJ/34kvzQ7GsRuuE+YDX5JdeTsnwOswfWQ70XkHYpNhBQmow /Ca3IEDTCfav35svVs1noRl8NGPM8/HS8q2uRk9a5Jax/MAj/tISGDlC9PINdmPHMyQG PMtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=CAnnF4e6J749iJzjYyUw8Y0puYiO6sbhHmv6Ylp+cUc=; b=wJ7sRtU1NcZTuZXe+qMLjk6SvWFGalth6nJnS77cVWbx7VaL7EGORtqkgFfKYBcOZn QfXS6MfjE2u5iD+tWbrT0kJ3OtSLFCuTqCJOOp490jeMUITiGnLrD9h+psj3WOVTdzC3 /eTOs7fT6V05LYpl8YKZFNkEa6+8AFcrgmyuJ6jrVPdeImBPT1Tb53NGVBG+XZ51+JeS adhNs9fKZWWXxmvWehb2Zv75a3p+fVoasrxSZ4QXaNQ5/7iYGdckB0+WAPsQ7FN+5lyz oPXJ9YQGIquOYoF+S/GnNFlCxhfZ23KJnxp1+WR3QFbXRxD5dS8WZxPVpAoADeRtbPpq 1u7A== 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 l22-20020a1709060e1600b00726abda6121si15551350eji.533.2022.07.13.02.18.44; Wed, 13 Jul 2022 02:18:45 -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 5D55668B994; Wed, 13 Jul 2022 12:17:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 02E4768B93E for ; Wed, 13 Jul 2022 12:17:37 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 259D42404FE for ; Wed, 13 Jul 2022 11:17:33 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id YJLfSOe3N8M6 for ; Wed, 13 Jul 2022 11:17:32 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 5E80524017E for ; Wed, 13 Jul 2022 11:17:28 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id C94FD3A02CB; Wed, 13 Jul 2022 11:17:27 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 13 Jul 2022 11:17:18 +0200 Message-Id: <20220713091725.16638-2-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220713091725.16638-1-anton@khirnov.net> References: <20220713091725.16638-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/9] lavc: use AVFrame.duration instead of AVFrame.pkt_duration X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: sQ4TBXTBbbnB --- libavcodec/crystalhd.c | 2 +- libavcodec/cuviddec.c | 2 +- libavcodec/decode.c | 14 ++++++++++---- libavcodec/encode.c | 11 ++++++++++- libavcodec/gifdec.c | 2 +- libavcodec/libdav1d.c | 2 +- libavcodec/mfenc.c | 2 +- libavcodec/rawdec.c | 2 +- 8 files changed, 26 insertions(+), 11 deletions(-) diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c index cf74f22e7d..211a485918 100644 --- a/libavcodec/crystalhd.c +++ b/libavcodec/crystalhd.c @@ -546,7 +546,7 @@ static inline CopyRet copy_frame(AVCodecContext *avctx, frame->pts = pkt_pts; frame->pkt_pos = -1; - frame->pkt_duration = 0; + frame->duration = 0; frame->pkt_size = -1; if (!priv->need_second_field) { diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c index b544b3361d..d1b5dbc6f5 100644 --- a/libavcodec/cuviddec.c +++ b/libavcodec/cuviddec.c @@ -624,7 +624,7 @@ static int cuvid_output_frame(AVCodecContext *avctx, AVFrame *frame) * So set pkt_pts and clear all the other pkt_ fields. */ frame->pkt_pos = -1; - frame->pkt_duration = 0; + frame->duration = 0; frame->pkt_size = -1; frame->interlaced_frame = !parsed_frame.is_deinterlacing && !parsed_frame.dispinfo.progressive_frame; diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 1893caa6a6..14ce4c2e2f 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -394,8 +394,8 @@ FF_ENABLE_DEPRECATION_WARNINGS frame->pts += diff_ts; if(frame->pkt_dts!=AV_NOPTS_VALUE) frame->pkt_dts += diff_ts; - if (frame->pkt_duration >= diff_ts) - frame->pkt_duration -= diff_ts; + if (frame->duration >= diff_ts) + frame->duration -= diff_ts; } else { av_log(avctx, AV_LOG_WARNING, "Could not update timestamps for skipped samples.\n"); } @@ -417,7 +417,7 @@ FF_ENABLE_DEPRECATION_WARNINGS int64_t diff_ts = av_rescale_q(frame->nb_samples - discard_padding, (AVRational){1, avctx->sample_rate}, avctx->pkt_timebase); - frame->pkt_duration = diff_ts; + frame->duration = diff_ts; } else { av_log(avctx, AV_LOG_WARNING, "Could not update timestamps for discarded samples.\n"); } @@ -549,6 +549,12 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) frame->pts, frame->pkt_dts); +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS + frame->pkt_duration = frame->duration; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + /* the only case where decode data is not set should be decoders * that do not call ff_get_buffer() */ av_assert0((frame->private_ref && frame->private_ref->size == sizeof(FrameDecodeData)) || @@ -1267,7 +1273,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame) if (!(ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) { frame->pts = pkt->pts; frame->pkt_pos = pkt->pos; - frame->pkt_duration = pkt->duration; + frame->duration = pkt->duration; frame->pkt_size = pkt->size; for (int i = 0; i < FF_ARRAY_ELEMS(sd); i++) { diff --git a/libavcodec/encode.c b/libavcodec/encode.c index 1f39ab1a2f..310fe20777 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -339,7 +339,7 @@ static int encode_send_frame_internal(AVCodecContext *avctx, const AVFrame *src) return ret; avctx->internal->last_audio_frame = 1; - return 0; + goto finish; } else if (src->nb_samples > avctx->frame_size) { av_log(avctx, AV_LOG_ERROR, "nb_samples (%d) != frame_size (%d)\n", src->nb_samples, avctx->frame_size); return AVERROR(EINVAL); @@ -351,6 +351,15 @@ static int encode_send_frame_internal(AVCodecContext *avctx, const AVFrame *src) if (ret < 0) return ret; +finish: + +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS + if (dst->pkt_duration && dst->pkt_duration != dst->duration) + dst->duration = dst->pkt_duration; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + return 0; } diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index 3936de1cd2..fbb1ef6ad5 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -475,7 +475,7 @@ static int gif_decode_frame(AVCodecContext *avctx, AVFrame *rframe, s->frame->pts = avpkt->pts; s->frame->pkt_dts = avpkt->dts; - s->frame->pkt_duration = avpkt->duration; + s->frame->duration = avpkt->duration; if (avpkt->size >= 6) { s->keyframe = memcmp(avpkt->data, gif87a_sig, 6) == 0 || diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c index 0a46cf2264..126bc3ae06 100644 --- a/libavcodec/libdav1d.c +++ b/libavcodec/libdav1d.c @@ -415,7 +415,7 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) frame->pkt_dts = p->m.timestamp; frame->pkt_pos = p->m.offset; frame->pkt_size = p->m.size; - frame->pkt_duration = p->m.duration; + frame->duration = p->m.duration; frame->key_frame = p->frame_hdr->frame_type == DAV1D_FRAME_TYPE_KEY; switch (p->frame_hdr->frame_type) { diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c index bbe78605a9..4646302430 100644 --- a/libavcodec/mfenc.c +++ b/libavcodec/mfenc.c @@ -344,7 +344,7 @@ static IMFSample *mf_v_avframe_to_sample(AVCodecContext *avctx, const AVFrame *f return NULL; } - IMFSample_SetSampleDuration(sample, mf_to_mf_time(avctx, frame->pkt_duration)); + IMFSample_SetSampleDuration(sample, mf_to_mf_time(avctx, frame->duration)); return sample; } diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index c10b20d4f9..bf9a2b1f56 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -234,7 +234,7 @@ static int raw_decode(AVCodecContext *avctx, AVFrame *frame, return res; frame->pkt_pos = avctx->internal->last_pkt_props->pos; - frame->pkt_duration = avctx->internal->last_pkt_props->duration; + frame->duration = avctx->internal->last_pkt_props->duration; if (context->tff >= 0) { frame->interlaced_frame = 1; From patchwork Wed Jul 13 09:17:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 36769 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:6da0:b0:8b:e47:9dbf with SMTP id wl32csp225804pzb; Wed, 13 Jul 2022 02:18:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vwQ8L/XYafHiso8NmL+jWGYMEi512I+OG6zv0+uZ6tWy5UxkvhD0PMnZrMriIHHIipNwr8 X-Received: by 2002:a05:6402:d0a:b0:437:f9a1:8493 with SMTP id eb10-20020a0564020d0a00b00437f9a18493mr3513992edb.226.1657703884136; Wed, 13 Jul 2022 02:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657703884; cv=none; d=google.com; s=arc-20160816; b=V5qkmOZaaoAS9Mmq87PijpAVhdSDnQHOJALdi2gcj2MBtU5eWf+SQissHvnNrjVSiu WBkbJ3IFHUEop9wIlyxXgZ2pP7cSVS7yOnpJjQbdbvLsmlAw7H2d05tikoA3qB52K/dZ z4yV3la9rs/qBSH/VaNnpYzFODBysg8bVqeYqC499IH4tPEN/FqMtncDFJreEWIi8KXr 6aJAnc2dtwO6GVfsrb8QSikvNyznmTrp8jR6cq1zkOc58VImkhoFzm1P/gXmYCwtbT8B OHskkh+/TfdGRMD90f2IhBaGpucHBviRu4fj6WknC8ORwIJoDhQm0tLjqF/Vz5pCafJM YXeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=8C8oOn6kEsKyxbFMwRN7dKsYWgq8E6kEuw9cky+2ebk=; b=HeZnO7URX3jERimpCANCQ8hpTVNAe/LEbu6x0pHuQepZEgyxEAE0S0E+RkwbF/mADB eTB/OaLCpTdj6dyFS4Q8+6tQiNSjZEPiBGsomP7TArNW5p21yulhcyOh87s0yblotYHs FjZIZpIcwiNh9z98Hi4QapDgDXIRcoGbvn/vcs1LwHJFZe1+c9QixUETOD0HKmr3AJX2 bygvxKbhnmVm3tCRyK4v2hX8179MD1ir6tTPjKpmca4IZRbmR83rFyTV/bB+E6ctDxwi tU3VrzplmwvzGvzDjbn22MP65WdN7fR8lP8bazLS46mmUiDxu6DSAZH+JK46Y/zJhYmO ooBg== 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 g9-20020a056402090900b0043aa1eea0e3si19964773edz.330.2022.07.13.02.18.03; Wed, 13 Jul 2022 02:18:04 -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 5948968B8EB; Wed, 13 Jul 2022 12:17:40 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DEEFF68B87F for ; Wed, 13 Jul 2022 12:17:31 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 3ACAB24017C for ; Wed, 13 Jul 2022 11:17:31 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id PCHNEDzM5vgt for ; Wed, 13 Jul 2022 11:17:28 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 45C8D2400F5 for ; Wed, 13 Jul 2022 11:17:28 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id D06253A0311; Wed, 13 Jul 2022 11:17:27 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 13 Jul 2022 11:17:19 +0200 Message-Id: <20220713091725.16638-3-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220713091725.16638-1-anton@khirnov.net> References: <20220713091725.16638-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/9] lavfi: use AVFrame.duration instead of AVFrame.pkt_duration X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: GkiZ89buU8c3 --- doc/filters.texi | 2 +- libavfilter/buffersrc.c | 7 +++++++ libavfilter/f_loop.c | 14 ++++++++++++++ libavfilter/vf_deshake_opencl.c | 7 +++++++ libavfilter/vf_drawtext.c | 16 ++++++++++++++++ 5 files changed, 45 insertions(+), 1 deletion(-) diff --git a/doc/filters.texi b/doc/filters.texi index 40f21fb34c..0e7beac63d 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -11842,7 +11842,7 @@ The current packet's position in the input file or stream (in bytes, from the start of the input). A value of -1 indicates this info is not available. -@item pkt_duration +@item duration The current packet's duration, in seconds. @item pkt_size diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index a3190468bb..ae8bba19b0 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -243,6 +243,13 @@ FF_ENABLE_DEPRECATION_WARNINGS } } +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS + if (copy->pkt_duration && copy->pkt_duration != copy->duration) + copy->duration = copy->pkt_duration; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + ret = ff_filter_frame(ctx->outputs[0], copy); if (ret < 0) return ret; diff --git a/libavfilter/f_loop.c b/libavfilter/f_loop.c index 672aa4c8f7..d217efe2fd 100644 --- a/libavfilter/f_loop.c +++ b/libavfilter/f_loop.c @@ -331,9 +331,16 @@ static int push_frame(AVFilterContext *ctx) if (!out) return AVERROR(ENOMEM); out->pts += s->duration - s->start_pts; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS if (out->pkt_duration) duration = out->pkt_duration; else +FF_ENABLE_DEPRECATION_WARNINGS +#endif + if (out->duration) + duration = out->duration; + else duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); pts = out->pts + duration; ret = ff_filter_frame(outlink, out); @@ -368,9 +375,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) return AVERROR(ENOMEM); } s->nb_frames++; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS if (frame->pkt_duration) duration = frame->pkt_duration; else +FF_ENABLE_DEPRECATION_WARNINGS +#endif + if (frame->duration) + duration = frame->duration; + else duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); s->duration = frame->pts + duration; ret = ff_filter_frame(outlink, frame); diff --git a/libavfilter/vf_deshake_opencl.c b/libavfilter/vf_deshake_opencl.c index c2b5bef897..d488da7fa0 100644 --- a/libavfilter/vf_deshake_opencl.c +++ b/libavfilter/vf_deshake_opencl.c @@ -1413,8 +1413,15 @@ static int filter_frame(AVFilterLink *link, AVFrame *input_frame) &debug_matches, 1); } +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS if (input_frame->pkt_duration) { duration = input_frame->pkt_duration; + } else +FF_ENABLE_DEPRECATION_WARNINGS +#endif + if (input_frame->duration) { + duration = input_frame->duration; } else { duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); } diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index feb6898848..50012bb258 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -91,8 +91,11 @@ static const char *const var_names[] = { "y", "pict_type", "pkt_pos", +#if FF_API_PKT_DURATION "pkt_duration", +#endif "pkt_size", + "duration", NULL }; @@ -131,8 +134,11 @@ enum var_name { VAR_Y, VAR_PICT_TYPE, VAR_PKT_POS, +#if FF_API_PKT_DURATION VAR_PKT_DURATION, +#endif VAR_PKT_SIZE, + VAR_DURATION, VAR_VARS_NB }; @@ -1649,8 +1655,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) s->var_values[VAR_PICT_TYPE] = frame->pict_type; s->var_values[VAR_PKT_POS] = frame->pkt_pos; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS s->var_values[VAR_PKT_DURATION] = frame->pkt_duration * av_q2d(inlink->time_base); + + if (frame->pkt_duration) + s->var_values[VAR_DURATION] = frame->pkt_duration * av_q2d(inlink->time_base); + else +FF_ENABLE_DEPRECATION_WARNINGS +#endif + s->var_values[VAR_DURATION] = frame->duration * av_q2d(inlink->time_base); s->var_values[VAR_PKT_SIZE] = frame->pkt_size; + s->metadata = frame->metadata; for (int i = 0; i < loop; i++) { From patchwork Wed Jul 13 09:17:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 36768 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:6da0:b0:8b:e47:9dbf with SMTP id wl32csp225750pzb; Wed, 13 Jul 2022 02:17:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uL2j/JZQywbamOhPXd8xZ05GN6BTcwAYzelB8nFm2LMAtYWRbiLqA44OzTuWA8iaAv1BTA X-Received: by 2002:a17:907:2c5b:b0:72b:54bd:40f8 with SMTP id hf27-20020a1709072c5b00b0072b54bd40f8mr2426430ejc.137.1657703877216; Wed, 13 Jul 2022 02:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657703877; cv=none; d=google.com; s=arc-20160816; b=MBcUmO+9Rj1tDyhLwZ6f7peQyGz2e30K9SRXn+wAi/OPSPU1QJTx5vkiYDoimaH1N2 Th5Z/EoRDz+7oOTz24JLmT9Qjobhmm7YKlSvjbNJbrtMnNuHF2h2QJXQyKiBPe9JwXaL 0VZroZ6gsCFWKbCQYUFOqsbFcWCMqxq8mJQk5tzoyVtPix1Jl/YlZ7TA67Y7VXKDp/0b +eg2ZdgILc0qeF68T6T6MY1nQDlQ1uVUrD7ItHgqFegqKk+qzXgNka5b7S98QJ7nRsR3 cUeKclFauaxEIcbAToP4l5dxCfU6wNWm/y2baYDb9XLVsSLIuENHbvMtHumJdL/lkWM7 DR1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=KsseY3VaGEA6Gtpa+xml07+PZdfX6eAg1Jc8Y7VyUqU=; b=PQlZlV/CrG5mstHNAEvyFk1RfOeDPBclpGgy66fH8A0foxwE296CgA4xgJgcSWR1f3 aHG62eQUfgpKyTJF4GskcSNXsOzvo3lfc2kztuDqcUXREn0nmPwQ/Hb1YWrcmlqJ3NE+ +2rOjyuj2zz0HfwlhAZkUwDOak57DjpP7cq6Ju83A/d4KiWxcp229E8xdsob0Sqzxs0t YVb5Bxbrgv/iTy6/L4eKt6PWtavBpbS2cVjd+3TWZsUlXp36MJM4tUuqBWkF9X/DosOH lzBHnUIQNzFzHmJNaq4rMIJkM16LHB5R9xdrVBRrLh6Y745u1JGOEFnzbbq6npsBSbaC sA/Q== 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 i1-20020a056402054100b0043aa8412569si14741668edx.315.2022.07.13.02.17.54; Wed, 13 Jul 2022 02:17:57 -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 4EB1668B8C9; Wed, 13 Jul 2022 12:17:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AEDFC68B87F for ; Wed, 13 Jul 2022 12:17:31 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 1FA97240512 for ; Wed, 13 Jul 2022 11:17:30 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id jpAbqd-w7xpR for ; Wed, 13 Jul 2022 11:17:28 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 47CDC240179 for ; Wed, 13 Jul 2022 11:17:28 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id D4AF63A0333; Wed, 13 Jul 2022 11:17:27 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 13 Jul 2022 11:17:20 +0200 Message-Id: <20220713091725.16638-4-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220713091725.16638-1-anton@khirnov.net> References: <20220713091725.16638-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/9] lavf: use AVFrame.duration instead of AVFrame.pkt_duration X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: FBzQiNFdXxYm --- libavformat/mux.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libavformat/mux.c b/libavformat/mux.c index 31361f9b46..a3b50dadb6 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -1417,7 +1417,14 @@ static int write_uncoded_frame_internal(AVFormatContext *s, int stream_index, pkt->size = sizeof(frame); pkt->pts = pkt->dts = frame->pts; - pkt->duration = frame->pkt_duration; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS + if (frame->pkt_duration) + pkt->duration = frame->pkt_duration; + else +FF_ENABLE_DEPRECATION_WARNINGS +#endif + pkt->duration = frame->duration; pkt->stream_index = stream_index; pkt->flags |= AV_PKT_FLAG_UNCODED_FRAME; } From patchwork Wed Jul 13 09:17:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 36772 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:6da0:b0:8b:e47:9dbf with SMTP id wl32csp226020pzb; Wed, 13 Jul 2022 02:18:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sJ5WguYGs0yHdN+bCMbrF+koBm8UkhlNi2csf0Mm1iQPAHURL/MeKjrjWqsMAJ5duVGuz7 X-Received: by 2002:a50:fd93:0:b0:43a:71e2:781e with SMTP id o19-20020a50fd93000000b0043a71e2781emr3476636edt.396.1657703916359; Wed, 13 Jul 2022 02:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657703916; cv=none; d=google.com; s=arc-20160816; b=nVju3ciE7Cwvp5l6VYV0erSkyHpHMbnw/78Tr0lC2i8nWTZVWmyq75e394jo4W/cNb gelzgsxhyFqwgG1ycyYWR1d2cCBmEdmeFfC/h8ZcPT+S1ik2KSg3Tp1wpqP3tImtMAMT vxlW2gc+Q9lrTus6dg6nItxZyPsCFsOQDsLhEXNnee23Ih8cekLYA+S81hd5OnKKkOqN FqM8SNkZOlzt7On7L2lOBVieGCC930Nf4Ssoj8V2gKXvlObYtIBmtfy5bzHGUI10dI7L Pk2NeHy26Njv7pWsQsvxOJD/DXNbikhgkyd/sIx2pRGUXPPtPOcvUnbF+9h6fXnUENdL +SwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=J8w46iIS/L4qVR/CJ7QoApiQbPgHtSAWz6gOnyUIUp0=; b=EfRgFFe/fsyWP7cgoVf03W79RFnpdsSZeKVJPj2ozahyVRxRMo2wNu3hdP7VszvX8s WPdBUaOGdBsHzyMWaKANOnXCqrj56/dZcPWvV+68BYdkX0kvTO+yUGIthSgokVZ3pGMc 19mq/Zit9EVn+8oVFrA14iWgwbOmUGNV2RBtyK3ulYPw8AeEdaDPKTZ8YyGs2KZ9o3xN l7u7fygYWRlxEm63qZHQ9Oj6CDQRhKgsmTnNjp0mYCcHvlZIeo6cI2qokdLoOJyJVc49 UaxgVVhLCZ9bAEZgBk6z3ec5+f+u8XYDx1iG2g+RcjEY5ZlqfegT7MBGIsHhk++qxbQK 9RyQ== 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 dd10-20020a1709069b8a00b006ff17ba1a4dsi19505124ejc.275.2022.07.13.02.18.35; Wed, 13 Jul 2022 02:18:36 -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 5803368B95B; Wed, 13 Jul 2022 12:17:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EDCD568B8B9 for ; Wed, 13 Jul 2022 12:17:36 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id BB718240507 for ; Wed, 13 Jul 2022 11:17:32 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id vioP9ksumgi9 for ; Wed, 13 Jul 2022 11:17:31 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 8E19B2404FE for ; Wed, 13 Jul 2022 11:17:28 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id D96783A0366; Wed, 13 Jul 2022 11:17:27 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 13 Jul 2022 11:17:21 +0200 Message-Id: <20220713091725.16638-5-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220713091725.16638-1-anton@khirnov.net> References: <20220713091725.16638-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/9] lavd: use AVFrame.duration instead of AVFrame.pkt_duration X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: MQNrXrcwmPnJ --- libavdevice/alsa_enc.c | 9 ++++++++- libavdevice/pulse_audio_enc.c | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/libavdevice/alsa_enc.c b/libavdevice/alsa_enc.c index ac09e33c49..e461829d03 100644 --- a/libavdevice/alsa_enc.c +++ b/libavdevice/alsa_enc.c @@ -131,7 +131,14 @@ static int audio_write_frame(AVFormatContext *s1, int stream_index, pkt.data = (*frame)->data[0]; pkt.size = (*frame)->nb_samples * s->frame_size; pkt.dts = (*frame)->pkt_dts; - pkt.duration = (*frame)->pkt_duration; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS + if ((*frame)->pkt_duration) + pkt.duration = (*frame)->pkt_duration; + else +FF_ENABLE_DEPRECATION_WARNINGS +#endif + pkt.duration = (*frame)->duration; return audio_write_packet(s1, &pkt); } diff --git a/libavdevice/pulse_audio_enc.c b/libavdevice/pulse_audio_enc.c index d5928e2b3f..038401c680 100644 --- a/libavdevice/pulse_audio_enc.c +++ b/libavdevice/pulse_audio_enc.c @@ -686,7 +686,14 @@ static int pulse_write_frame(AVFormatContext *h, int stream_index, pkt.data = (*frame)->data[0]; pkt.size = (*frame)->nb_samples * av_get_bytes_per_sample((*frame)->format) * (*frame)->ch_layout.nb_channels; pkt.dts = (*frame)->pkt_dts; - pkt.duration = (*frame)->pkt_duration; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS + if ((*frame)->pkt_duration) + pkt.duration = (*frame)->pkt_duration; + else +FF_ENABLE_DEPRECATION_WARNINGS +#endif + pkt.duration = (*frame)->duration; return pulse_write_packet(h, &pkt); } From patchwork Wed Jul 13 09:17:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 36770 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:6da0:b0:8b:e47:9dbf with SMTP id wl32csp225877pzb; Wed, 13 Jul 2022 02:18:15 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uOtPv2ISiJYB+EAoVQJlKWj2gAQDsxZvcgN4fyG6DntxUr/MoBhIGq+/XQLOhJJaQGrupX X-Received: by 2002:a17:907:7b8a:b0:72a:9a42:d5ac with SMTP id ne10-20020a1709077b8a00b0072a9a42d5acmr2473870ejc.306.1657703895362; Wed, 13 Jul 2022 02:18:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657703895; cv=none; d=google.com; s=arc-20160816; b=pz8E1afEGU0H6kk3Xhi+zFR8bjj+CGO5vusnvVe3H8Bs1ELRfboMBTrQ7/+5k+34Wu MJCr7NEPIlApzRSfPCSkrVAduCWmsJVAxASHnHcfte6lfB4JrN/FRfI7seMsnn0FLHZn q/eEjW5iNmgAaPqxgM2vzmr6fh1rqcIhCiiBK5eIorj+/G8BgfKrjpVy7pkT/XE6ASSj /5DnWtji/6ob4Its/YiTjeeJSEGnFV/Hl5qn8P/nO4eKhk/H9cdRomogq87utGdtc8F0 ZPPbvFqEt/xtzD7tVxqIBzlI7TGfxnUnwhl7sEOOQF5vsjLCjfY5EpYle4fslXgBSjTw ZVyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=n8U4sh2Gu+bJvM3X5cR+UHAFRh0AVi5v4bpfimMKqmY=; b=wTH5g8sGRnkTQSpoGmGu8vf27FyKXc34pUSStJ3arSlRHQZVpGZ8/x6VyP0/AxDsp8 FJGjXGeSrv43EG1lzmnhAJ0UhUpUhW8Wb01KXXUD9A5kmfQqxCQ0yieTFGt8lS7/Brap QXfa6v/ZkTmsACGTqZCuENxebnDX3m1+ZRlObHA5cxoe9bqiDAz+VtLET7cBWXULGQc7 M1N5TFOm+zuJlv7/qBnEvSoB/hBmj9Ne3/Y+QVaAOS9eDTlx7F2u025BqMzR9kV3Lgn9 eMdhsDyXUSLttP2yY5HTCSpeyUSc4s9f57wW/3q2a4jyjZGO1iyqedfbYoicheklndHi IySw== 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 zb13-20020a17090687cd00b0072b978aecccsi2227091ejb.583.2022.07.13.02.18.14; Wed, 13 Jul 2022 02:18:15 -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 6197C68B8B8; Wed, 13 Jul 2022 12:17:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5917568B786 for ; Wed, 13 Jul 2022 12:17:32 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id B09882400F5 for ; Wed, 13 Jul 2022 11:17:31 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id lBojszUSqhqm for ; Wed, 13 Jul 2022 11:17:31 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 9021D240506 for ; Wed, 13 Jul 2022 11:17:28 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id DDA583A036F; Wed, 13 Jul 2022 11:17:27 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 13 Jul 2022 11:17:22 +0200 Message-Id: <20220713091725.16638-6-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220713091725.16638-1-anton@khirnov.net> References: <20220713091725.16638-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 6/9] ffprobe: use AVFrame.duration instead of AVFrame.pkt_duration X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: kkWAaPiIAj6B --- fftools/ffprobe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index f156663019..a041241e1e 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2570,8 +2570,8 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream, print_time("pkt_dts_time", frame->pkt_dts, &stream->time_base); print_ts ("best_effort_timestamp", frame->best_effort_timestamp); print_time("best_effort_timestamp_time", frame->best_effort_timestamp, &stream->time_base); - print_duration_ts ("pkt_duration", frame->pkt_duration); - print_duration_time("pkt_duration_time", frame->pkt_duration, &stream->time_base); + print_duration_ts ("pkt_duration", frame->duration); + print_duration_time("pkt_duration_time", frame->duration, &stream->time_base); if (frame->pkt_pos != -1) print_fmt ("pkt_pos", "%"PRId64, frame->pkt_pos); else print_str_opt("pkt_pos", "N/A"); if (frame->pkt_size != -1) print_val ("pkt_size", frame->pkt_size, unit_byte_str); From patchwork Wed Jul 13 09:17:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 36775 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:6da0:b0:8b:e47:9dbf with SMTP id wl32csp226279pzb; Wed, 13 Jul 2022 02:19:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uoB9Nbr056AQ1JFBUiFC4dnfeuMhtf+ZvuW0IImoCHAEFEwthP88aGPzdAQuW2U8Av/I0I X-Received: by 2002:a17:906:dc8c:b0:726:e51b:d5c3 with SMTP id cs12-20020a170906dc8c00b00726e51bd5c3mr2353738ejc.369.1657703945398; Wed, 13 Jul 2022 02:19:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657703945; cv=none; d=google.com; s=arc-20160816; b=SNpWkfuzsZa+E56UXm9hgAvr68miaUlsMZ0KvXIxhIb9SD4NF4LWl7CzpTDfKWoBi1 VPsBEZIFDh3Q33gbCuYe4y+z28CjG2SyZ9v5G07MaaFojLomjePX6WxtmDIECqwH6Mtg J7HwRIzZq8wQo/pbA6pTGno+Wlj4Pqho+CvYmCsf7ZBf34JHOrkR2+M8GHmwO/vUIUQb RRfKfCtSsnXhqE1JOAy+I2r179cEPNYixF2oLWbm5a7xXecJsnOa6jgGKYccyuU6S8z5 fL2rKDhvInHxBguins2OEUeZ0qDaBdcjAsnEDci+pJJ+o3c6tEOsRR4tpUgtUd+d02fP yiwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=lVaTTxfd80ZhS9DVjXht4SrgEN7IyqoCBjhG+w8np3A=; b=sEdFNlGDpJUwoFvapuDYylR+tXOEidVAyVTmYXYBJvoHgMttIm5gCRVf5pCGUmsDFd NM8GK7U9VZH3HUterNBb0nbBeqwt+rY4U3vzw/0eP4p+cPGaKEBg19qnEy15W/2KOluE n+I62GeGR8ndOOqas7IelQ56osbV2c2J5NbR9B15B8P7Q5vVcXQdVafYAt9bh5g3SBjQ Ui2QfBTSYD2Op263NKDlOLQLThC4vaTz1ukrY31Jv7dj6S8p9hHB50iE6RX0UZrInCQK zdlb2JpBkM3Goap73yoGjMkss7XQTYUJfm5oeyaOcXNAewcF1FO8m6UYOLj6E4OS9SsF K3xg== 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 ee43-20020a056402292b00b0043a71bf3999si1605978edb.57.2022.07.13.02.19.04; Wed, 13 Jul 2022 02:19:05 -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 675B368B9B5; Wed, 13 Jul 2022 12:17:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 11C4668B95B for ; Wed, 13 Jul 2022 12:17:37 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id D4C20240511 for ; Wed, 13 Jul 2022 11:17:33 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id VYaVARmDgTcZ for ; Wed, 13 Jul 2022 11:17:32 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 2128424050B for ; Wed, 13 Jul 2022 11:17:29 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id E26953A0396; Wed, 13 Jul 2022 11:17:27 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 13 Jul 2022 11:17:23 +0200 Message-Id: <20220713091725.16638-7-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220713091725.16638-1-anton@khirnov.net> References: <20220713091725.16638-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 7/9] ffmpeg: use AVFrame.duration instead of AVFrame.pkt_duration X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: yqCSt2wyunNC --- fftools/ffmpeg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index e7384f052a..effcfa1b91 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1107,8 +1107,8 @@ static void do_video_out(OutputFile *of, (nb_filtergraphs == 0 || !filtergraphs[0]->graph_desc) && next_picture && ist && - lrintf(next_picture->pkt_duration * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)) > 0) { - duration = lrintf(next_picture->pkt_duration * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)); + lrintf(next_picture->duration * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)) > 0) { + duration = lrintf(next_picture->duration * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)); } if (!next_picture) { @@ -2229,7 +2229,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_ ist->hwaccel_retrieved_pix_fmt = decoded_frame->format; best_effort_timestamp= decoded_frame->best_effort_timestamp; - *duration_pts = decoded_frame->pkt_duration; + *duration_pts = decoded_frame->duration; if (ist->framerate.num) best_effort_timestamp = ist->cfr_next_pts++; From patchwork Wed Jul 13 09:17:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 36771 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:6da0:b0:8b:e47:9dbf with SMTP id wl32csp225959pzb; Wed, 13 Jul 2022 02:18:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uxPBpK2a//U9uxj8j67Lhq1diDky5/D/x++XV1pzGv7sPtrfKmHiYLD3X4yYXNMFn2fBO7 X-Received: by 2002:a17:907:980f:b0:721:edd3:7d61 with SMTP id ji15-20020a170907980f00b00721edd37d61mr2482086ejc.13.1657703906530; Wed, 13 Jul 2022 02:18:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657703906; cv=none; d=google.com; s=arc-20160816; b=AXwAT5mX7OmIHU4cnvN5tpmuOxRlS5PLpOci2r5UJqcFlhIaLTdRoKSphjVWN0nxPi 8xN4y1TQv7SB+eXMgGrLu8NTkx7tDwtCKK5FZEkp+JkTmRajact+aqNr0agBqQMoquN6 3sTAlNDAv0t7JAdfOb5aY0JvRfyMGNeH3OmKCurYQz2hL6H575lvtEB76XBf8VWpI0TX 73XQiMeyjcReBNLaPV2A1wP2ramptjkCuxo6yWkS0z4EJPFARg621wKES8WvnGQtgVbG TrW1lLJvkIysQFfOsIlKGPEKk6qtdByfX/9b1PG0JCtB67KeJcTMz4Mb9Uo/CywUiPrA fdTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=lOFOYuwTbBG4TmLQ35QL36Y6VfC9dazjGKmO8XBXdMo=; b=n7UKE6Fva78mr5tZD/oLcSHk/FVzrJGDRcyiVasfXI9z9CQyqi8wtCBE6DU2p9641u 2+dhR8JaPSIpBgMJaY+3RrMWWyRcNVF4bfist/g7wYhAdwt5a9vOhazwtsmUkZTr96T1 8uXQWfQ/GR4dSL38RFQPdaLbhHAcLnCU7fNKH+x/D9XiVgy1/x+iDLVzoZrQ1afYH39K TemrSTnhktoZYysX910OlBIQZNJvBdL1Q+eOyF4WCPTaJXWb0WCc1VpYtm3tkXAHagi1 kJSeFmlxvdv0bdm326f0KgKbZ7hVkfY5zUuv0wnsiy92tLLCGn91k4pmmfyzI8jID1W9 5TLw== 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 cw6-20020a170906478600b0072b2141a200si19716229ejc.401.2022.07.13.02.18.26; Wed, 13 Jul 2022 02:18:26 -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 6D66F68B985; Wed, 13 Jul 2022 12:17:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0212868B8E4 for ; Wed, 13 Jul 2022 12:17:33 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 6CEA6240506 for ; Wed, 13 Jul 2022 11:17:32 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id QypjiXEx0_oE for ; Wed, 13 Jul 2022 11:17:30 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id AF36C240507 for ; Wed, 13 Jul 2022 11:17:28 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id E71B83A03E5; Wed, 13 Jul 2022 11:17:27 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 13 Jul 2022 11:17:24 +0200 Message-Id: <20220713091725.16638-8-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220713091725.16638-1-anton@khirnov.net> References: <20220713091725.16638-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 8/9] tests/api: use AVFrame.duration instead of AVFrame.pkt_duration X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 0pnKNesvU559 --- tests/api/api-h264-test.c | 2 +- tests/api/api-seek-test.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/api/api-h264-test.c b/tests/api/api-h264-test.c index b9230c65cb..c89f1ba41a 100644 --- a/tests/api/api-h264-test.c +++ b/tests/api/api-h264-test.c @@ -154,7 +154,7 @@ static int video_decode_example(const char *input_filename) return number_of_written_bytes; } printf("%d, %s, %s, %8"PRId64", %8d, 0x%08"PRIx32"\n", video_stream, - av_ts2str(fr->pts), av_ts2str(fr->pkt_dts), fr->pkt_duration, + av_ts2str(fr->pts), av_ts2str(fr->pkt_dts), fr->duration, number_of_written_bytes, av_adler32_update(0, (const uint8_t*)byte_buffer, number_of_written_bytes)); av_frame_unref(fr); diff --git a/tests/api/api-seek-test.c b/tests/api/api-seek-test.c index 696af9cdfc..e86908e285 100644 --- a/tests/api/api-seek-test.c +++ b/tests/api/api-seek-test.c @@ -156,7 +156,7 @@ static int compute_crc_of_packets(AVFormatContext *fmt_ctx, int video_stream, } av_frame_unref(fr); } - } while (result >= 0 && (no_seeking || (fr->pts + fr->pkt_duration <= ts_end))); + } while (result >= 0 && (no_seeking || (fr->pts + fr->duration <= ts_end))); finish: av_freep(&byte_buffer); From patchwork Wed Jul 13 09:17:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 36774 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:6da0:b0:8b:e47:9dbf with SMTP id wl32csp226191pzb; Wed, 13 Jul 2022 02:18:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sjepaCPAubqU8Bf/rnKMW/DCNwxw4X5cpE1gac4Q1ak8+wokCkg4rMgXcHp651TTli37Iv X-Received: by 2002:a17:907:9613:b0:72b:68df:8ada with SMTP id gb19-20020a170907961300b0072b68df8adamr2523320ejc.31.1657703935080; Wed, 13 Jul 2022 02:18:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657703935; cv=none; d=google.com; s=arc-20160816; b=PLnkQgZifDYGVvPG9Jcn3Ou7WSotDKtObUiuKecv7nprCNaB3BzbGvyxuJRTcCWq8B /7hBCVSxM2ZkTdGnLDKwQnong5OX913lq1oPKOY8rjLnC8F5T6IHZiegIs6oP1XVheR0 h42Do1YRWQnRr/9fZSspJC+K6wgrMk2oJA9I6n5td+SWHJ1Ej3KsV9zahPo+VAbN317i wR1y6XT5/A8ujZM9ZR5e2FCLaGenFat3c/RgpT0D39jAMJEH2lxHn1Ul67quQQbzH/tM ISU7807f3Bac6NkXMRDHE3+dgj2HbAE2q8C0jsN5LC67R9QVyfNt9TQyON7j3Vdf7ksG d1ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=Qp8gsJYzv3FmIxEWXRK01SekWv7eSb79w5m6X9yoq2M=; b=STaBmcx21m1QNrEt+B5eppH1+unc9FJ1D7KzUqEGIEnn8bvkUIM+Ins/BKjgc9hCPM LQleF7/9jL0so4Or5681iIoKI3/9ZcxIm+ZESrbPlg2Hk+DOuHs80903uX28p9fTayCy OiJiC5P7/9nwFfmYkLPndzflDTd6XtIHezDZLiPA6mfndAyw5HAKnPOz2+Sw7Zq3oAkg Q1YaGTuMDtpYSZ4oZrPkfGQTJVWWDI4EvPK8Y4ho5EvqUWe11HpmoYU+eOgPTeYmvg97 XENi+5R3ect64kbmhF5R5uf17AlRToj9CqXvP3asriTJae+hyu55i4hZKy+GprSD3jqn 7cXg== 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 o4-20020a056402438400b0043ac721c313si8657157edc.550.2022.07.13.02.18.54; Wed, 13 Jul 2022 02:18:55 -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 61B3368B99F; Wed, 13 Jul 2022 12:17:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0897C68B948 for ; Wed, 13 Jul 2022 12:17:37 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 975B524017E for ; Wed, 13 Jul 2022 11:17:33 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 09VHqeXcshcL for ; Wed, 13 Jul 2022 11:17:33 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 212DF240511 for ; Wed, 13 Jul 2022 11:17:29 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id EB78E3A03EE; Wed, 13 Jul 2022 11:17:27 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 13 Jul 2022 11:17:25 +0200 Message-Id: <20220713091725.16638-9-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220713091725.16638-1-anton@khirnov.net> References: <20220713091725.16638-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 9/9] lavfi/vf_showinfo: print frame durations X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: pjx7iOIYDCh0 --- libavfilter/vf_showinfo.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c index 6efcafce28..2c8514fc80 100644 --- a/libavfilter/vf_showinfo.c +++ b/libavfilter/vf_showinfo.c @@ -709,10 +709,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) } av_log(ctx, AV_LOG_INFO, - "n:%4"PRId64" pts:%7s pts_time:%-7s pos:%9"PRId64" " + "n:%4"PRId64" pts:%7s pts_time:%-7s duration:%7"PRId64 + " duration_time:%-7s pos:%9"PRId64" " "fmt:%s sar:%d/%d s:%dx%d i:%c iskey:%d type:%c ", inlink->frame_count_out, - av_ts2str(frame->pts), av_ts2timestr(frame->pts, &inlink->time_base), frame->pkt_pos, + av_ts2str(frame->pts), av_ts2timestr(frame->pts, &inlink->time_base), + frame->duration, av_ts2timestr(frame->duration, &inlink->time_base), + frame->pkt_pos, desc->name, frame->sample_aspect_ratio.num, frame->sample_aspect_ratio.den, frame->width, frame->height,