Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Anton Khirnov <anton@khirnov.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH v2 03/33] avcodec: Make avcodec_decode_subtitle2 accept a const AVPacket*
Date: Sat,  4 Feb 2023 11:41:34 +0100
Message-ID: <20230204104204.20721-4-anton@khirnov.net> (raw)
In-Reply-To: <20230204104204.20721-1-anton@khirnov.net>

From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
---
 doc/APIchanges            | 3 +++
 fftools/ffmpeg.c          | 4 ++--
 fftools/ffprobe.c         | 2 +-
 libavcodec/avcodec.h      | 3 +--
 libavcodec/decode.c       | 9 ++++-----
 tools/target_dec_fuzzer.c | 4 ++--
 6 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index bc52a079644..b1181ec60a3 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -14,6 +14,9 @@ libavutil:     2021-04-27
 
 API changes, most recent first:
 
+2023-02-xx - xxxxxxxxxx - lavc 60.0.100 - avcodec.h
+  avcodec_decode_subtitle2() now accepts const AVPacket*.
+
 2023-01-29 - xxxxxxxxxx - lavc 59.59.100 - avcodec.h
   Add AV_CODEC_FLAG_COPY_OPAQUE and AV_CODEC_FLAG_FRAME_DURATION.
 
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 92fd61f3158..257f319550c 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2296,8 +2296,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 dfa7ff1b241..5beaece094f 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2733,7 +2733,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 90b437ccbe2..b9bd69a2ec7 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2601,8 +2601,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 0abc88737b2..45c1f085792 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -780,8 +780,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;
@@ -861,8 +861,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;
 
@@ -882,7 +881,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/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index a20345db5c6..8e89b613c07 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);
-- 
2.35.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".

  parent reply	other threads:[~2023-02-04 10:46 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-04 10:41 [FFmpeg-devel] [PATCH v2] Major library version bump Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 01/33] avformat/avformat: Remove AVOutputFormat.data_codec Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 02/33] avformat/avformat: Move codecpar up in AVStream Anton Khirnov
2023-02-04 10:41 ` Anton Khirnov [this message]
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 04/33] avformat/demux: Avoid stack packet when decoding frame Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 05/33] avformat/avformat: Move AVOutputFormat internals out of public header Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 06/33] avcodec/avcodec: Remove AV_CODEC_FLAG2_DROP_FRAME_TIMECODE Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 07/33] avcodec: remove FF_API_OPENH264_SLICE_MODE Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 08/33] avcodec: remove FF_API_OPENH264_CABAC Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 09/33] avcodec: remove FF_API_UNUSED_CODEC_CAPS Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 10/33] avcodec: remove FF_API_THREAD_SAFE_CALLBACKS Anton Khirnov
2023-02-05 21:04   ` Michael Niedermayer
2023-02-07  7:58     ` [FFmpeg-devel] [PATCH v2.5 " Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 11/33] avcodec: remove FF_API_DEBUG_MV Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 12/33] avcodec: remove FF_API_GET_FRAME_CLASS Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 13/33] avcodec: remove FF_API_AUTO_THREADS Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 14/33] avcodec: remove FF_API_AVCTX_TIMEBASE Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 15/33] avcodec: remove FF_API_FLAG_TRUNCATED Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 16/33] avcodec: remove FF_API_SUB_TEXT_FORMAT Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 17/33] avformat: remove FF_API_LAVF_PRIV_OPT Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 18/33] avformat: remove FF_API_AVIOCONTEXT_WRITTEN Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 19/33] avformat: remove FF_HLS_TS_OPTIONS Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 20/33] avformat: remove FF_API_AVSTREAM_CLASS Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 21/33] avfilter: remove FF_API_SWS_PARAM_OPTION Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 22/33] avfilter: remove FF_API_BUFFERSINK_ALLOC Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 23/33] avfilter: remove FF_API_PAD_COUNT Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 24/33] avdevice: remove FF_API_DEVICE_CAPABILITIES Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 25/33] avutil: remove FF_API_D2STR Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 26/33] avutil: remove FF_API_DECLARE_ALIGNED Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 27/33] avutil: remove FF_API_COLORSPACE_NAME Anton Khirnov
2023-02-04 10:41 ` [FFmpeg-devel] [PATCH v2 28/33] avutil: remove FF_API_AV_MALLOCZ_ARRAY Anton Khirnov
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 29/33] avutil/{color_utils, csp}: merge color_utils into csp and expose API Anton Khirnov
2023-02-04 16:27   ` Ronald S. Bultje
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 30/33] avutil/version: postpone the remaining API deprecations Anton Khirnov
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 31/33] avcodec/version: " Anton Khirnov
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 32/33] avformat/version: " Anton Khirnov
2023-02-04 10:42 ` [FFmpeg-devel] [PATCH v2 33/33] Bump major versions of all libraries Anton Khirnov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230204104204.20721-4-anton@khirnov.net \
    --to=anton@khirnov.net \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git