From patchwork Thu Oct 26 14:23:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 44363 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bf16:b0:15d:8365:d4b8 with SMTP id gc22csp671019pzb; Thu, 26 Oct 2023 07:24:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9uteYkEYu1fJmd6JGshsFpc7N9tXop1gUKIF7kUkbKRoJkvTHvJHQ0zjEnSLyP/P3Xivl X-Received: by 2002:a17:907:86a0:b0:9bd:fc4a:c70b with SMTP id qa32-20020a17090786a000b009bdfc4ac70bmr16144915ejc.70.1698330241238; Thu, 26 Oct 2023 07:24:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698330241; cv=none; d=google.com; s=arc-20160816; b=Tkvqu7p3xbcD6Um3313sapJME3GLWZwz3fCMWcpSOeQC7eeyHDaaEVfCmIyg1Mf1G6 7pxHX6jDjjwYpzwy0/UY5Rb6b1otDplZMgWOjheAxFMFQWd4hk6OlBHQoBshYwg27bhX Q+L25b+Mzx5at0w9RGfs2Im+8f/M5eopsmjhc0s/0GGG9BPsKAdzJJDTCTXbOX0wlPpW IwIr96DzpIXOq+dkQl+1vZr+XyLN8/rZ/bIw2cfoDsCb5N4/g165UGCd4YSMIrLDEuk2 worTk025lhrYAsBIiiilx6FnmTNhpggEWrw2iI8G7f2RT9notg8mqJNbUbUsz/4AE5hV ecfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=AAkPZK3pBfIc9EW/eNknKzvMGYaA080LQt+8GQwxN3o=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=k1YaBEgNrmQpPmcHIDtYq/PYElpFScgh4krga/hz+kY1cVnmzpRkxmMhxBmBxVSRua P6pjlN260PWsoDD67izLVohh3Cq8Xaft1SXDgjWuKbbJzoRDC2VOhAysQRT8E5TAe8LK AB0CJFfQzp99knGrpHCG8QkPueqs0yzbtijbkn0PqlyM4Ij2x+krhlhKz2Bl+j75rpBt 92fUM9fp543M3K1FlXrki+cNFsXtTqY6kNEUgYm3LGJVxF6A/6JoQtUFRMulGJ1qTxh2 +Ck/wofBF5NeZ+2ShQxXJit/gPoOeOK1HwCDudBJbQkrpfp6oRC8B1B35qxYXLoeRA7b e4Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=I3fYIOWV; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id kf10-20020a17090776ca00b0099396547000si6138385ejc.767.2023.10.26.07.23.41; Thu, 26 Oct 2023 07:24:01 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=I3fYIOWV; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F1A8168CB83; Thu, 26 Oct 2023 17:23:38 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 192BA68C6BF for ; Thu, 26 Oct 2023 17:23:33 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id D141E49516; Thu, 26 Oct 2023 16:23:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1698330212; bh=WMMdpCgtpF/0OOHndTMhGAAC8xp3vyCO1rMPJu2pDHE=; h=From:To:Cc:Subject:Date:From; b=I3fYIOWVYQACQxL9skuV9gWykmhE1VAzMxCWkrqjUtVH7qWeJ+kzi7M8tXMHy01Pw Z7jr1ucgLXRsSILvyGuthcpIHMxrfKGaGAdTAoLGKJyfxjMRIB6o9ONfqkvpLKL7fM QCOq52F3FfyCve3Xs7wq4FmhV0TyPIXvYZOtevco= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Thu, 26 Oct 2023 16:23:23 +0200 Message-ID: <20231026142327.52694-1-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 1/5] avfilter/drawutils: ban XYZ 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 Cc: Niklas Haas Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: L6Ng1zgaeg/9 From: Niklas Haas These are not supported by the drawing functions at all, and were incorrectly advertised as supported in the past. Note: This check is added only to separate the logic change from the API change in the following commit, and will be removed again after it becomes redundant. --- libavfilter/drawutils.c | 3 +++ tests/ref/fate/filter-pixfmts-pad | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c index 1081938d86..c31ab6bd5a 100644 --- a/libavfilter/drawutils.c +++ b/libavfilter/drawutils.c @@ -22,6 +22,7 @@ #include #include "libavutil/avassert.h" +#include "libavutil/avstring.h" #include "libavutil/avutil.h" #include "libavutil/csp.h" #include "libavutil/intreadwrite.h" @@ -93,6 +94,8 @@ int ff_draw_init2(FFDrawContext *draw, enum AVPixelFormat format, enum AVColorSp return AVERROR(ENOSYS); if (desc->flags & ~(AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA)) return AVERROR(ENOSYS); + if (av_strstart(desc->name, "xyz", NULL)) + return AVERROR(ENOSYS); if (csp == AVCOL_SPC_UNSPECIFIED) csp = (desc->flags & AV_PIX_FMT_FLAG_RGB) ? AVCOL_SPC_RGB : AVCOL_SPC_SMPTE170M; if (!(desc->flags & AV_PIX_FMT_FLAG_RGB) && !(luma = av_csp_luma_coeffs_from_avcsp(csp))) diff --git a/tests/ref/fate/filter-pixfmts-pad b/tests/ref/fate/filter-pixfmts-pad index dd01059c59..b4d236d408 100644 --- a/tests/ref/fate/filter-pixfmts-pad +++ b/tests/ref/fate/filter-pixfmts-pad @@ -43,7 +43,6 @@ rgb48le ed08db9b1aa50d69b8c3d73db93e390e rgba b157c90191463d34fb3ce77b36c96386 vuya 44368c0a758ee68e24ce976e3b1b8535 vuyx bc7c4f693a22cd1ac95e33d473086474 -xyz12le 23dadbbba70b2925ce75fb8ba8080ba3 ya16le 8dbfcb586abf626da7d1aca887a581b9 ya8 495daaca2dcb4f7aeba7652768b41ced yuv410p cb871dcc1e84a7ef1d21f9237b88cf6e