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 DFCEB4572E for ; Mon, 22 May 2023 14:48:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8DD7A68C052; Mon, 22 May 2023 17:48:22 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A0123687FE5 for ; Mon, 22 May 2023 17:48:16 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 0004A2404EC for ; Mon, 22 May 2023 16:48:15 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id d-TqI1FijAmr for ; Mon, 22 May 2023 16:48:15 +0200 (CEST) Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (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 "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 49A8D240177 for ; Mon, 22 May 2023 16:48:15 +0200 (CEST) Received: by lain.khirnov.net (Postfix, from userid 1000) id 2AF581601B2; Mon, 22 May 2023 16:48:15 +0200 (CEST) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: References: Mail-Followup-To: FFmpeg development discussions and patches Date: Mon, 22 May 2023 16:48:15 +0200 Message-ID: <168476689514.3843.4949335214874548540@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] avfilter/src_movie: activate & dr 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: Quoting Paul B Mahol (2023-05-18 12:22:07) > From af73b69a0be9033fddf222b6e9ac60799de85691 Mon Sep 17 00:00:00 2001 > From: Paul B Mahol > Date: Mon, 15 May 2023 21:54:25 +0200 > Subject: [PATCH 26/27] avfilter/src_movie: dr support > > Signed-off-by: Paul B Mahol > --- > libavfilter/src_movie.c | 44 +++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 42 insertions(+), 2 deletions(-) > > diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c > index 5937613d13..a2ecc5a625 100644 > --- a/libavfilter/src_movie.c > +++ b/libavfilter/src_movie.c > @@ -23,7 +23,6 @@ > * @file > * movie video source > * > - * @todo use direct rendering (no allocation of a new frame) > * @todo support a PTS correction mechanism > */ > > @@ -156,6 +155,43 @@ static AVStream *find_stream(void *log, AVFormatContext *avf, const char *spec) > return found; > } > > +static int get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags) > +{ > + int linesize_align[AV_NUM_DATA_POINTERS]; > + AVFilterLink *outlink = frame->opaque; This is not guaranteed to be set. Use AVCodecContext.opaque instead. > + int w, h, ow, oh; > + AVFrame *new; > + > + h = oh = frame->height; > + w = ow = frame->width; > + > + if (!(avctx->codec->capabilities & AV_CODEC_CAP_DR1)) > + return avcodec_default_get_buffer2(avctx, frame, flags); > + > + switch (avctx->codec_type) { > + case AVMEDIA_TYPE_VIDEO: > + avcodec_align_dimensions2(avctx, &w, &h, linesize_align); > + new = ff_default_get_video_buffer(outlink, w, h); > + break; > + case AVMEDIA_TYPE_AUDIO: > + new = ff_default_get_audio_buffer(outlink, frame->nb_samples); > + break; > + default: > + return -1; > + } > + > + av_frame_copy_props(new, frame); > + av_frame_unref(frame); > + av_frame_move_ref(frame, new); > + av_frame_free(&new); > + > + frame->opaque = outlink; For what purpose? -- Anton Khirnov _______________________________________________ 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".