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 C4AA948B48 for ; Wed, 3 Jan 2024 20:45:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 70D1F68CC85; Wed, 3 Jan 2024 22:45:49 +0200 (EET) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2AF4068C9A1 for ; Wed, 3 Jan 2024 22:45:43 +0200 (EET) Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-3374c693f92so856864f8f.1 for ; Wed, 03 Jan 2024 12:45:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20230601.gappssmtp.com; s=20230601; t=1704314742; x=1704919542; darn=ffmpeg.org; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=NryPixBBSFDJePLBDA8d1fbXEoamHAeXR8tFqkBZExU=; b=2MkaBj4AzClGYVIsR0hZ3zwyFhhIlmz5n1O4YhKdM8Dd7C5STIedlUPlSAnHYPc/cK h1OHE3IwMSZKOT2lfhU57rlQI1xgqViVezzgFtfrzXEmNm5a2jagfISNMo90oC19VRod C/HF6njJ5MfbaOTpLlvdvAly3uuaeb9h8CIbl8cgG/2JcPqnlRKABaqNdYKt+PQQq+BC GvcaY9JcyyBZwfyVRorspknLzXQk8PkmE1G8GkD/8N18iSkVMuJkHZlv1cERojEQYYtH Y0uHwFD5uc+Qi7skayh5P+X5MFUVS69PaIh8yAngH7N0t0UuUAW403Tw59pZ4BwnjXCy 6tcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704314742; x=1704919542; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=NryPixBBSFDJePLBDA8d1fbXEoamHAeXR8tFqkBZExU=; b=m+hiNRLv9dihUUs1VKSKcOJuU8rkv5JGsuiLKa6IfQAnHFXwwZAd7RES1IPt3ehJjC eZ0qluvhqJ5IjoF/L0xAZgBqmUe7+hl0Vu55lC3Uj6eSMJ9Ii5HURCvcmYym7e+/J++d +twEYe9+AjlB7m7fO6cpOzH3F8JAMRziULtl2HkoSkRyTs3PzjC762xL193TRx+s+G7D CB8NqEISkMDmgahGkyO6dBe4wP7EtZKg6q0r6h4bHlDFAeU+EugAvP8HXQw7QpYSo+PZ e7mldbkWUZ6sv5NfB7FAbGknaX2BC6yIiCqOuXlxivFVM4+7hjAqFhFISL3wOFpx67+a XYpA== X-Gm-Message-State: AOJu0Yxn1Ez1/+RBZ7CIPBLDSnQCCWAsADCRxcl50eZj8XtmVCaWJoqu /DnEztzD38LCpxUOMMYi5vXsS90i00iJiS9+5YOc/z8Sq58= X-Google-Smtp-Source: AGHT+IHU425MSqBqDXrwL/UY4jouJn8tsQjDa4QfP1RYEPhlIejjORzuLUeaSCQiXIMqN7EZm0QvjQ== X-Received: by 2002:adf:f8d1:0:b0:336:73d6:413b with SMTP id f17-20020adff8d1000000b0033673d6413bmr8440709wrq.44.1704314742226; Wed, 03 Jan 2024 12:45:42 -0800 (PST) Received: from [192.168.0.15] (cpc92302-cmbg19-2-0-cust1183.5-4.cable.virginm.net. [82.1.212.160]) by smtp.gmail.com with ESMTPSA id b2-20020a5d4b82000000b003367ff4aadasm31246516wrt.31.2024.01.03.12.45.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Jan 2024 12:45:41 -0800 (PST) Message-ID: <084180be-b440-4071-b118-c6b26a71c483@jkqxz.net> Date: Wed, 3 Jan 2024 20:46:04 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: FFmpeg development discussions and patches From: Mark Thompson Subject: [FFmpeg-devel] [PATCH] avfilter: Temporary hack to fix format negotiation for hw formats 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: hw_frames_ctx on the input link is only set when the input link is configured, which hasn't happened yet. This temporarily hacks around the problem (in a way no worse than before the format negotiation changes) until a proper fix can be applied. --- Suggested full fix is to carry sw_format through the format negotiation separately so that we don't need hw_frames_ctx to be set (which also has other benefits like hwdownload being able to set its output format). This hack is needed until that is ready because all hw formats are broken right now. libavfilter/avfiltergraph.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index 727eff81ee..bc503f6ebe 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -667,8 +667,11 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref) if (link->type == AVMEDIA_TYPE_VIDEO) { enum AVPixelFormat swfmt = link->format; if (av_pix_fmt_desc_get(swfmt)->flags & AV_PIX_FMT_FLAG_HWACCEL) { - av_assert1(link->hw_frames_ctx); - swfmt = ((AVHWFramesContext *) link->hw_frames_ctx->data)->sw_format; + // FIXME: this is a hack to work around hw_frames_ctx not yet + // being available to return the real sw_format. Once that is + // fixed, this should instead be: + // swfmt = ((AVHWFramesContext *) link->hw_frames_ctx->data)->sw_format; + swfmt = AV_PIX_FMT_YUV420P; } if (!ff_fmt_is_regular_yuv(swfmt)) { -- 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".