From fd131ce99ecaaf3881d11ce7478b5be66cb059d5 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Mon, 5 May 2025 20:14:29 +0200 Subject: [PATCH 08/11] Revert "avcodec/cbs: add an AVBufferRef input argument to ff_cbs_read()" This reverts commit 4bfe9c56632a3ccdcd5c1d0c415cda0111639bf1. It is no longer necessary, as the only user (the APV parser) no longer makes use of this facility. Signed-off-by: Andreas Rheinhardt --- libavcodec/apv_parser.c | 2 +- libavcodec/av1_parser.c | 2 +- libavcodec/cbs.c | 5 ++--- libavcodec/cbs.h | 1 - libavcodec/vulkan_encode_h264.c | 2 +- libavcodec/vulkan_encode_h265.c | 2 +- libavcodec/vvc_parser.c | 2 +- 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/libavcodec/apv_parser.c b/libavcodec/apv_parser.c index f3cc9dd669..c940ebe9c1 100644 --- a/libavcodec/apv_parser.c +++ b/libavcodec/apv_parser.c @@ -48,7 +48,7 @@ static int parse(AVCodecParserContext *s, p->cbc->log_ctx = avctx; - ret = ff_cbs_read(p->cbc, au, NULL, buf, buf_size); + ret = ff_cbs_read(p->cbc, au, buf, buf_size); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Failed to parse access unit.\n"); goto end; diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c index 1792e813f4..2b79493bf8 100644 --- a/libavcodec/av1_parser.c +++ b/libavcodec/av1_parser.c @@ -82,7 +82,7 @@ static int av1_parser_parse(AVCodecParserContext *ctx, ff_cbs_fragment_reset(td); } - ret = ff_cbs_read(s->cbc, td, NULL, data, size); + ret = ff_cbs_read(s->cbc, td, data, size); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Failed to parse temporal unit.\n"); goto end; diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c index b9c9284f3d..a43d938a54 100644 --- a/libavcodec/cbs.c +++ b/libavcodec/cbs.c @@ -262,7 +262,7 @@ static int cbs_fill_fragment_data(CodedBitstreamFragment *frag, static int cbs_read_data(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, - const AVBufferRef *buf, + AVBufferRef *buf, const uint8_t *data, size_t size, int header) { @@ -333,10 +333,9 @@ int CBS_FUNC(read_packet_side_data)(CodedBitstreamContext *ctx, int CBS_FUNC(read)(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, - const AVBufferRef *buf, const uint8_t *data, size_t size) { - return cbs_read_data(ctx, frag, buf, + return cbs_read_data(ctx, frag, NULL, data, size, 0); } #endif diff --git a/libavcodec/cbs.h b/libavcodec/cbs.h index 40159d3c6d..a2651cb43a 100644 --- a/libavcodec/cbs.h +++ b/libavcodec/cbs.h @@ -395,7 +395,6 @@ int CBS_FUNC(read_packet)(CodedBitstreamContext *ctx, */ int CBS_FUNC(read)(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, - const AVBufferRef *buf, const uint8_t *data, size_t size); diff --git a/libavcodec/vulkan_encode_h264.c b/libavcodec/vulkan_encode_h264.c index f31b6d4069..0f2b23a908 100644 --- a/libavcodec/vulkan_encode_h264.c +++ b/libavcodec/vulkan_encode_h264.c @@ -1061,7 +1061,7 @@ static int parse_feedback_units(AVCodecContext *avctx, if (err < 0) return err; - err = ff_cbs_read(cbs, &au, NULL, data, size); + err = ff_cbs_read(cbs, &au, data, size); if (err < 0) { av_log(avctx, AV_LOG_ERROR, "Unable to parse feedback units, bad drivers: %s\n", av_err2str(err)); diff --git a/libavcodec/vulkan_encode_h265.c b/libavcodec/vulkan_encode_h265.c index d81d2de95a..77d4f7101d 100644 --- a/libavcodec/vulkan_encode_h265.c +++ b/libavcodec/vulkan_encode_h265.c @@ -1214,7 +1214,7 @@ static int parse_feedback_units(AVCodecContext *avctx, if (err < 0) return err; - err = ff_cbs_read(cbs, &au, NULL, data, size); + err = ff_cbs_read(cbs, &au, data, size); if (err < 0) { av_log(avctx, AV_LOG_ERROR, "Unable to parse feedback units, bad drivers: %s\n", av_err2str(err)); diff --git a/libavcodec/vvc_parser.c b/libavcodec/vvc_parser.c index c9c3a3949f..8d32d66573 100644 --- a/libavcodec/vvc_parser.c +++ b/libavcodec/vvc_parser.c @@ -357,7 +357,7 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf, return 1; } - if ((ret = ff_cbs_read(ctx->cbc, pu, NULL, buf, buf_size)) < 0) { + if ((ret = ff_cbs_read(ctx->cbc, pu, buf, buf_size)) < 0) { av_log(avctx, AV_LOG_ERROR, "Failed to parse picture unit.\n"); goto end; } -- 2.45.2