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 85432465CE for ; Mon, 22 May 2023 14:55:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6AC8768C08B; Mon, 22 May 2023 17:55:10 +0300 (EEST) Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C014468A661 for ; Mon, 22 May 2023 17:55:03 +0300 (EEST) Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-19a77e4c8dcso1712485fac.1 for ; Mon, 22 May 2023 07:55:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684767302; x=1687359302; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=JdB3QELllqIJu0ft3+t1DWtrMBJFS5zv05Tcjj+0TYU=; b=h91205BwVq88xSsVkb4lZDOr10GJZXKvqaq4+VXzV3ZXwmWZyMZVA5Mah/G4htTSc2 XjcZGzmU9YEVED2hOLrDohDLvWIfvXZQnnGBpMiUCMwvhUg3xlOy48DOSX74r76fHntW I9fAy1vI/vD5w3XKxwXRhtJLmxeShZyv609aorqu5rBHvFKHiVrTOKgUCLPZeUaHPfGN Rg+A85m0gStQRmW5pTEqZ537qPua9VBs5P7TzkIQHGfHBuV5eODhgJR+liYop3F0m92R JxaxwOcXT6n0OVBjvCcBEPFnS6amDWqukT3uKI3Xxq0O6avcdo9b2EqwMI4cekiIR8hT O5sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684767302; x=1687359302; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JdB3QELllqIJu0ft3+t1DWtrMBJFS5zv05Tcjj+0TYU=; b=lxi5mQrdx1ZHuDGc3igBcL1dKLsjqjj4ooeU2bF6AxJcimJPezEaKMgCtIjkJ90rzb /BhdUgKzpqngkLlewtgCsiJ92HTlRVfy9YPt+pKHoNrllyqRnuw+S+ktZ5pwxjT8KTOD tCr0zRKp7NU5A9CsrOUozpNkQjf/z8v9ehBkzMW00+JgxQ/NejWrH8kXwAslKskgUy+r kQLUDNgfWUppyZNfpzvaVa94dMvl9/4iWo1Rt5EZdkRH5u8CCHYaGHyYVkgUGyF5djsV juKcyw+d6+P+HddarZN23Fx9hhzklK6grhXZYmk3PeuiOJ1OniAKlHtyvkTpdK/s6w6I ZuAQ== X-Gm-Message-State: AC+VfDz3dTzDbOXDxSMKePukt1n9uRbu27J6a1GcJeKPFMS7Y5scrfX4 Y2jyQwJrXRgNs663VGdeC3OcFlC9uqA= X-Google-Smtp-Source: ACHHUZ6n4L/aD7vFrNB4AtuWxSG0XYMAzFE7xc+C1OVR7CNKc4gRAosjX4BHCyzawRIvW8dg3poxlQ== X-Received: by 2002:a05:6870:3a0e:b0:18e:7c5e:b5c1 with SMTP id du14-20020a0568703a0e00b0018e7c5eb5c1mr6343900oab.45.1684767301542; Mon, 22 May 2023 07:55:01 -0700 (PDT) Received: from [192.168.0.12] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id ef13-20020a0568701a8d00b0018449ae08cesm2524783oab.13.2023.05.22.07.55.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 May 2023 07:55:01 -0700 (PDT) Message-ID: Date: Mon, 22 May 2023 11:55:20 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <168476689514.3843.4949335214874548540@lain.khirnov.net> From: James Almer In-Reply-To: <168476689514.3843.4949335214874548540@lain.khirnov.net> 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 5/22/2023 11:48 AM, Anton Khirnov wrote: > 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. How so? He set the AV_CODEC_FLAG_COPY_OPAQUE flag and the pkt.opaque field before calling avcodec_send_packet(). Also, this version is out of date. He pushed a more complete one (that could have sent to the list, admittedly). > >> + 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? > _______________________________________________ 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".