From patchwork Thu Aug 25 02:07:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37465 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp60312pzh; Wed, 24 Aug 2022 19:08:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR76iPeP6ccJsbAaf6TyCg4yTAgkcEhiuecdJSxw9nu7/tcpb2KKgJ3l9qLsoq4AIeg5p+hL X-Received: by 2002:a17:906:8a52:b0:73d:8146:9a89 with SMTP id gx18-20020a1709068a5200b0073d81469a89mr1012933ejc.335.1661393289435; Wed, 24 Aug 2022 19:08:09 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id z22-20020a50cd16000000b00445e1596c93si5261365edi.611.2022.08.24.19.07.55; Wed, 24 Aug 2022 19:08:09 -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=@outlook.com header.s=selector1 header.b=EmKjwxRB; arc=fail (body hash mismatch); 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 86A1E68B985; Thu, 25 Aug 2022 05:07:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-oln040092072077.outbound.protection.outlook.com [40.92.72.77]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 459BE68B937 for ; Thu, 25 Aug 2022 05:07:46 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F5Y8Hv6wNx27AxL1mD46q6wyE9wikPYWpkAbnQDsvkw08whbtfLYMj9+OxV19Pr0LorNbvT4OINouaASAAWwtksdb9byRmu8BfHj6us0SZcyrhLEm9QVa4dovUIAddQAdqSU+f4JW8+Eyz/vKdir19FT5stBGACRr06KrIYGvl0F5P1YIIKzemqyeLF+yfkFDsB0jois4rRsNe5K4ZO9KBmtZDT+VQyzz2sUipwTgT+9dWx9c3xR+Hqn9aksSMImna+8QVztprIkkXHu8toJIcHc+/xLshVpd7lsyGD+8BNzAhcEn9wk697u1RRDUlp8QdBI+kRQbe71xrjEb1rvMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bgnqEmOjnKXFsnj2MGfjBISj92UjI4j+5d+aL7qGS6Q=; b=DTDf+YIXkYzFs6UA5+YFrclxD9jG0GvPcVFtgakNLf/653GHZWTD2bOEw5ylMS0NXGbEkc6vXCN4ta6tdJDo68IMSPLE7tO8Dj3y0JSh8BLeXbGMmSufgDXpjZ+gwmfnRxoWe7HUKlD/wKNGxUG1gD/yMSKzs4K8vDKoivVXUx2N4WPjwtbslB0rLvpTg4kVkxNIHqBufiHZ3ejzESb6S8yWhROZK8l9Y8vrSMwxVROalSdiciH5yKTffmDu/kIVe4KetW/x9TwtFU0UR5DJrH/DV9sehaI8Ap9BAF4yCABG0tNKFV7TsoDQ/4l2v4MTk2LWj+vfR/JQ5vlHg2g2iw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bgnqEmOjnKXFsnj2MGfjBISj92UjI4j+5d+aL7qGS6Q=; b=EmKjwxRBYmwuOAYtOCvaXIgBzeYbtXx6Jjtkqn67AG3ANT9A6tG+nGH5v+hBFGJS2oeFm0q50+yYwL0NukwLYR+4M9eF5PTxKAwbHAXHi5LmvViSMcA82mj7BJbxGm4MUCMMBeavV6fwJeGCJ0wVNm6k+tHLarNB5J9d+PLB3mFFEXBOS9krvyEHMb5u6VxRM/HfynHPK5Ok/naC6abr7O0S/ANU/eWEjCNxTob9+YrwCqN3wTr8Wt50fEX8tyUNXoz9WmRGcO9cFsDyqvfeo9dTPo3Au/qgQCRHw87LCort6E3ImHncvLDMd8VkEJ5Ki/yB3bhZ9bH0QNnWAxOoRA== Received: from DB6PR0101MB2214.eurprd01.prod.exchangelabs.com (2603:10a6:4:42::27) by VE1PR01MB5726.eurprd01.prod.exchangelabs.com (2603:10a6:803:124::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Thu, 25 Aug 2022 02:07:44 +0000 Received: from DB6PR0101MB2214.eurprd01.prod.exchangelabs.com ([fe80::210e:b627:bcc9:8c46]) by DB6PR0101MB2214.eurprd01.prod.exchangelabs.com ([fe80::210e:b627:bcc9:8c46%11]) with mapi id 15.20.5546.022; Thu, 25 Aug 2022 02:07:44 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Aug 2022 04:07:13 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [S9QZ381kEAmpoNB0LB7SexNzVMrBCPtA] X-ClientProxiedBy: FR0P281CA0095.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a9::12) To DB6PR0101MB2214.eurprd01.prod.exchangelabs.com (2603:10a6:4:42::27) X-Microsoft-Original-Message-ID: <20220825020721.405811-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b1631163-f7b8-4ca8-1ddb-08da863e98ea X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpE5Ud63VVPnzi67JlvJlcMlZ9zCVnl3uomhPMwe45bddH6pAf5LR+f3xeC7apr4/jL+muMYTGS/ZsCeD1mGw6AjDNzSnBemOESOcQifDlchYKAVdhRS2/icIc43ITqNSInw3aZuev68Dj1q8P3922krkXIWcJo8Zi06Hk3pnBr1xLMhAJoBnWaTrTRhT3Qn6k9V+C8QPaHhHUtT7cSqmi9accTmrUQ7D9u1LFpqxePjXiBguAafveHDy7WBeMBMzFlPSsTUR3IeVYF0bGQtaDfC22uf2xtWuQU16SBSJJAl4Jhrkxhpgg7yewr606RomJdyTmA+c3X9ZTM3bcDJEPKOo8NZFD2snDFrUzxPJbT3hySvbmcANO5eudxfAYux8yyMUIxXx7bWJjZWcNA3VHGpGOpdrYGIRVHjcoTPhqQezfPi4yJVCXY3u+ITxu4krSIbTF8y0As1y9/QkSEor70/4AaE+tOWD1y2eS5W+2X7LE4uVTdMAriBRMGXHUuoj9nfKxUaZWdZHUwcnE3OHEDhTgQ9/cV0MqG2S+CVPFcPOu/4HXTOGwsoV6BO1sCMHfXqlRgh18IKz/hRvGl3YIzWsWGwnBDHDz7sxjBR9o7fXycyIytFXX4kSpStXcnQM2hTBuY0jOhtT7SCVvb93i+UppKjsayeBpH7RzVwn9znLaUokmVKq2Sppvkj6l4eCMwIu9MRzblB/WX8FvtW74tH1DKQZvQnjAR3RIcrh0/2z5fX5nc0mLXFnJtD0JSdFo= X-MS-TrafficTypeDiagnostic: VE1PR01MB5726:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4P4+SNqi1AW7IkpIWoo1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SfG/pqLx5A5cWWzO6mass321g8Nhhgx9PdUZCpotXTg4LaIxKTqe/Xo2Gw72pL6qZfF0/xmky+PUQgRjY808ECzsafjtxHvJXunLZZO4nRbXqChEyjGoWdED+NpIDDGw1i948SnbXNc07wR6gyhfqD7JjjslKEwIvDvyQz52fwjtG0cT/MC5QN4/yL9n7pMcYQuxffXDPvExyIZsO0fCPWBlC2lHjO3mVvf3ArjhldaC/b6F74KvwY8V4QOY9aGWwoaGcIH56VPEnAWinIGuIN1Mi3z7CUrPhFcAnl6Rri3NKHXzwknoszAo72dYj5S2WZWzwSwRjvxM+H3kAkbaUVdme6APt/jSQNaJHMhV4AzlyT18rLyqiKaaZXyU0r2spSSo0Z0K2Xj6K6deIxnLUHOacYgGBnTabvfRmWPJcqYev32dVixfAVGinBb2uqi5pqV9W+uMLa/bp7xRVYaFEI9JC9LL3B969bDlGL6AVcpNfih2O8r5+TnoAbqw7+DsacyM30DsTl82o8na9LoEKoKe8l6Fd77FpIZHMzzb35VhsdU5SZCbpkCSC3aKAr7wchtIn3Bx9eOQ9FGbgjq7YJUHT1rTyUezF/9IS5syNz574cGAIalai0YrsF3JFwlhnFehl9K6RIhaLOEMHEhbnZWFhRpPOcIPy/Tjcyrl+ZyARfYHUPtzfWS745geOD8BlVfgfWjpcvY86p4pRDG8fokAzCZWLN9fRI4sArFjJAHtwiRqNcn6llxd/MZnKTgVqN00mF7p8BIras5ks+KRUy2XaPItUPNcfi+C8A5lTqqPKruH6uWXziLD99AN/dcKtB4gFIddTR2f8QYo3G4ixySDejfw9EAUgOBI91Vd/CIXJFw4TqIdAHixdEjMBMGDPaYlyAgpVXJwL5pkegRxCWy7qF27n4tzwbcrPrRu905DPH5GEFOkFz0= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b1631163-f7b8-4ca8-1ddb-08da863e98ea X-MS-Exchange-CrossTenant-AuthSource: DB6PR0101MB2214.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2022 02:07:44.1982 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR01MB5726 Subject: [FFmpeg-devel] [PATCH 13/21] avcodec/internal: Move ff_get_format() to decode.h 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: H707rt35J+GF Signed-off-by: Andreas Rheinhardt --- libavcodec/decode.h | 13 +++++++++++++ libavcodec/h263dec.c | 1 + libavcodec/internal.h | 13 ------------- libavcodec/mediacodecdec_common.c | 1 + libavcodec/pthread_frame.c | 1 + libavcodec/utils.c | 1 + libavcodec/vc1dec.c | 1 + libavcodec/vp8.c | 1 + 8 files changed, 19 insertions(+), 13 deletions(-) diff --git a/libavcodec/decode.h b/libavcodec/decode.h index f7828fbff4..81767f73fd 100644 --- a/libavcodec/decode.h +++ b/libavcodec/decode.h @@ -99,4 +99,17 @@ int ff_copy_palette(void *dst, const AVPacket *src, void *logctx); */ int ff_decode_preinit(AVCodecContext *avctx); +/** + * Select the (possibly hardware accelerated) pixel format. + * This is a wrapper around AVCodecContext.get_format() and should be used + * instead of calling get_format() directly. + * + * The list of pixel formats must contain at least one valid entry, and is + * terminated with AV_PIX_FMT_NONE. If it is possible to decode to software, + * the last entry in the list must be the most accurate software format. + * If it is not possible to decode to software, AVCodecContext.sw_pix_fmt + * must be set before calling this function. + */ +int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt); + #endif /* AVCODEC_DECODE_H */ diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 8728cfa6e9..87fbf87c8a 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -31,6 +31,7 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "error_resilience.h" #include "flvdec.h" #include "h263.h" diff --git a/libavcodec/internal.h b/libavcodec/internal.h index 61d395e8c9..03b200c444 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -249,19 +249,6 @@ int ff_set_sar(AVCodecContext *avctx, AVRational sar); int ff_side_data_update_matrix_encoding(AVFrame *frame, enum AVMatrixEncoding matrix_encoding); -/** - * Select the (possibly hardware accelerated) pixel format. - * This is a wrapper around AVCodecContext.get_format() and should be used - * instead of calling get_format() directly. - * - * The list of pixel formats must contain at least one valid entry, and is - * terminated with AV_PIX_FMT_NONE. If it is possible to decode to software, - * the last entry in the list must be the most accurate software format. - * If it is not possible to decode to software, AVCodecContext.sw_pix_fmt - * must be set before calling this function. - */ -int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt); - /** * Add a CPB properties side data to an encoding context. */ diff --git a/libavcodec/mediacodecdec_common.c b/libavcodec/mediacodecdec_common.c index cb18aed401..7952c3c34c 100644 --- a/libavcodec/mediacodecdec_common.c +++ b/libavcodec/mediacodecdec_common.c @@ -32,6 +32,7 @@ #include "libavutil/timestamp.h" #include "avcodec.h" +#include "decode.h" #include "internal.h" #include "mediacodec.h" diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index 726bd1bcc7..08a6f98898 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -29,6 +29,7 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "hwconfig.h" #include "internal.h" #include "pthread_internal.h" diff --git a/libavcodec/utils.c b/libavcodec/utils.c index e73e3a7d08..2f57418ff7 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -36,6 +36,7 @@ #include "avcodec.h" #include "codec.h" #include "codec_internal.h" +#include "decode.h" #include "hwconfig.h" #include "thread.h" #include "threadframe.h" diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index b53490b3ab..065b43cb11 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -31,6 +31,7 @@ #include "avcodec.h" #include "blockdsp.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "hwconfig.h" #include "internal.h" diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 7a151feb79..6bf846dbfe 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -31,6 +31,7 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "hwconfig.h" #include "internal.h" #include "mathops.h"