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 1C06F48694 for ; Wed, 14 Feb 2024 22:06:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F38D068D1EE; Thu, 15 Feb 2024 00:06:41 +0200 (EET) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 92F2168D145 for ; Thu, 15 Feb 2024 00:06:33 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 0238B60007 for ; Wed, 14 Feb 2024 22:06:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1707948393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=Pn3/hR6OVLsLLof1EQaRpnzH0CyUyuGgYexImPHZExw=; b=KTnwnXD+yGL6+CLMQ/ePpptohPLxXChc5YRYWUM+dig7wUSKuscsS4ZwFqylzSKGvpU7Jf E3UbxR0XjjqvRRUNBnJ1FW9NPS26yUXxI4vfaRqy8Wjr45V3y8LOuOx/y7IByS6u7Kz9ra 2kARCKWCPXJKK11y5dwZfNAK2O7jJ6tOp7m6djEj7qrFlw0Rh1guDucZQV8RNXsWePcwn1 YaoQS8OW9K4ay2SrYUkHrOx7H20Hlsnx/HFuaRxj/HbLPMnmWqoCM2dQVdIq2HzXqpyA6J sRUf3w6ew/dXUTDC0rZuWOmMSmQMjQ4VAno58pjuqd7kB2Fg1iSYUhxdm6GZTQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 14 Feb 2024 23:06:26 +0100 Message-Id: <20240214220631.9641-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240214220631.9641-1-michael@niedermayer.cc> References: <20240214220631.9641-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/7] swscale/tests/swscale: Split sws_getContext() 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 MIME-Version: 1.0 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: Signed-off-by: Michael Niedermayer --- libswscale/tests/swscale.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c index f853bc4c913..6792fcaa3dc 100644 --- a/libswscale/tests/swscale.c +++ b/libswscale/tests/swscale.c @@ -30,6 +30,7 @@ #include "libavutil/mem.h" #include "libavutil/avutil.h" #include "libavutil/crc.h" +#include "libavutil/opt.h" #include "libavutil/pixdesc.h" #include "libavutil/lfg.h" @@ -165,10 +166,26 @@ static int doTest(const uint8_t * const ref[4], int refStride[4], int w, int h, } } - dstContext = sws_getContext(srcW, srcH, srcFormat, dstW, dstH, dstFormat, - flags, NULL, NULL, NULL); + dstContext = sws_alloc_context(); if (!dstContext) { - fprintf(stderr, "Failed to get %s ---> %s\n", + fprintf(stderr, "Failed to alloc %s ---> %s\n", + desc_src->name, desc_dst->name); + res = -1; + goto end; + } + + av_opt_set_int(dstContext, "sws_flags", flags, 0); + av_opt_set_int(dstContext, "srcw", srcW, 0); + av_opt_set_int(dstContext, "srch", srcH, 0); + av_opt_set_int(dstContext, "dstw", dstW, 0); + av_opt_set_int(dstContext, "dsth", dstH, 0); + av_opt_set_int(dstContext, "src_format", srcFormat, 0); + av_opt_set_int(dstContext, "dst_format", dstFormat, 0); + av_opt_set(dstContext, "alphablend", "none", 0); + + if (sws_init_context(dstContext, NULL, NULL) < 0) { + sws_freeContext(dstContext); + fprintf(stderr, "Failed to init %s ---> %s\n", desc_src->name, desc_dst->name); res = -1; goto end; -- 2.17.1 _______________________________________________ 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".