From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id E482C48C9B for ; Wed, 24 Jan 2024 08:20:22 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 38AEC68D18B; Wed, 24 Jan 2024 10:17:48 +0200 (EET) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 432C568D0F4 for ; Wed, 24 Jan 2024 10:17:27 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=sVp36GeP; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 274C31A44 for ; Wed, 24 Jan 2024 09:17:24 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id BcvrHf4xqd8u for ; Wed, 24 Jan 2024 09:17:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1706084240; bh=zX4Q3u9PeaeyWHtBPwJ69d2nCJadiTvJSi2BKKcYRgg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sVp36GePEcu9bXpZdcpXy0JJ/pb7nRNt5XjZTdG0yT5j7/fPToayqae+1aIZFriTe 6sNyb5odZFR+uxpNcwQ/BzKgxU0WZmgtwfomd6BvHorRe3wczhyopwfbzqB8g6LInk BxidUzj9aOVwu6gDOyGdlP3HadNAgNLgQg66V9xS/vUTiB6IK9sCEx6LmkMOLra4oQ 7uZv268aq1yu7usyuNO2M5p/9U2lsS/QtyD6QrJfJyw98SQSuVzWtsulDiLorjzAQ6 U1CBCDWEz86tDpvmFUngjEOOF2fOWiCXfIT1gnnCTlH4tZGhUqCcW4TKhALKMhUuf2 tTpf02cFBGPig== 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 mail1.khirnov.net (Postfix) with ESMTPS id 2904A1BB5 for ; Wed, 24 Jan 2024 09:17:20 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 16D403A061F for ; Wed, 24 Jan 2024 09:17:20 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Jan 2024 09:16:51 +0100 Message-ID: <20240124081702.4759-21-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240124081702.4759-1-anton@khirnov.net> References: <20240124081702.4759-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 21/31] fftools/ffmpeg_dec: pass top_field_first through DecoderOpts 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Do not read it from InputStream directly. This is a step towards decoupling Decoder and InputStream. --- fftools/ffmpeg.h | 3 +++ fftools/ffmpeg_dec.c | 2 +- fftools/ffmpeg_demux.c | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 5d6a538aa0..9add5cac85 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -287,6 +287,9 @@ enum DecoderFlags { // decoder should override timestamps by fixed framerate // from DecoderOpts.framerate DECODER_FLAG_FRAMERATE_FORCED = (1 << 2), +#if FFMPEG_OPT_TOP + DECODER_FLAG_TOP_FIELD_FIRST = (1 << 3), +#endif }; typedef struct DecoderOpts { diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c index 4a2ea83f97..e34b23b40c 100644 --- a/fftools/ffmpeg_dec.c +++ b/fftools/ffmpeg_dec.c @@ -318,7 +318,7 @@ static int video_frame_process(InputStream *ist, AVFrame *frame) DecoderPriv *dp = dp_from_dec(ist->decoder); #if FFMPEG_OPT_TOP - if(ist->top_field_first>=0) { + if (dp->flags & DECODER_FLAG_TOP_FIELD_FIRST) { av_log(dp, AV_LOG_WARNING, "-top is deprecated, use the setfield filter instead\n"); frame->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST; } diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 4cced4a7f8..3c3be214c5 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -905,7 +905,11 @@ static int ist_use(InputStream *ist, int decoding_needed) return ret; ds->dec_opts.flags = (!!ist->fix_sub_duration * DECODER_FLAG_FIX_SUB_DURATION) | - (!!(d->f.ctx->iformat->flags & AVFMT_NOTIMESTAMPS) * DECODER_FLAG_TS_UNRELIABLE); + (!!(d->f.ctx->iformat->flags & AVFMT_NOTIMESTAMPS) * DECODER_FLAG_TS_UNRELIABLE) +#if FFMPEG_OPT_TOP + | ((ist->top_field_first >= 0) * DECODER_FLAG_TOP_FIELD_FIRST) +#endif + ; if (ist->framerate.num) { ds->dec_opts.flags |= DECODER_FLAG_FRAMERATE_FORCED; -- 2.42.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".