Showing the changes to libavcodec (13 of 16 files). Show all
Unified · Split
| @@ -1353,22 +1353,6 @@ typedef struct AVCodecContext { · 1352 unmodified lines | ||
| 1353 | 1353 | */ |
| 1354 | 1354 | int err_recognition; |
| 1355 | 1355 | |
| 1356 | −#if FF_API_REORDERED_OPAQUE | |
| 1357 | − /** | |
| 1358 | − * opaque 64-bit number (generally a PTS) that will be reordered and | |
| 1359 | − * output in AVFrame.reordered_opaque | |
| 1360 | − * - encoding: Set by libavcodec to the reordered_opaque of the input | |
| 1361 | − * frame corresponding to the last returned packet. Only | |
| 1362 | − * supported by encoders with the | |
| 1363 | − * AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE capability. | |
| 1364 | − * - decoding: Set by user. | |
| 1365 | − * | |
| 1366 | − * @deprecated Use AV_CODEC_FLAG_COPY_OPAQUE instead | |
| 1367 | − */ | |
| 1368 | − attribute_deprecated | |
| 1369 | − int64_t reordered_opaque; | |
| 1370 | −#endif | |
| 1371 | − | |
| 1372 | 1356 | /** |
| 1373 | 1357 | * Hardware accelerator in use |
| 1374 | 1358 | * - encoding: unused. |
| @@ -1474,11 +1474,6 @@ FF_DISABLE_DEPRECATION_WARNINGS · 1473 unmodified lines | ||
| 1474 | 1474 | FF_ENABLE_DEPRECATION_WARNINGS |
| 1475 | 1475 | #endif |
| 1476 | 1476 | } |
| 1477 | −#if FF_API_REORDERED_OPAQUE | |
| 1478 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 1479 | − frame->reordered_opaque = avctx->reordered_opaque; | |
| 1480 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 1481 | −#endif | |
| 1482 | 1477 | |
| 1483 | 1478 | ret = fill_frame_props(avctx, frame); |
| 1484 | 1479 | if (ret < 0) |
| @@ -234,12 +234,6 @@ FF_ENABLE_DEPRECATION_WARNINGS · 233 unmodified lines | ||
| 234 | 234 | int ff_encode_reordered_opaque(AVCodecContext *avctx, |
| 235 | 235 | AVPacket *pkt, const AVFrame *frame) |
| 236 | 236 | { |
| 237 | −#if FF_API_REORDERED_OPAQUE | |
| 238 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 239 | − avctx->reordered_opaque = frame->reordered_opaque; | |
| 240 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 241 | −#endif | |
| 242 | − | |
| 243 | 237 | if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { |
| 244 | 238 | int ret = av_buffer_replace(&pkt->opaque_ref, frame->opaque_ref); |
| 245 | 239 | if (ret < 0) |
| @@ -298,9 +298,6 @@ static void libdav1d_flush(AVCodecContext *c) · 297 unmodified lines | ||
| 298 | 298 | |
| 299 | 299 | typedef struct OpaqueData { |
| 300 | 300 | void *pkt_orig_opaque; |
| 301 | −#if FF_API_REORDERED_OPAQUE | |
| 302 | − int64_t reordered_opaque; | |
| 303 | −#endif | |
| 304 | 301 | } OpaqueData; |
| 305 | 302 | |
| 306 | 303 | static void libdav1d_data_free(const uint8_t *data, void *opaque) { |
| @@ -346,12 +343,7 @@ static int libdav1d_receive_frame_internal(AVCodecContext *c, Dav1dPicture *p) · 39 unmodified lines | ||
| 346 | 343 | |
| 347 | 344 | pkt->buf = NULL; |
| 348 | 345 | |
| 349 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 350 | − if ( | |
| 351 | −#if FF_API_REORDERED_OPAQUE | |
| 352 | − c->reordered_opaque != AV_NOPTS_VALUE || | |
| 353 | −#endif | |
| 354 | − (pkt->opaque && (c->flags & AV_CODEC_FLAG_COPY_OPAQUE))) { | |
| 346 | + if (pkt->opaque && (c->flags & AV_CODEC_FLAG_COPY_OPAQUE)) { | |
| 355 | 347 | od = av_mallocz(sizeof(*od)); |
| 356 | 348 | if (!od) { |
| 357 | 349 | av_packet_free(&pkt); |
| @@ -359,10 +351,6 @@ FF_DISABLE_DEPRECATION_WARNINGS · 1 unmodified line | ||
| 359 | 351 | return AVERROR(ENOMEM); |
| 360 | 352 | } |
| 361 | 353 | od->pkt_orig_opaque = pkt->opaque; |
| 362 | −#if FF_API_REORDERED_OPAQUE | |
| 363 | − od->reordered_opaque = c->reordered_opaque; | |
| 364 | −#endif | |
| 365 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 366 | 354 | } |
| 367 | 355 | pkt->opaque = od; |
| 368 | 356 | |
| @@ -464,14 +452,6 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) · 95 unmodified lines | ||
| 464 | 452 | |
| 465 | 453 | pkt = (AVPacket *)p->m.user_data.data; |
| 466 | 454 | od = pkt->opaque; |
| 467 | −#if FF_API_REORDERED_OPAQUE | |
| 468 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 469 | − if (od && od->reordered_opaque != AV_NOPTS_VALUE) | |
| 470 | − frame->reordered_opaque = od->reordered_opaque; | |
| 471 | − else | |
| 472 | − frame->reordered_opaque = AV_NOPTS_VALUE; | |
| 473 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 474 | −#endif | |
| 475 | 455 | |
| 476 | 456 | // restore the original user opaque value for |
| 477 | 457 | // ff_decode_frame_props_from_pkt() |
| @@ -57,9 +57,6 @@ typedef struct librav1eContext { · 56 unmodified lines | ||
| 57 | 57 | typedef struct FrameData { |
| 58 | 58 | int64_t pts; |
| 59 | 59 | int64_t duration; |
| 60 | −#if FF_API_REORDERED_OPAQUE | |
| 61 | − int64_t reordered_opaque; | |
| 62 | −#endif | |
| 63 | 60 | |
| 64 | 61 | void *frame_opaque; |
| 65 | 62 | AVBufferRef *frame_opaque_ref; |
| @@ -472,11 +469,6 @@ static int librav1e_receive_packet(AVCodecContext *avctx, AVPacket *pkt) · 406 unmodified lines | ||
| 472 | 469 | } |
| 473 | 470 | fd->pts = frame->pts; |
| 474 | 471 | fd->duration = frame->duration; |
| 475 | −#if FF_API_REORDERED_OPAQUE | |
| 476 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 477 | − fd->reordered_opaque = frame->reordered_opaque; | |
| 478 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 479 | −#endif | |
| 480 | 472 | |
| 481 | 473 | if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { |
| 482 | 474 | fd->frame_opaque = frame->opaque; |
| @@ -583,11 +575,6 @@ retry: · 100 unmodified lines | ||
| 583 | 575 | fd = rpkt->opaque; |
| 584 | 576 | pkt->pts = pkt->dts = fd->pts; |
| 585 | 577 | pkt->duration = fd->duration; |
| 586 | −#if FF_API_REORDERED_OPAQUE | |
| 587 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 588 | − avctx->reordered_opaque = fd->reordered_opaque; | |
| 589 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 590 | −#endif | |
| 591 | 578 | |
| 592 | 579 | if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { |
| 593 | 580 | pkt->opaque = fd->frame_opaque; |
| @@ -68,9 +68,6 @@ typedef struct FrameData { · 67 unmodified lines | ||
| 68 | 68 | int64_t pts; |
| 69 | 69 | int64_t duration; |
| 70 | 70 | |
| 71 | −#if FF_API_REORDERED_OPAQUE | |
| 72 | − int64_t reordered_opaque; | |
| 73 | −#endif | |
| 74 | 71 | void *frame_opaque; |
| 75 | 72 | AVBufferRef *frame_opaque_ref; |
| 76 | 73 | |
| @@ -383,11 +380,6 @@ static int frame_data_submit(AVCodecContext *avctx, AVFifo *fifo, · 306 unmodified lines | ||
| 383 | 380 | if (ret < 0) |
| 384 | 381 | goto fail; |
| 385 | 382 | } |
| 386 | −#if FF_API_REORDERED_OPAQUE | |
| 387 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 388 | − fd.reordered_opaque = frame->reordered_opaque; | |
| 389 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 390 | −#endif | |
| 391 | 383 | |
| 392 | 384 | ret = av_fifo_write(fifo, &fd, 1); |
| 393 | 385 | if (ret < 0) |
| @@ -414,12 +406,6 @@ static int frame_data_apply(AVCodecContext *avctx, AVFifo *fifo, AVPacket *pkt) · 20 unmodified lines | ||
| 414 | 406 | goto skip; |
| 415 | 407 | } |
| 416 | 408 | |
| 417 | −#if FF_API_REORDERED_OPAQUE | |
| 418 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 419 | − avctx->reordered_opaque = fd.reordered_opaque; | |
| 420 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 421 | −#endif | |
| 422 | − | |
| 423 | 409 | pkt->duration = fd.duration; |
| 424 | 410 | if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { |
| 425 | 411 | pkt->opaque = fd.frame_opaque; |
| @@ -39,9 +39,6 @@ typedef struct LibWebPAnimContext { · 38 unmodified lines | ||
| 39 | 39 | int64_t first_frame_pts; // pts of the first encoded frame. |
| 40 | 40 | int64_t end_pts; // pts + duration of the last frame |
| 41 | 41 | |
| 42 | −#if FF_API_REORDERED_OPAQUE | |
| 43 | − int64_t reordered_opaque; | |
| 44 | −#endif | |
| 45 | 42 | void *first_frame_opaque; |
| 46 | 43 | AVBufferRef *first_frame_opaque_ref; |
| 47 | 44 | |
| @@ -92,11 +89,6 @@ static int libwebp_anim_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 44 unmodified lines | ||
| 92 | 89 | if (pkt->pts != AV_NOPTS_VALUE && s->end_pts > pkt->pts) |
| 93 | 90 | pkt->duration = s->end_pts - pkt->pts; |
| 94 | 91 | |
| 95 | −#if FF_API_REORDERED_OPAQUE | |
| 96 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 97 | − avctx->reordered_opaque = s->reordered_opaque; | |
| 98 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 99 | −#endif | |
| 100 | 92 | if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { |
| 101 | 93 | pkt->opaque = s->first_frame_opaque; |
| 102 | 94 | pkt->opaque_ref = s->first_frame_opaque_ref; |
| @@ -134,11 +126,6 @@ FF_ENABLE_DEPRECATION_WARNINGS · 31 unmodified lines | ||
| 134 | 126 | |
| 135 | 127 | if (!avctx->frame_num) { |
| 136 | 128 | s->first_frame_pts = frame->pts; |
| 137 | −#if FF_API_REORDERED_OPAQUE | |
| 138 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 139 | − s->reordered_opaque = frame->reordered_opaque; | |
| 140 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 141 | −#endif | |
| 142 | 129 | |
| 143 | 130 | if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { |
| 144 | 131 | s->first_frame_opaque = frame->opaque; |
| @@ -54,9 +54,6 @@ · 53 unmodified lines | ||
| 54 | 54 | #define MB_CEIL(x) MB_FLOOR((x) + (MB_SIZE - 1)) |
| 55 | 55 | |
| 56 | 56 | typedef struct X264Opaque { |
| 57 | −#if FF_API_REORDERED_OPAQUE | |
| 58 | − int64_t reordered_opaque; | |
| 59 | −#endif | |
| 60 | 57 | int64_t wallclock; |
| 61 | 58 | int64_t duration; |
| 62 | 59 | |
| @@ -512,11 +509,6 @@ static int setup_frame(AVCodecContext *ctx, const AVFrame *frame, · 449 unmodified lines | ||
| 512 | 509 | goto fail; |
| 513 | 510 | } |
| 514 | 511 | |
| 515 | −#if FF_API_REORDERED_OPAQUE | |
| 516 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 517 | − opaque->reordered_opaque = frame->reordered_opaque; | |
| 518 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 519 | −#endif | |
| 520 | 512 | opaque->duration = frame->duration; |
| 521 | 513 | opaque->wallclock = wallclock; |
| 522 | 514 | if (ctx->export_side_data & AV_CODEC_EXPORT_DATA_PRFT) |
| @@ -681,11 +673,6 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, · 158 unmodified lines | ||
| 681 | 673 | out_opaque = pic_out.opaque; |
| 682 | 674 | if (out_opaque >= x4->reordered_opaque && |
| 683 | 675 | out_opaque < &x4->reordered_opaque[x4->nb_reordered_opaque]) { |
| 684 | −#if FF_API_REORDERED_OPAQUE | |
| 685 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 686 | − ctx->reordered_opaque = out_opaque->reordered_opaque; | |
| 687 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 688 | −#endif | |
| 689 | 676 | wallclock = out_opaque->wallclock; |
| 690 | 677 | pkt->duration = out_opaque->duration; |
| 691 | 678 | |
| @@ -700,11 +687,6 @@ FF_ENABLE_DEPRECATION_WARNINGS · 8 unmodified lines | ||
| 700 | 687 | // Unexpected opaque pointer on picture output |
| 701 | 688 | av_log(ctx, AV_LOG_ERROR, "Unexpected opaque pointer; " |
| 702 | 689 | "this is a bug, please report it.\n"); |
| 703 | −#if FF_API_REORDERED_OPAQUE | |
| 704 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 705 | − ctx->reordered_opaque = 0; | |
| 706 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 707 | −#endif | |
| 708 | 690 | } |
| 709 | 691 | |
| 710 | 692 | switch (pic_out.i_type) { |
| @@ -42,9 +42,6 @@ · 41 unmodified lines | ||
| 42 | 42 | #include "sei.h" |
| 43 | 43 | |
| 44 | 44 | typedef struct ReorderedData { |
| 45 | −#if FF_API_REORDERED_OPAQUE | |
| 46 | − int64_t reordered_opaque; | |
| 47 | −#endif | |
| 48 | 45 | int64_t duration; |
| 49 | 46 | |
| 50 | 47 | void *frame_opaque; |
| @@ -626,11 +623,6 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 575 unmodified lines | ||
| 626 | 623 | rd = &ctx->rd[rd_idx]; |
| 627 | 624 | |
| 628 | 625 | rd->duration = pic->duration; |
| 629 | −#if FF_API_REORDERED_OPAQUE | |
| 630 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 631 | − rd->reordered_opaque = pic->reordered_opaque; | |
| 632 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 633 | −#endif | |
| 634 | 626 | if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { |
| 635 | 627 | rd->frame_opaque = pic->opaque; |
| 636 | 628 | ret = av_buffer_replace(&rd->frame_opaque_ref, pic->opaque_ref); |
| @@ -768,11 +760,6 @@ FF_ENABLE_DEPRECATION_WARNINGS · 131 unmodified lines | ||
| 768 | 760 | int idx = (int)(intptr_t)x265pic_out.userData - 1; |
| 769 | 761 | ReorderedData *rd = &ctx->rd[idx]; |
| 770 | 762 | |
| 771 | −#if FF_API_REORDERED_OPAQUE | |
| 772 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 773 | − avctx->reordered_opaque = rd->reordered_opaque; | |
| 774 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 775 | −#endif | |
| 776 | 763 | pkt->duration = rd->duration; |
| 777 | 764 | |
| 778 | 765 | if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { |
| @@ -783,13 +770,6 @@ FF_ENABLE_DEPRECATION_WARNINGS · 4 unmodified lines | ||
| 783 | 770 | |
| 784 | 771 | rd_release(ctx, idx); |
| 785 | 772 | } |
| 786 | −#if FF_API_REORDERED_OPAQUE | |
| 787 | − else { | |
| 788 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 789 | − avctx->reordered_opaque = 0; | |
| 790 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 791 | − } | |
| 792 | −#endif | |
| 793 | 773 | |
| 794 | 774 | *got_packet = 1; |
| 795 | 775 | return 0; |
| @@ -2282,12 +2282,6 @@ static int nvenc_store_frame_data(AVCodecContext *avctx, NV_ENC_PIC_PARAMS *pic_ · 2281 unmodified lines | ||
| 2282 | 2282 | frame_data->duration = frame->duration; |
| 2283 | 2283 | frame_data->frame_opaque = frame->opaque; |
| 2284 | 2284 | |
| 2285 | −#if FF_API_REORDERED_OPAQUE | |
| 2286 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 2287 | − frame_data->reordered_opaque = frame->reordered_opaque; | |
| 2288 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 2289 | −#endif | |
| 2290 | − | |
| 2291 | 2285 | ctx->frame_data_array_pos = (ctx->frame_data_array_pos + 1) % ctx->frame_data_array_nb; |
| 2292 | 2286 | pic_params->inputDuration = idx; |
| 2293 | 2287 | |
| @@ -2304,12 +2298,6 @@ static int nvenc_retrieve_frame_data(AVCodecContext *avctx, NV_ENC_LOCK_BITSTREA · 10 unmodified lines | ||
| 2304 | 2298 | |
| 2305 | 2299 | pkt->duration = frame_data->duration; |
| 2306 | 2300 | |
| 2307 | −#if FF_API_REORDERED_OPAQUE | |
| 2308 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 2309 | − avctx->reordered_opaque = frame_data->reordered_opaque; | |
| 2310 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 2311 | −#endif | |
| 2312 | − | |
| 2313 | 2301 | if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { |
| 2314 | 2302 | pkt->opaque = frame_data->frame_opaque; |
| 2315 | 2303 | pkt->opaque_ref = frame_data->frame_opaque_ref; |
| @@ -100,10 +100,6 @@ typedef struct NvencFrameData · 99 unmodified lines | ||
| 100 | 100 | { |
| 101 | 101 | int64_t duration; |
| 102 | 102 | |
| 103 | −#if FF_API_REORDERED_OPAQUE | |
| 104 | − int64_t reordered_opaque; | |
| 105 | −#endif | |
| 106 | − | |
| 107 | 103 | void *frame_opaque; |
| 108 | 104 | AVBufferRef *frame_opaque_ref; |
| 109 | 105 | } NvencFrameData; |
| @@ -125,11 +125,6 @@ static int init_context_defaults(AVCodecContext *s, const AVCodec *codec) · 124 unmodified lines | ||
| 125 | 125 | s->sw_pix_fmt = AV_PIX_FMT_NONE; |
| 126 | 126 | s->sample_fmt = AV_SAMPLE_FMT_NONE; |
| 127 | 127 | |
| 128 | −#if FF_API_REORDERED_OPAQUE | |
| 129 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 130 | − s->reordered_opaque = AV_NOPTS_VALUE; | |
| 131 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 132 | −#endif | |
| 133 | 128 | if(codec && codec2->priv_data_size){ |
| 134 | 129 | s->priv_data = av_mallocz(codec2->priv_data_size); |
| 135 | 130 | if (!s->priv_data) |
| @@ -412,11 +412,6 @@ static int update_context_from_user(AVCodecContext *dst, const AVCodecContext *s · 411 unmodified lines | ||
| 412 | 412 | dst->skip_frame = src->skip_frame; |
| 413 | 413 | |
| 414 | 414 | dst->frame_num = src->frame_num; |
| 415 | −#if FF_API_REORDERED_OPAQUE | |
| 416 | −FF_DISABLE_DEPRECATION_WARNINGS | |
| 417 | − dst->reordered_opaque = src->reordered_opaque; | |
| 418 | −FF_ENABLE_DEPRECATION_WARNINGS | |
| 419 | −#endif | |
| 420 | 415 | |
| 421 | 416 | av_packet_unref(dst->internal->last_pkt_props); |
| 422 | 417 | err = av_packet_copy_props(dst->internal->last_pkt_props, src->internal->last_pkt_props); |