Skip to content

Commit ebd6d07

Browse files
committed
avutil: remove deprecated FF_API_FRAME_PKT
Deprecated since 2023-03-20. Signed-off-by: James Almer <[email protected]>
1 parent 10f199c commit ebd6d07

24 files changed

+8
-351
lines changed

libavcodec/av1dec.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,12 +1196,6 @@ static int set_output_frame(AVCodecContext *avctx, AVFrame *frame)
11961196

11971197
frame->pts = pkt->pts;
11981198
frame->pkt_dts = pkt->dts;
1199-
#if FF_API_FRAME_PKT
1200-
FF_DISABLE_DEPRECATION_WARNINGS
1201-
frame->pkt_size = pkt->size;
1202-
frame->pkt_pos = pkt->pos;
1203-
FF_ENABLE_DEPRECATION_WARNINGS
1204-
#endif
12051199

12061200
av_packet_unref(pkt);
12071201

libavcodec/cuviddec.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -697,12 +697,6 @@ static int cuvid_output_frame(AVCodecContext *avctx, AVFrame *frame)
697697
* So set pkt_pts and clear all the other pkt_ fields.
698698
*/
699699
frame->duration = 0;
700-
#if FF_API_FRAME_PKT
701-
FF_DISABLE_DEPRECATION_WARNINGS
702-
frame->pkt_pos = -1;
703-
frame->pkt_size = -1;
704-
FF_ENABLE_DEPRECATION_WARNINGS
705-
#endif
706700

707701
if (!parsed_frame.is_deinterlacing && !parsed_frame.dispinfo.progressive_frame)
708702
frame->flags |= AV_FRAME_FLAG_INTERLACED;

libavcodec/decode.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,6 @@ static int extract_packet_props(AVCodecInternal *avci, const AVPacket *pkt)
172172
av_packet_unref(avci->last_pkt_props);
173173
if (pkt) {
174174
ret = av_packet_copy_props(avci->last_pkt_props, pkt);
175-
#if FF_API_FRAME_PKT
176-
if (!ret)
177-
avci->last_pkt_props->stream_index = pkt->size; // Needed for ff_decode_frame_props().
178-
#endif
179175
}
180176
return ret;
181177
}
@@ -444,14 +440,6 @@ static inline int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame,
444440

445441
if (!(codec->caps_internal & FF_CODEC_CAP_SETS_PKT_DTS))
446442
frame->pkt_dts = pkt->dts;
447-
if (avctx->codec->type == AVMEDIA_TYPE_VIDEO) {
448-
#if FF_API_FRAME_PKT
449-
FF_DISABLE_DEPRECATION_WARNINGS
450-
if(!avctx->has_b_frames)
451-
frame->pkt_pos = pkt->pos;
452-
FF_ENABLE_DEPRECATION_WARNINGS
453-
#endif
454-
}
455443
emms_c();
456444

