From patchwork Wed Mar 30 22:49:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 35099 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp1066652pzb; Wed, 30 Mar 2022 15:50:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtqIlcGVeSbEnROWcSrsWDyyIOLq86YRl/ukbRdtkxmX4rEXR3RbAEgJhJaPlfTnhsDS46 X-Received: by 2002:a17:906:4443:b0:6cf:6a7d:5f9b with SMTP id i3-20020a170906444300b006cf6a7d5f9bmr2104559ejp.12.1648680655637; Wed, 30 Mar 2022 15:50:55 -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 l2-20020a1709061c4200b006e11da49d4fsi10054208ejg.189.2022.03.30.15.50.55; Wed, 30 Mar 2022 15:50:55 -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=oOhBm49z; 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 61DF168B27E; Thu, 31 Mar 2022 01:50:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2075.outbound.protection.outlook.com [40.92.89.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CB26B6801DD for ; Thu, 31 Mar 2022 01:50:29 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fGG/6MJ9cIUqJkSj7Ff15+rVUjvT4fyUhzq1wGM8rh/FpUnI5R8isyYZKyUWr05bx7O2veHXuDFxSmOl/WXhRz1urVjcDBi6mRUlQ7q+oCH6oe2BwAH4ASnr/N/obwnBEkYsRZ7zUWmmnkFfGQj2kYxZ/SDY8owkPpIlIWl4eQnFxsCKJRYpgjicHrDkN1D3DJYvQJQ5tl5ZAY7RN8G/d+Pmda5B4havTDaWWQ3wBun6kJKD3IWalaLISUgNehsVS4zBm6Ve/LM1tOl085dDI0UEBv4ytqG68absWSGzp/+DZk+M9v5X3hCApJFGV4Rn0cn0c2E1R0l7hpgopNQzkw== 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=br7imklcuuIz4mKaaTOMFPUQ7YOYAfuIJxT5Ed3M79E=; b=EDL/Z2BL5exJ0qBiGnDl65OpMp/wplT8B4mn0pSSRLrw86JclkR4b/zBvALFmhMfP/jFoICdOXcdGeuV7ebvQ/XVMnAGCJW9nwSC/9El0N3tABYqG0R5JTgX3j38gNfVCcioWhGXr6v72NJsQA9t4YXXsfcJoPsD8vuDDL9cODn4Y9/2AJcaywDX5zl9HBMLAhDW+FKopNwgn72wWjz72eqk2WcljYu8mb1QGVQkQ783zWxF/0hwQ3EMniOP+QjnjwkdsV7l6285oPgfJU5f0dIRYdw41Ptw6UBkPFLVTAZJ1x9beJUNrB/Vgu/58HzLJpYbnrdj/GvGJAxI7hqf1g== 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=br7imklcuuIz4mKaaTOMFPUQ7YOYAfuIJxT5Ed3M79E=; b=oOhBm49zj5F2mMO4QgKtq+Dqi9jBkPDFC+VaiI03IA8RmfCuuHl+s0hgUaPtUlBLCg3WAkGrDd87jqGk1uN8NLN45zc3wP9ewwS4+SfJy5qWWtx75ccWSHOAu8sD3BBRUT+wj9nemfnFlg6UkQDaZEw6IRDlqhcBJo0jsmxYuhu+OzAL3PCqFEFfkBuk3BYAwE3x8uFdizq0OGSixvv7uaCSw6OwbegyjM18kSo6n9VfE6jRhGRZa28RoUpBNU5jQ6oD8f9aL+UubscPdNJ/Mfp//XVelfHfHpRk8pqP+TlSEUeZ3dYTD8CaCz7MbH1e1sVejkps/e0kAPXZr/OlVA== Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) by AM5PR0102MB2579.eurprd01.prod.exchangelabs.com (2603:10a6:206:d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17; Wed, 30 Mar 2022 22:50:28 +0000 Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8]) by AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8%3]) with mapi id 15.20.5102.022; Wed, 30 Mar 2022 22:50:28 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 31 Mar 2022 00:49:57 +0200 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [51uzQ2VJ6Y3a8Ow33EIYx1zx2CgvTr82] X-ClientProxiedBy: ZRAP278CA0002.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::12) To AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) X-Microsoft-Original-Message-ID: <20220330224958.538843-5-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4a497a13-f514-4852-c613-08da129faf5f X-MS-TrafficTypeDiagnostic: AM5PR0102MB2579:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Cj6IbLPTSFxIOzyPmKJoxfJ3vhhR7LzlAvoh7UfCtdMXmc6sNIQhdY9E7wDPwgy7SZGXR/m0HNfBIbiN9ImnQKB3l9blDO3L09yT8rM+TkO03Fj8+qTon71Bm4hbt7ozR74sEo6K6g5/oB4y/oBLPuNgbpYCoLwGacKEGrBbRGytRfUXRp9N8jY2S9qitFjgz/4px1g7FU7cG5QwD/PczI835UMmPO4LDg794/6ucxqPgMQiJIWJ/mypsE3mVcOHJDKmUEx0zdWMgwE+GE0mOg4OFDDkVTPm1wo+eQjQFuBh2hjlA1YU7VEtyNne9oNroMjzbuScc96LwW/4pFoXssiaZXzp1TZSCq8rWUERWRNonsGj7i7cReyOY2KmOLLm8pHcA25tbh2GJQ/1oDLOEfhVcp5G8frRvzwWWTeayhsOuEUaLGX8y8SADwRKR2JED9/XRbeTDQ5kRzKX0PF7+bdWWY8mWndzkHVhvoEqDD5pYDElvVkfHQLJhTEZzHa3WCmYRCZohC1Sv0ih5w0gwpq4z4Ib7H41ZpsOTpS3lhIWHemA/sxtp9gxDlwSkCfMnPZikWE6r/nzkwfwqDbYUg== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xUBJ/yUGcicmGqjXidrWb+wNM5fnAuUxxLXYM/e3F/hHAvxzc5oodKsLnDn8QYz+Y/CfE8D7Ln5mBgq1mmEEMbk8fB+WNh4TwrIsIToR4FhbTGLCdMCW15n64VQMuo8sI+4a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ypPYwLLqCRzS+RVULcA+p9CjhkvUDVFsBj7lgcjwzNqPxd+1qImPnxBeH/at9Ifd9ywyTheQ+ururZDFpsPRFJNqhj/tj3ZoPErAIQ8DwF2EqSLkP3sbo1AxWJq99XqSxGskm1e7NEuiqJQPNjZrcdulK1bVJWnje2zPA1jQzqJmKBssdd3miA8zcpJBIiA0GY74rfeAXZ19z7omBejQomYMcZEmuLdsHPDmLpZNRBp3AtjmicYndi+dIE10 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a497a13-f514-4852-c613-08da129faf5f X-MS-Exchange-CrossTenant-AuthSource: AS1PR01MB9564.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2022 22:50:27.9766 (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: AM5PR0102MB2579 Subject: [FFmpeg-devel] [PATCH 6/7] avcodec: Make avcodec_decoder_subtitles2 accept a const AVPacket* 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: pIUl6dvPruql From: Andreas Rheinhardt Signed-off-by: Andreas Rheinhardt --- doc/APIchanges | 3 +++ fftools/ffmpeg.c | 4 ++-- fftools/ffprobe.c | 2 +- libavcodec/avcodec.h | 3 +-- libavcodec/decode.c | 9 ++++----- libavcodec/version.h | 2 +- tools/target_dec_fuzzer.c | 4 ++-- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 1a9f0a303e..326a3c721c 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -14,6 +14,9 @@ libavutil: 2021-04-27 API changes, most recent first: +2022-03-30 - xxxxxxxxxx - lavc 59.26.100 - avcodec.h + avcodec_decode_subtitle2() now accepts const AVPacket*. + 2022-03-16 - xxxxxxxxxx - all libraries - version_major.h Add lib/version_major.h as new installed headers, which only contain the major version number (and corresponding API deprecation diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 6d62bdc7b0..979e33c9ab 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -2491,8 +2491,8 @@ fail: return err < 0 ? err : ret; } -static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output, - int *decode_failed) +static int transcode_subtitles(InputStream *ist, const AVPacket *pkt, + int *got_output, int *decode_failed) { AVSubtitle subtitle; int free_sub = 1; diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 05c167eeb5..d2aacb6a0d 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2629,7 +2629,7 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream, static av_always_inline int process_frame(WriterContext *w, InputFile *ifile, - AVFrame *frame, AVPacket *pkt, + AVFrame *frame, const AVPacket *pkt, int *packet_new) { AVFormatContext *fmt_ctx = ifile->fmt_ctx; diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 4dae23d06e..64804c2a50 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2544,8 +2544,7 @@ enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos); * @param[in] avpkt The input AVPacket containing the input buffer. */ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, - AVPacket *avpkt); + int *got_sub_ptr, const AVPacket *avpkt); /** * Supply raw packet data as input to a decoder. diff --git a/libavcodec/decode.c b/libavcodec/decode.c index e51a39e70a..8bb6e8c265 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -751,8 +751,8 @@ static void get_subtitle_defaults(AVSubtitle *sub) } #define UTF8_MAX_BYTES 4 /* 5 and 6 bytes sequences should not be used */ -static int recode_subtitle(AVCodecContext *avctx, AVPacket **outpkt, - AVPacket *inpkt, AVPacket *buf_pkt) +static int recode_subtitle(AVCodecContext *avctx, const AVPacket **outpkt, + const AVPacket *inpkt, AVPacket *buf_pkt) { #if CONFIG_ICONV iconv_t cd = (iconv_t)-1; @@ -832,8 +832,7 @@ static int utf8_check(const uint8_t *str) } int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, - AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { int ret = 0; @@ -853,7 +852,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, if ((avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || avpkt->size) { AVCodecInternal *avci = avctx->internal; - AVPacket *pkt; + const AVPacket *pkt; ret = recode_subtitle(avctx, &pkt, avpkt, avci->buffer_pkt); if (ret < 0) diff --git a/libavcodec/version.h b/libavcodec/version.h index a744e7469f..26ee41eb1f 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 25 +#define LIBAVCODEC_VERSION_MINOR 26 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c index 288aa63313..bb9fad613d 100644 --- a/tools/target_dec_fuzzer.c +++ b/tools/target_dec_fuzzer.c @@ -81,8 +81,8 @@ static const FFCodec *AVCodecInitialize(enum AVCodecID codec_id) return ffcodec(res); } -static int subtitle_handler(AVCodecContext *avctx, void *frame, - int *got_sub_ptr, AVPacket *avpkt) +static int subtitle_handler(AVCodecContext *avctx, AVFrame *unused, + int *got_sub_ptr, const AVPacket *avpkt) { AVSubtitle sub; int ret = avcodec_decode_subtitle2(avctx, &sub, got_sub_ptr, avpkt);