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 D7E0D460C5 for ; Fri, 5 May 2023 09:08:11 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7983868C135; Fri, 5 May 2023 12:07:41 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E668A68AB4A for ; Fri, 5 May 2023 12:07:31 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id AF061240177 for ; Fri, 5 May 2023 11:07:31 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 6UNzXWMGyP1v for ; Fri, 5 May 2023 11:07: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 05A452404F5 for ; Fri, 5 May 2023 11:07:30 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id EA5033A1506 for ; Fri, 5 May 2023 11:07:29 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 May 2023 11:07:19 +0200 Message-Id: <20230505090723.24872-7-anton@khirnov.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505090723.24872-1-anton@khirnov.net> References: <20230505090723.24872-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 07/11] fftools/ffmpeg_filter: move InputFilter.hw_frames_ctx to private data 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 is not used outside of ffmpeg_filter. --- fftools/ffmpeg.h | 2 -- fftools/ffmpeg_filter.c | 16 +++++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 8a2254d2a8..c7e225d1a0 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -289,8 +289,6 @@ typedef struct InputFilter { int sample_rate; AVChannelLayout ch_layout; - - AVBufferRef *hw_frames_ctx; } InputFilter; typedef struct OutputFilter { diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 087ef8b894..34c51c23d9 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -61,6 +61,8 @@ typedef struct InputFilterPriv { AVFifo *frame_queue; + AVBufferRef *hw_frames_ctx; + int32_t *displaymatrix; // fallback parameters to use when no input is ever sent @@ -282,7 +284,7 @@ void fg_free(FilterGraph **pfg) av_channel_layout_uninit(&ifp->fallback.ch_layout); - av_buffer_unref(&ifilter->hw_frames_ctx); + av_buffer_unref(&ifp->hw_frames_ctx); av_freep(&ifilter->name); av_freep(&fg->inputs[j]); } @@ -1051,7 +1053,7 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter, if ((ret = avfilter_graph_create_filter(&ifilter->filter, buffer_filt, name, args.str, NULL, fg->graph)) < 0) goto fail; - par->hw_frames_ctx = ifilter->hw_frames_ctx; + par->hw_frames_ctx = ifp->hw_frames_ctx; ret = av_buffersrc_parameters_set(ifilter->filter, par); if (ret < 0) goto fail; @@ -1413,7 +1415,7 @@ static int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *fr AVFrameSideData *sd; int ret; - av_buffer_unref(&ifilter->hw_frames_ctx); + av_buffer_unref(&ifp->hw_frames_ctx); ifilter->format = frame->format; @@ -1432,8 +1434,8 @@ static int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *fr ifp->displaymatrix = av_memdup(sd->data, sizeof(int32_t) * 9); if (frame->hw_frames_ctx) { - ifilter->hw_frames_ctx = av_buffer_ref(frame->hw_frames_ctx); - if (!ifilter->hw_frames_ctx) + ifp->hw_frames_ctx = av_buffer_ref(frame->hw_frames_ctx); + if (!ifp->hw_frames_ctx) return AVERROR(ENOMEM); } @@ -1565,8 +1567,8 @@ int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame, int keep_reference) if (!ifilter->ist->reinit_filters && fg->graph) need_reinit = 0; - if (!!ifilter->hw_frames_ctx != !!frame->hw_frames_ctx || - (ifilter->hw_frames_ctx && ifilter->hw_frames_ctx->data != frame->hw_frames_ctx->data)) + if (!!ifp->hw_frames_ctx != !!frame->hw_frames_ctx || + (ifp->hw_frames_ctx && ifp->hw_frames_ctx->data != frame->hw_frames_ctx->data)) need_reinit = 1; if (sd = av_frame_get_side_data(frame, AV_FRAME_DATA_DISPLAYMATRIX)) { -- 2.39.2 _______________________________________________ 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".