457445
if (avctx->codec->type == AVMEDIA_TYPE_VIDEO) {
@@ -507,10 +495,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
507495
pkt->pts = AV_NOPTS_VALUE;
508496
pkt->dts = AV_NOPTS_VALUE;
509497
if (!(codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) {
510-
#if FF_API_FRAME_PKT
511-
// See extract_packet_props() comment.
512-
avci->last_pkt_props->stream_index = avci->last_pkt_props->stream_index - consumed;
513-
#endif
514498
avci->last_pkt_props->pts = AV_NOPTS_VALUE;
515499
avci->last_pkt_props->dts = AV_NOPTS_VALUE;
516500
}
@@ -1480,12 +1464,6 @@ int ff_decode_frame_props_from_pkt(const AVCodecContext *avctx,
14801464

14811465
frame->pts = pkt->pts;
14821466
frame->duration = pkt->duration;
1483-
#if FF_API_FRAME_PKT
1484-
FF_DISABLE_DEPRECATION_WARNINGS
1485-
frame->pkt_pos = pkt->pos;
1486-
frame->pkt_size = pkt->size;
1487-
FF_ENABLE_DEPRECATION_WARNINGS
1488-
#endif
14891467

14901468
ret = side_data_map(frame, pkt->side_data, pkt->side_data_elems, ff_sd_global_map);
14911469
if (ret < 0)
@@ -1535,11 +1513,6 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
15351513
ret = ff_decode_frame_props_from_pkt(avctx, frame, pkt);
15361514
if (ret < 0)
15371515
return ret;
1538-
#if FF_API_FRAME_PKT
1539-
FF_DISABLE_DEPRECATION_WARNINGS
1540-
frame->pkt_size = pkt->stream_index;
1541-
FF_ENABLE_DEPRECATION_WARNINGS
1542-
#endif
15431516
}
15441517

15451518
ret = fill_frame_props(avctx, frame);

libavcodec/libuavs3d.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@ static void uavs3d_output_callback(uavs3d_io_frm_t *dec_frame) {
7979

8080
frm->pts = dec_frame->pts;
8181
frm->pkt_dts = dec_frame->dts;
82-
#if FF_API_FRAME_PKT
83-
FF_DISABLE_DEPRECATION_WARNINGS
84-
frm->pkt_pos = dec_frame->pkt_pos;
85-
frm->pkt_size = dec_frame->pkt_size;
86-
FF_ENABLE_DEPRECATION_WARNINGS
87-
#endif
8882

8983
if (dec_frame->type < 0 || dec_frame->type >= FF_ARRAY_ELEMS(ff_avs3_image_type)) {
9084
av_log(NULL, AV_LOG_WARNING, "Error frame type in uavs3d: %d.\n", dec_frame->type);
@@ -263,12 +257,6 @@ static int libuavs3d_decode_frame(AVCodecContext *avctx, AVFrame *frm,
263257
uavs3d_io_frm_t *frm_dec = &h->dec_frame;
264258

265259
buf_end = buf + buf_size;
266-
#if FF_API_FRAME_PKT
267-
FF_DISABLE_DEPRECATION_WARNINGS
268-
frm_dec->pkt_pos = avpkt->pos;
269-
frm_dec->pkt_size = avpkt->size;
270-
FF_ENABLE_DEPRECATION_WARNINGS
271-
#endif
272260

273261
while (!finish) {
274262
int bs_len;

libavdevice/lavfi.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,6 @@ static int create_subcc_packet(AVFormatContext *avctx, AVFrame *frame,
353353
memcpy(lavfi->subcc_packet.data, sd->data, sd->size);
354354
lavfi->subcc_packet.stream_index = stream_idx;
355355
lavfi->subcc_packet.pts = frame->pts;
356-
#if FF_API_FRAME_PKT
357-
FF_DISABLE_DEPRECATION_WARNINGS
358-
lavfi->subcc_packet.pos = frame->pkt_pos;
359-
FF_ENABLE_DEPRECATION_WARNINGS
360-
#endif
361356
return 0;
362357
}
363358

@@ -466,11 +461,6 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
466461

467462
pkt->stream_index = stream_idx;
468463
pkt->pts = frame->pts;
469-
#if FF_API_FRAME_PKT
470-
FF_DISABLE_DEPRECATION_WARNINGS
471-
pkt->pos = frame->pkt_pos;
472-
FF_ENABLE_DEPRECATION_WARNINGS
473-
#endif
474464

475465
av_frame_free(&frame_to_free);
476466

libavfilter/af_volume.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ static const char *const var_names[] = {
4848
"nb_channels", ///< number of channels
4949
"nb_consumed_samples", ///< number of samples consumed by the filter
5050
"nb_samples", ///< number of samples in the current frame
51-
#if FF_API_FRAME_PKT
52-
"pos", ///< position in the file of the frame
53-
#endif
5451
"pts", ///< frame presentation timestamp
5552
"sample_rate", ///< sample rate
5653
"startpts", ///< PTS at start of stream
@@ -289,9 +286,6 @@ static int config_output(AVFilterLink *outlink)
289286
vol->var_values[VAR_N] =
290287
vol->var_values[VAR_NB_CONSUMED_SAMPLES] =
291288
vol->var_values[VAR_NB_SAMPLES] =
292-
#if FF_API_FRAME_PKT
293-
vol->var_values[VAR_POS] =
294-
#endif
295289
vol->var_values[VAR_PTS] =
296290
vol->var_values[VAR_STARTPTS] =
297291
vol->var_values[VAR_STARTT] =
@@ -383,15 +377,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
383377
vol->var_values[VAR_T ] = TS2T(buf->pts, inlink->time_base);
384378
vol->var_values[VAR_N ] = inl->frame_count_out;
385379

386-
#if FF_API_FRAME_PKT
387-
FF_DISABLE_DEPRECATION_WARNINGS
388-
{
389-
int64_t pos;
390-
pos = buf->pkt_pos;
391-
vol->var_values[VAR_POS] = pos == -1 ? NAN : pos;
392-
}
393-
FF_ENABLE_DEPRECATION_WARNINGS
394-
#endif
395380
if (vol->eval_mode == EVAL_MODE_FRAME)
396381
set_volume(ctx);
397382

libavfilter/af_volume.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ enum VolumeVarName {
4747
VAR_NB_CHANNELS,
4848
VAR_NB_CONSUMED_SAMPLES,
4949
VAR_NB_SAMPLES,
50-
#if FF_API_FRAME_PKT
51-
VAR_POS,
52-
#endif
5350
VAR_PTS,
5451
VAR_SAMPLE_RATE,
5552
VAR_STARTPTS,

libavfilter/avfilter.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,6 @@ static int request_frame_to_filter(AVFilterLink *link)
550550
static const char *const var_names[] = {
551551
"t",
552552
"n",
553-
#if FF_API_FRAME_PKT
554-
"pos",
555-
#endif
556553
"w",
557554
"h",
558555
NULL
@@ -561,9 +558,6 @@ static const char *const var_names[] = {
561558
enum {
562559
VAR_T,
563560
VAR_N,
564-
#if FF_API_FRAME_PKT
565-
VAR_POS,
566-
#endif
567561
VAR_W,
568562
VAR_H,
569563
VAR_VARS_NB
@@ -1012,11 +1006,6 @@ static int evaluate_timeline_at_frame(AVFilterLink *link, const AVFrame *frame)
10121006
AVFilterContext *dstctx = link->dst;
10131007
FFFilterContext *dsti = fffilterctx(dstctx);
10141008
int64_t pts = frame->pts;
1015-
#if FF_API_FRAME_PKT
1016-
FF_DISABLE_DEPRECATION_WARNINGS
1017-
int64_t pos = frame->pkt_pos;
1018-
FF_ENABLE_DEPRECATION_WARNINGS
1019-
#endif
10201009

10211010
if (!dstctx->enable_str)
10221011
return 1;
@@ -1025,9 +1014,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
10251014
dsti->var_values[VAR_T] = pts == AV_NOPTS_VALUE ? NAN : pts * av_q2d(link->time_base);
10261015
dsti->var_values[VAR_W] = link->w;
10271016
dsti->var_values[VAR_H] = link->h;
1028-
#if FF_API_FRAME_PKT
1029-
dsti->var_values[VAR_POS] = pos == -1 ? NAN : pos;
1030-
#endif
10311017

10321018
return fabs(av_expr_eval(dsti->enable, dsti->var_values, NULL)) >= 0.5;
10331019
}

libavfilter/f_select.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ static const char *const var_names[] = {
8282
"prev_selected_n", ///< number of the last selected frame
8383

8484
"key", ///< tell if the frame is a key frame
85-
#if FF_API_FRAME_PKT
86-
"pos", ///< original position in the file of the frame
87-
#endif
8885

8986
"scene",
9087

@@ -141,9 +138,6 @@ enum var_name {
141138
VAR_PREV_SELECTED_N,
142139

143140
VAR_KEY,
144-
#if FF_API_FRAME_PKT
145-
VAR_POS,
146-
#endif
147141

148142
VAR_SCENE,
149143

@@ -358,11 +352,6 @@ static void select_frame(AVFilterContext *ctx, AVFrame *frame)
358352
select->var_values[VAR_N ] = inl->frame_count_out;
359353
select->var_values[VAR_PTS] = TS2D(frame->pts);
360354
select->var_values[VAR_T ] = TS2D(frame->pts) * av_q2d(inlink->time_base);
361-
#if FF_API_FRAME_PKT
362-
FF_DISABLE_DEPRECATION_WARNINGS
363-
select->var_values[VAR_POS] = frame->pkt_pos == -1 ? NAN : frame->pkt_pos;
364-
FF_ENABLE_DEPRECATION_WARNINGS
365-
#endif
366355
select->var_values[VAR_KEY] = !!(frame->flags & AV_FRAME_FLAG_KEY);
367356
select->var_values[VAR_CONCATDEC_SELECT] = get_concatdec_select(frame, av_rescale_q(frame->pts, inlink->time_base, AV_TIME_BASE_Q));
368357

libavfilter/f_sendcmd.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@
4444
static const char *const var_names[] = {
4545
"N", /* frame number */
4646
"T", /* frame time in seconds */
47-
#if FF_API_FRAME_PKT
48-
"POS", /* original position in the file of the frame */
49-
#endif
5047
"PTS", /* frame pts */
5148
"TS", /* interval start time in seconds */
5249
"TE", /* interval end time in seconds */
@@ -59,9 +56,6 @@ static const char *const var_names[] = {
5956
enum var_name {
6057
VAR_N,
6158
VAR_T,
62-
#if FF_API_FRAME_PKT
63-
VAR_POS,
64-
#endif
6559
VAR_PTS,
6660
VAR_TS,
6761
VAR_TE,
@@ -537,11 +531,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *ref)
537531
double current = TS2T(ref->pts, inlink->time_base);
538532

539533
var_values[VAR_N] = inl->frame_count_in;
540-
#if FF_API_FRAME_PKT
541-
FF_DISABLE_DEPRECATION_WARNINGS
542-
var_values[VAR_POS] = ref->pkt_pos == -1 ? NAN : ref->pkt_pos;
543-
FF_ENABLE_DEPRECATION_WARNINGS
544-
#endif
545534
var_values[VAR_PTS] = TS2D(ref->pts);
546535
var_values[VAR_T] = current;
547536
var_values[VAR_TS] = start;

0 commit comments

Comments
 (0)