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 9F0C740EAF for ; Mon, 11 Apr 2022 09:00:57 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 214B568B39E; Mon, 11 Apr 2022 12:00:56 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3211368B324 for ; Mon, 11 Apr 2022 12:00:50 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id D863B240179 for ; Mon, 11 Apr 2022 11:00:49 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id GwszA0o4mipe for ; Mon, 11 Apr 2022 11:00:49 +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 3A2D62400F5 for ; Mon, 11 Apr 2022 11:00:49 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id CCD033A0406; Mon, 11 Apr 2022 10:39:15 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Apr 2022 10:39:08 +0200 Message-Id: <20220411083908.28802-1-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <367f4d8c-5a36-af62-b4de-f2b0f69458d0@gmail.com> References: <367f4d8c-5a36-af62-b4de-f2b0f69458d0@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] lavc/encode: drop EncodeSimpleContext 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: It has only a single member. --- libavcodec/avcodec.c | 4 ++-- libavcodec/encode.c | 7 +++---- libavcodec/internal.h | 12 +++++++----- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index c7daa385e7..e0f38ac42a 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -432,7 +432,7 @@ void avcodec_flush_buffers(AVCodecContext *avctx) while (av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1) >= 0) av_packet_unref(avci->last_pkt_props); - av_frame_unref(avci->es.in_frame); + av_frame_unref(avci->in_frame); av_packet_unref(avci->in_pkt); if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME) @@ -498,7 +498,7 @@ av_cold int avcodec_close(AVCodecContext *avctx) av_packet_free(&avci->last_pkt_props); av_packet_free(&avci->in_pkt); - av_frame_free(&avci->es.in_frame); + av_frame_free(&avci->in_frame); av_buffer_unref(&avci->pool); diff --git a/libavcodec/encode.c b/libavcodec/encode.c index 837ffaa40d..8b0d4443cd 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -175,8 +175,7 @@ int ff_encode_get_frame(AVCodecContext *avctx, AVFrame *frame) static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt) { AVCodecInternal *avci = avctx->internal; - EncodeSimpleContext *es = &avci->es; - AVFrame *frame = es->in_frame; + AVFrame *frame = avci->in_frame; const FFCodec *const codec = ffcodec(avctx->codec); int got_packet; int ret; @@ -565,8 +564,8 @@ FF_ENABLE_DEPRECATION_WARNINGS avctx->internal->intra_only_flag = AV_PKT_FLAG_KEY; if (ffcodec(avctx->codec)->encode2) { - avci->es.in_frame = av_frame_alloc(); - if (!avci->es.in_frame) + avci->in_frame = av_frame_alloc(); + if (!avci->in_frame) return AVERROR(ENOMEM); } diff --git a/libavcodec/internal.h b/libavcodec/internal.h index f9d08fcb60..2fa56d3a59 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -47,10 +47,6 @@ # define STRIDE_ALIGN 8 #endif -typedef struct EncodeSimpleContext { - AVFrame *in_frame; -} EncodeSimpleContext; - typedef struct AVCodecInternal { /** * When using frame-threaded decoding, this field is set for the first @@ -101,7 +97,13 @@ typedef struct AVCodecInternal { void *frame_thread_encoder; - EncodeSimpleContext es; + /** + * The input frame is stored here for encoders implementing the simple + * encode API. + * + * Not allocated in other cases. + */ + AVFrame *in_frame; /** * If this is set, then FFCodec->close (if existing) needs to be called -- 2.34.1 _______________________________________________ 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".