From: Anton Khirnov <anton@khirnov.net> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH v2 15/33] avcodec: remove FF_API_FLAG_TRUNCATED Date: Sat, 4 Feb 2023 11:41:46 +0100 Message-ID: <20230204104204.20721-16-anton@khirnov.net> (raw) In-Reply-To: <20230204104204.20721-1-anton@khirnov.net> From: James Almer <jamrial@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com> --- libavcodec/avcodec.h | 9 ----- libavcodec/codec.h | 6 ---- libavcodec/decode.c | 4 --- libavcodec/h263_parser.c | 11 ------ libavcodec/h263_parser.h | 29 --------------- libavcodec/h263dec.c | 42 ---------------------- libavcodec/mpeg12.c | 66 ---------------------------------- libavcodec/mpeg12.h | 9 ----- libavcodec/mpeg12dec.c | 31 ---------------- libavcodec/mpeg4video_parser.c | 12 ------- libavcodec/mpeg4video_parser.h | 34 ------------------ libavcodec/mpeg4videodec.c | 3 -- libavcodec/mpegvideo.c | 9 ----- libavcodec/mpegvideo.h | 7 ---- libavcodec/mpegvideo_dec.c | 8 ----- libavcodec/mpegvideo_parser.c | 7 +--- libavcodec/options_table.h | 3 -- libavcodec/pthread.c | 3 -- libavcodec/version_major.h | 1 - 19 files changed, 1 insertion(+), 293 deletions(-) delete mode 100644 libavcodec/h263_parser.h delete mode 100644 libavcodec/mpeg4video_parser.h diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index f82608561ac..9066f6c5297 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -294,15 +294,6 @@ typedef struct RcOverride{ * error[?] variables will be set during encoding. */ #define AV_CODEC_FLAG_PSNR (1 << 15) -#if FF_API_FLAG_TRUNCATED -/** - * Input bitstream might be truncated at a random location - * instead of only at frame boundaries. - * - * @deprecated use codec parsers for packetizing input - */ -#define AV_CODEC_FLAG_TRUNCATED (1 << 16) -#endif /** * Use interlaced DCT. */ diff --git a/libavcodec/codec.h b/libavcodec/codec.h index 8bf85b2f9c8..035bcd080b5 100644 --- a/libavcodec/codec.h +++ b/libavcodec/codec.h @@ -50,12 +50,6 @@ * avcodec_default_get_buffer2 or avcodec_default_get_encode_buffer. */ #define AV_CODEC_CAP_DR1 (1 << 1) -#if FF_API_FLAG_TRUNCATED -/** - * @deprecated Use parsers to always send proper frames. - */ -#define AV_CODEC_CAP_TRUNCATED (1 << 3) -#endif /** * Encoder or decoder requires flushing with NULL input at the end in order to * give the complete and correct output. diff --git a/libavcodec/decode.c b/libavcodec/decode.c index bc6966d454a..c37d607e27f 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -427,11 +427,7 @@ FF_ENABLE_DEPRECATION_WARNINGS if (!got_frame) av_frame_unref(frame); -#if FF_API_FLAG_TRUNCATED - if (ret >= 0 && avctx->codec->type == AVMEDIA_TYPE_VIDEO && !(avctx->flags & AV_CODEC_FLAG_TRUNCATED)) -#else if (ret >= 0 && avctx->codec->type == AVMEDIA_TYPE_VIDEO) -#endif ret = pkt->size; /* do not stop draining when actual_got_frame != 0 or ret < 0 */ diff --git a/libavcodec/h263_parser.c b/libavcodec/h263_parser.c index 7a742caa80b..f70a7911777 100644 --- a/libavcodec/h263_parser.c +++ b/libavcodec/h263_parser.c @@ -25,16 +25,9 @@ */ #include "parser.h" -#if FF_API_FLAG_TRUNCATED -/* Nuke this header when removing FF_API_FLAG_TRUNCATED */ -#include "h263_parser.h" - -int ff_h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){ -#else static int h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size) { -#endif int vop_found, i; uint32_t state; @@ -80,11 +73,7 @@ static int h263_parse(AVCodecParserContext *s, if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) { next = buf_size; } else { -#if FF_API_FLAG_TRUNCATED - next= ff_h263_find_frame_end(pc, buf, buf_size); -#else next = h263_find_frame_end(pc, buf, buf_size); -#endif if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { *poutbuf = NULL; diff --git a/libavcodec/h263_parser.h b/libavcodec/h263_parser.h deleted file mode 100644 index 565a222bc1e..00000000000 --- a/libavcodec/h263_parser.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * H.263 parser - * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_H263_PARSER_H -#define AVCODEC_H263_PARSER_H - -#include "parser.h" - -int ff_h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size); - -#endif /* AVCODEC_H263_PARSER_H */ diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 0a2d7487a83..f4e7048a5f2 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -36,17 +36,11 @@ #include "flvdec.h" #include "h263.h" #include "h263dec.h" -#if FF_API_FLAG_TRUNCATED -#include "h263_parser.h" -#endif #include "hwconfig.h" #include "mpeg_er.h" #include "mpeg4video.h" #include "mpeg4videodec.h" #include "mpeg4videodefs.h" -#if FF_API_FLAG_TRUNCATED -#include "mpeg4video_parser.h" -#endif #include "mpegutils.h" #include "mpegvideo.h" #include "mpegvideodec.h" @@ -163,14 +157,6 @@ static int get_consumed_bytes(MpegEncContext *s, int buf_size) /* We would have to scan through the whole buf to handle the weird * reordering ... */ return buf_size; -#if FF_API_FLAG_TRUNCATED - } else if (s->avctx->flags & AV_CODEC_FLAG_TRUNCATED) { - pos -= s->parse_context.last_index; - // padding is not really read so this might be -1 - if (pos < 0) - pos = 0; - return pos; -#endif } else { // avoid infinite loops (maybe not needed...) if (pos == 0) @@ -448,28 +434,6 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict, return 0; } -#if FF_API_FLAG_TRUNCATED - if (s->avctx->flags & AV_CODEC_FLAG_TRUNCATED) { - int next; - - if (CONFIG_MPEG4_DECODER && s->codec_id == AV_CODEC_ID_MPEG4) { - next = ff_mpeg4_find_frame_end(&s->parse_context, buf, buf_size); - } else if (CONFIG_H263_DECODER && s->codec_id == AV_CODEC_ID_H263) { - next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size); - } else if (CONFIG_H263P_DECODER && s->codec_id == AV_CODEC_ID_H263P) { - next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size); - } else { - av_log(s->avctx, AV_LOG_ERROR, - "this codec does not support truncated bitstreams\n"); - return AVERROR(ENOSYS); - } - - if (ff_combine_frame(&s->parse_context, next, (const uint8_t **)&buf, - &buf_size) < 0) - return buf_size; - } -#endif - retry: if (s->divx_packed && s->bitstream_buffer_size) { int i; @@ -749,9 +713,6 @@ const FFCodec ff_h263_decoder = { .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | -#if FF_API_FLAG_TRUNCATED - AV_CODEC_CAP_TRUNCATED | -#endif AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = ff_mpeg_flush, @@ -770,9 +731,6 @@ const FFCodec ff_h263p_decoder = { .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | -#if FF_API_FLAG_TRUNCATED - AV_CODEC_CAP_TRUNCATED | -#endif AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = ff_mpeg_flush, diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 5d5f39388f9..a256d45c85b 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -167,72 +167,6 @@ av_cold void ff_mpeg12_init_vlcs(void) ff_thread_once(&init_static_once, mpeg12_init_vlcs); } -#if FF_API_FLAG_TRUNCATED -/** - * Find the end of the current frame in the bitstream. - * @return the position of the first byte of the next frame, or -1 - */ -int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, AVCodecParserContext *s) -{ - int i; - uint32_t state = pc->state; - - /* EOF considered as end of frame */ - if (buf_size == 0) - return 0; - -/* - 0 frame start -> 1/4 - 1 first_SEQEXT -> 0/2 - 2 first field start -> 3/0 - 3 second_SEQEXT -> 2/0 - 4 searching end -*/ - - for (i = 0; i < buf_size; i++) { - av_assert1(pc->frame_start_found >= 0 && pc->frame_start_found <= 4); - if (pc->frame_start_found & 1) { - if (state == EXT_START_CODE && (buf[i] & 0xF0) != 0x80) - pc->frame_start_found--; - else if (state == EXT_START_CODE + 2) { - if ((buf[i] & 3) == 3) - pc->frame_start_found = 0; - else - pc->frame_start_found = (pc->frame_start_found + 1) & 3; - } - state++; - } else { - i = avpriv_find_start_code(buf + i, buf + buf_size, &state) - buf - 1; - if (pc->frame_start_found == 0 && state >= SLICE_MIN_START_CODE && state <= SLICE_MAX_START_CODE) { - i++; - pc->frame_start_found = 4; - } - if (state == SEQ_END_CODE) { - pc->frame_start_found = 0; - pc->state=-1; - return i+1; - } - if (pc->frame_start_found == 2 && state == SEQ_START_CODE) - pc->frame_start_found = 0; - if (pc->frame_start_found < 4 && state == EXT_START_CODE) - pc->frame_start_found++; - if (pc->frame_start_found == 4 && (state & 0xFFFFFF00) == 0x100) { - if (state < SLICE_MIN_START_CODE || state > SLICE_MAX_START_CODE) { - pc->frame_start_found = 0; - pc->state = -1; - return i - 3; - } - } - if (pc->frame_start_found == 0 && s && state == PICTURE_START_CODE) { - ff_fetch_timestamp(s, i - 3, 1, i > 3); - } - } - } - pc->state = state; - return END_NOT_FOUND; -} -#endif - #define MAX_INDEX (64 - 1) int ff_mpeg1_decode_block_intra(GetBitContext *gb, diff --git a/libavcodec/mpeg12.h b/libavcodec/mpeg12.h index 4e2e67eae18..86dd627e954 100644 --- a/libavcodec/mpeg12.h +++ b/libavcodec/mpeg12.h @@ -34,15 +34,6 @@ #define EXT_START_CODE 0x000001b5 #define USER_START_CODE 0x000001b2 -#include "version_major.h" -#if FF_API_FLAG_TRUNCATED -#include <stdint.h> - -struct ParseContext; -struct AVCodecParserContext; -int ff_mpeg1_find_frame_end(struct ParseContext *pc, const uint8_t *buf, int buf_size, struct AVCodecParserContext *s); -#endif - void ff_mpeg12_find_best_frame_rate(AVRational frame_rate, int *code, int *ext_n, int *ext_d, int nonstandard); diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 9999926f55d..457d985265d 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -1239,14 +1239,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) (s1->save_progressive_seq != s->progressive_sequence && FFALIGN(s->height, 16) != FFALIGN(s->height, 32)) || 0) { if (s1->mpeg_enc_ctx_allocated) { -#if FF_API_FLAG_TRUNCATED - ParseContext pc = s->parse_context; - s->parse_context.buffer = 0; ff_mpv_common_end(s); - s->parse_context = pc; -#else - ff_mpv_common_end(s); -#endif s1->mpeg_enc_ctx_allocated = 0; } @@ -2482,11 +2475,7 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture, if (avctx->err_recognition & AV_EF_EXPLODE && s2->er.error_count) return AVERROR_INVALIDDATA; -#if FF_API_FLAG_TRUNCATED - return FFMAX(0, buf_ptr - buf - s2->parse_context.last_index); -#else return FFMAX(0, buf_ptr - buf); -#endif } input_size = buf_end - buf_ptr; @@ -2799,17 +2788,6 @@ static int mpeg_decode_frame(AVCodecContext *avctx, AVFrame *picture, return buf_size; } -#if FF_API_FLAG_TRUNCATED - if (s2->avctx->flags & AV_CODEC_FLAG_TRUNCATED) { - int next = ff_mpeg1_find_frame_end(&s2->parse_context, buf, - buf_size, NULL); - - if (ff_combine_frame(&s2->parse_context, next, - (const uint8_t **) &buf, &buf_size) < 0) - return buf_size; - } -#endif - if (s->mpeg_enc_ctx_allocated == 0 && ( s2->codec_tag == AV_RL32("VCR2") || s2->codec_tag == AV_RL32("BW10") )) @@ -2886,9 +2864,6 @@ const FFCodec ff_mpeg1video_decoder = { .close = mpeg_decode_end, FF_CODEC_DECODE_CB(mpeg_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | -#if FF_API_FLAG_TRUNCATED - AV_CODEC_CAP_TRUNCATED | -#endif AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = flush, @@ -2918,9 +2893,6 @@ const FFCodec ff_mpeg2video_decoder = { .close = mpeg_decode_end, FF_CODEC_DECODE_CB(mpeg_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | -#if FF_API_FLAG_TRUNCATED - AV_CODEC_CAP_TRUNCATED | -#endif AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = flush, @@ -2963,9 +2935,6 @@ const FFCodec ff_mpegvideo_decoder = { .close = mpeg_decode_end, FF_CODEC_DECODE_CB(mpeg_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | -#if FF_API_FLAG_TRUNCATED - AV_CODEC_CAP_TRUNCATED | -#endif AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = flush, diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c index 3beb5f6dae0..28353aa146b 100644 --- a/libavcodec/mpeg4video_parser.c +++ b/libavcodec/mpeg4video_parser.c @@ -27,10 +27,6 @@ #include "mpegvideo.h" #include "mpeg4videodec.h" #include "mpeg4videodefs.h" -#if FF_API_FLAG_TRUNCATED -/* Nuke this header when removing FF_API_FLAG_TRUNCATED */ -#include "mpeg4video_parser.h" -#endif struct Mp4vParseContext { ParseContext pc; @@ -38,15 +34,11 @@ struct Mp4vParseContext { int first_picture; }; -#if FF_API_FLAG_TRUNCATED -int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size) -#else /** * Find the end of the current frame in the bitstream. * @return the position of the first byte of the next frame, or -1 */ static int mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size) -#endif { int vop_found, i; uint32_t state; @@ -148,11 +140,7 @@ static int mpeg4video_parse(AVCodecParserContext *s, if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) { next = buf_size; } else { -#if FF_API_FLAG_TRUNCATED - next = ff_mpeg4_find_frame_end(pc, buf, buf_size); -#else next = mpeg4_find_frame_end(pc, buf, buf_size); -#endif if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { *poutbuf = NULL; diff --git a/libavcodec/mpeg4video_parser.h b/libavcodec/mpeg4video_parser.h deleted file mode 100644 index 8008e693b43..00000000000 --- a/libavcodec/mpeg4video_parser.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * MPEG-4 video parser prototypes - * Copyright (c) 2003 Fabrice Bellard - * Copyright (c) 2003 Michael Niedermayer - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_MPEG4VIDEO_PARSER_H -#define AVCODEC_MPEG4VIDEO_PARSER_H - -#include "parser.h" - -/** - * Find the end of the current frame in the bitstream. - * @return the position of the first byte of the next frame, or -1 - */ -int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size); - -#endif /* AVCODEC_MPEG4VIDEO_PARSER_H */ diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index f96b6a31171..d456e5dd113 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -3859,9 +3859,6 @@ const FFCodec ff_mpeg4_decoder = { .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | -#if FF_API_FLAG_TRUNCATED - AV_CODEC_CAP_TRUNCATED | -#endif AV_CODEC_CAP_DELAY | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | FF_CODEC_CAP_ALLOCATE_PROGRESS, diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 836869c1d92..fc73abab9cd 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -738,10 +738,6 @@ av_cold int ff_mpv_common_init(MpegEncContext *s) nb_slices = max_slices; } -#if FF_API_FLAG_TRUNCATED - s->parse_context.state = -1; -#endif - s->context_initialized = 1; memset(s->thread_context, 0, sizeof(s->thread_context)); s->thread_context[0] = s; @@ -791,11 +787,6 @@ void ff_mpv_common_end(MpegEncContext *s) if (s->slice_context_count > 1) s->slice_context_count = 1; -#if FF_API_FLAG_TRUNCATED - av_freep(&s->parse_context.buffer); - s->parse_context.buffer_size = 0; -#endif - av_freep(&s->bitstream_buffer); s->allocated_bitstream_buffer_size = 0; diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index 42275953b9e..55828e61027 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -44,9 +44,6 @@ #include "pixblockdsp.h" #include "put_bits.h" #include "ratecontrol.h" -#if FF_API_FLAG_TRUNCATED -#include "parser.h" -#endif #include "mpegutils.h" #include "qpeldsp.h" #include "videodsp.h" @@ -353,10 +350,6 @@ typedef struct MpegEncContext { GetBitContext last_resync_gb; ///< used to search for the next resync marker int mb_num_left; ///< number of MBs left in this video packet (for partitioned Slices only) -#if FF_API_FLAG_TRUNCATED - ParseContext parse_context; -#endif - /* H.263 specific */ int gob_index; int obmc; ///< overlapped block motion compensation diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c index 12c7144ffb1..7a0c51e53d1 100644 --- a/libavcodec/mpegvideo_dec.c +++ b/libavcodec/mpegvideo_dec.c @@ -554,14 +554,6 @@ void ff_mpeg_flush(AVCodecContext *avctx) s->mb_x = s->mb_y = 0; -#if FF_API_FLAG_TRUNCATED - s->parse_context.state = -1; - s->parse_context.frame_start_found = 0; - s->parse_context.overread = 0; - s->parse_context.overread_index = 0; - s->parse_context.index = 0; - s->parse_context.last_index = 0; -#endif s->bitstream_buffer_size = 0; s->pp_time = 0; } diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c index 57bc1f706cc..8e7e88ff25e 100644 --- a/libavcodec/mpegvideo_parser.c +++ b/libavcodec/mpegvideo_parser.c @@ -20,6 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/avassert.h" #include "decode.h" #include "parser.h" #include "mpeg12.h" @@ -33,7 +34,6 @@ struct MpvParseContext { int width, height; }; -#if !FF_API_FLAG_TRUNCATED /** * Find the end of the current frame in the bitstream. * @return the position of the first byte of the next frame, or -1 @@ -98,7 +98,6 @@ static int mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, pc->state = state; return END_NOT_FOUND; } -#endif static void mpegvideo_extract_headers(AVCodecParserContext *s, AVCodecContext *avctx, @@ -255,11 +254,7 @@ static int mpegvideo_parse(AVCodecParserContext *s, if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){ next= buf_size; }else{ -#if FF_API_FLAG_TRUNCATED - next= ff_mpeg1_find_frame_end(pc, buf, buf_size, s); -#else next = mpeg1_find_frame_end(pc, buf, buf_size, s); -#endif if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { *poutbuf = NULL; diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h index 322ec7a1566..52ecc25cf9b 100644 --- a/libavcodec/options_table.h +++ b/libavcodec/options_table.h @@ -64,9 +64,6 @@ static const AVOption avcodec_options[] = { {"pass2", "use internal 2-pass ratecontrol in second pass mode", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_PASS2 }, INT_MIN, INT_MAX, 0, "flags"}, {"gray", "only decode/encode grayscale", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_GRAY }, INT_MIN, INT_MAX, V|E|D, "flags"}, {"psnr", "error[?] variables will be set during encoding", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_PSNR }, INT_MIN, INT_MAX, V|E, "flags"}, -#if FF_API_FLAG_TRUNCATED -{"truncated", "(Deprecated, use parsers instead.) Input bitstream might be randomly truncated", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_TRUNCATED }, INT_MIN, INT_MAX, V|D | AV_OPT_FLAG_DEPRECATED, "flags"}, -#endif {"ildct", "use interlaced DCT", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_INTERLACED_DCT }, INT_MIN, INT_MAX, V|E, "flags"}, {"low_delay", "force low delay", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_LOW_DELAY }, INT_MIN, INT_MAX, V|D|E, "flags"}, {"global_header", "place global headers in extradata instead of every keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_GLOBAL_HEADER }, INT_MIN, INT_MAX, V|A|E, "flags"}, diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index 60ba87dac48..ca84b81391d 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -48,9 +48,6 @@ static void validate_thread_parameters(AVCodecContext *avctx) { int frame_threading_supported = (avctx->codec->capabilities & AV_CODEC_CAP_FRAME_THREADS) -#if FF_API_FLAG_TRUNCATED - && !(avctx->flags & AV_CODEC_FLAG_TRUNCATED) -#endif && !(avctx->flags & AV_CODEC_FLAG_LOW_DELAY) && !(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS); if (avctx->thread_count == 1) { diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h index 6e85ae3e312..eea761c7dd6 100644 --- a/libavcodec/version_major.h +++ b/libavcodec/version_major.h @@ -38,7 +38,6 @@ */ #define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_FLAG_TRUNCATED (LIBAVCODEC_VERSION_MAJOR < 60) #define FF_API_SUB_TEXT_FORMAT (LIBAVCODEC_VERSION_MAJOR < 60) #define FF_API_IDCT_NONE (LIBAVCODEC_VERSION_MAJOR < 60) #define FF_API_SVTAV1_OPTS (LIBAVCODEC_VERSION_MAJOR < 60) -- 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".
next prev parent reply other threads:[~2023-02-04 10:47 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 ` [FFmpeg-devel] [PATCH v2 03/33] avcodec: Make avcodec_decode_subtitle2 accept a const AVPacket* Anton Khirnov 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 ` Anton Khirnov [this message] 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-16-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