These properties are unreliable because they depend on the frames decoded so far, users should check directly the presence of the decoded AVFrame side data or AVFrame flags.
Unified · Split
| @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07 · 1 unmodified line | ||
| 2 | 2 | |
| 3 | 3 | API changes, most recent first: |
| 4 | 4 | |
| 5 | +2025-01-05 - xxxxxxxxxx - lavc 61.31.100 - avcodec.h | |
| 6 | + Deprecate AVCodecContext->properties. | |
| 7 | + | |
| 5 | 8 | 2025-01-05 - xxxxxxxxxx - lavc 61.30.100 - frame.h |
| 6 | 9 | Add AV_FRAME_FLAG_LOSSLESS. |
| 7 | 10 | |
| @@ -788,10 +788,14 @@ static int set_context_with_sequence(AVCodecContext *avctx, · 787 unmodified lines | ||
| 788 | 788 | break; |
| 789 | 789 | } |
| 790 | 790 | |
| 791 | +#if FF_API_CODEC_PROPS | |
| 792 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 791 | 793 | if (seq->film_grain_params_present) |
| 792 | 794 | avctx->properties |= FF_CODEC_PROPERTY_FILM_GRAIN; |
| 793 | 795 | else |
| 794 | 796 | avctx->properties &= ~FF_CODEC_PROPERTY_FILM_GRAIN; |
| 797 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 798 | +#endif | |
| 795 | 799 | |
| 796 | 800 | if (avctx->width != width || avctx->height != height) { |
| 797 | 801 | int ret = ff_set_dimensions(avctx, width, height); |
| @@ -983,7 +987,11 @@ static int export_itut_t35(AVCodecContext *avctx, AVFrame *frame, · 185 unmodified lines | ||
| 983 | 987 | if (ret < 0) |
| 984 | 988 | return ret; |
| 985 | 989 | |
| 990 | +#if FF_API_CODEC_PROPS | |
| 991 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 986 | 992 | avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; |
| 993 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 994 | +#endif | |
| 987 | 995 | break; |
| 988 | 996 | } |
| 989 | 997 | default: // ignore unsupported identifiers |
| @@ -647,12 +647,16 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) · 646 unmodified lines | ||
| 647 | 647 | if (encode) { |
| 648 | 648 | av_bprintf(&bprint, ", q=%d-%d", enc->qmin, enc->qmax); |
| 649 | 649 | } else { |
| 650 | +#if FF_API_CODEC_PROPS | |
| 651 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 650 | 652 | if (enc->properties & FF_CODEC_PROPERTY_CLOSED_CAPTIONS) |
| 651 | 653 | av_bprintf(&bprint, ", Closed Captions"); |
| 652 | 654 | if (enc->properties & FF_CODEC_PROPERTY_FILM_GRAIN) |
| 653 | 655 | av_bprintf(&bprint, ", Film Grain"); |
| 654 | 656 | if (enc->properties & FF_CODEC_PROPERTY_LOSSLESS) |
| 655 | 657 | av_bprintf(&bprint, ", lossless"); |
| 658 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 659 | +#endif | |
| 656 | 660 | } |
| 657 | 661 | break; |
| 658 | 662 | case AVMEDIA_TYPE_AUDIO: |
| @@ -1806,15 +1806,18 @@ typedef struct AVCodecContext { · 1805 unmodified lines | ||
| 1806 | 1806 | #define FF_LEVEL_UNKNOWN -99 |
| 1807 | 1807 | #endif |
| 1808 | 1808 | |
| 1809 | +#if FF_API_CODEC_PROPS | |
| 1809 | 1810 | /** |
| 1810 | 1811 | * Properties of the stream that gets decoded |
| 1811 | 1812 | * - encoding: unused |
| 1812 | 1813 | * - decoding: set by libavcodec |
| 1813 | 1814 | */ |
| 1815 | + attribute_deprecated | |
| 1814 | 1816 | unsigned properties; |
| 1815 | 1817 | #define FF_CODEC_PROPERTY_LOSSLESS 0x00000001 |
| 1816 | 1818 | #define FF_CODEC_PROPERTY_CLOSED_CAPTIONS 0x00000002 |
| 1817 | 1819 | #define FF_CODEC_PROPERTY_FILM_GRAIN 0x00000004 |
| 1820 | +#endif | |
| 1818 | 1821 | |
| 1819 | 1822 | /** |
| 1820 | 1823 | * Skip loop filtering for selected frames. |
| @@ -807,7 +807,11 @@ int ff_h2645_sei_to_frame(AVFrame *frame, H2645SEI *sei, · 806 unmodified lines | ||
| 807 | 807 | if (!sd) |
| 808 | 808 | av_buffer_unref(&a53->buf_ref); |
| 809 | 809 | a53->buf_ref = NULL; |
| 810 | +#if FF_API_CODEC_PROPS | |
| 811 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 810 | 812 | avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; |
| 813 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 814 | +#endif | |
| 811 | 815 | } |
| 812 | 816 | |
| 813 | 817 | ret = h2645_sei_to_side_data(avctx, sei, &frame->side_data, &frame->nb_side_data); |
| @@ -900,7 +904,11 @@ FF_ENABLE_DEPRECATION_WARNINGS · 86 unmodified lines | ||
| 900 | 904 | else |
| 901 | 905 | fgc->present = fgc->persistence_flag; |
| 902 | 906 | |
| 907 | +#if FF_API_CODEC_PROPS | |
| 908 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 903 | 909 | avctx->properties |= FF_CODEC_PROPERTY_FILM_GRAIN; |
| 910 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 911 | +#endif | |
| 904 | 912 | } |
| 905 | 913 | |
| 906 | 914 | #if CONFIG_HEVC_SEI |
| @@ -403,8 +403,12 @@ static int export_stream_params_from_sei(HEVCContext *s) · 402 unmodified lines | ||
| 403 | 403 | { |
| 404 | 404 | AVCodecContext *avctx = s->avctx; |
| 405 | 405 | |
| 406 | +#if FF_API_CODEC_PROPS | |
| 407 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 406 | 408 | if (s->sei.common.a53_caption.buf_ref) |
| 407 | 409 | s->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; |
| 410 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 411 | +#endif | |
| 408 | 412 | |
| 409 | 413 | if (s->sei.common.alternative_transfer.present && |
| 410 | 414 | av_color_transfer_name(s->sei.common.alternative_transfer.preferred_transfer_characteristics) && |
| @@ -412,9 +416,13 @@ static int export_stream_params_from_sei(HEVCContext *s) · 1 unmodified line | ||
| 412 | 416 | avctx->color_trc = s->sei.common.alternative_transfer.preferred_transfer_characteristics; |
| 413 | 417 | } |
| 414 | 418 | |
| 419 | +#if FF_API_CODEC_PROPS | |
| 420 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 415 | 421 | if ((s->sei.common.film_grain_characteristics && s->sei.common.film_grain_characteristics->present) || |
| 416 | 422 | s->sei.common.aom_film_grain.enable) |
| 417 | 423 | avctx->properties |= FF_CODEC_PROPERTY_FILM_GRAIN; |
| 424 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 425 | +#endif | |
| 418 | 426 | |
| 419 | 427 | return 0; |
| 420 | 428 | } |
| @@ -542,9 +542,13 @@ static int get_cox(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c) · 541 unmodified lines | ||
| 542 | 542 | /* set integer 9/7 DWT in case of BITEXACT flag */ |
| 543 | 543 | if ((s->avctx->flags & AV_CODEC_FLAG_BITEXACT) && (c->transform == FF_DWT97)) |
| 544 | 544 | c->transform = FF_DWT97_INT; |
| 545 | +#if FF_API_CODEC_PROPS | |
| 545 | 546 | else if (c->transform == FF_DWT53) { |
| 547 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 546 | 548 | s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; |
| 549 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 547 | 550 | } |
| 551 | +#endif | |
| 548 | 552 | |
| 549 | 553 | if (c->csty & JPEG2000_CSTY_PREC) { |
| 550 | 554 | int i; |
| @@ -162,10 +162,14 @@ static void libdav1d_init_params(AVCodecContext *c, const Dav1dSequenceHeader *s · 161 unmodified lines | ||
| 162 | 162 | (unsigned)seq->num_units_in_tick, |
| 163 | 163 | (unsigned)seq->time_scale); |
| 164 | 164 | |
| 165 | +#if FF_API_CODEC_PROPS | |
| 166 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 165 | 167 | if (seq->film_grain_present) |
| 166 | 168 | c->properties |= FF_CODEC_PROPERTY_FILM_GRAIN; |
| 167 | 169 | else |
| 168 | 170 | c->properties &= ~FF_CODEC_PROPERTY_FILM_GRAIN; |
| 171 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 172 | +#endif | |
| 169 | 173 | } |
| 170 | 174 | |
| 171 | 175 | static av_cold int libdav1d_parse_extradata(AVCodecContext *c) |
| @@ -533,7 +537,11 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) · 361 unmodified lines | ||
| 533 | 537 | if (res < 0) |
| 534 | 538 | goto fail; |
| 535 | 539 | |
| 540 | +#if FF_API_CODEC_PROPS | |
| 541 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 536 | 542 | c->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; |
| 543 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 544 | +#endif | |
| 537 | 545 | break; |
| 538 | 546 | } |
| 539 | 547 | default: // ignore unsupported identifiers |
| @@ -2508,7 +2508,11 @@ redo_for_pal8: · 2507 unmodified lines | ||
| 2508 | 2508 | break; |
| 2509 | 2509 | case SOF3: |
| 2510 | 2510 | avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS; |
| 2511 | +#if FF_API_CODEC_PROPS | |
| 2512 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 2511 | 2513 | avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; |
| 2514 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 2515 | +#endif | |
| 2512 | 2516 | s->lossless = 1; |
| 2513 | 2517 | s->ls = 0; |
| 2514 | 2518 | s->progressive = 0; |
| @@ -2517,7 +2521,11 @@ redo_for_pal8: · 2 unmodified lines | ||
| 2517 | 2521 | break; |
| 2518 | 2522 | case SOF48: |
| 2519 | 2523 | avctx->profile = AV_PROFILE_MJPEG_JPEG_LS; |
| 2524 | +#if FF_API_CODEC_PROPS | |
| 2525 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 2520 | 2526 | avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; |
| 2527 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 2528 | +#endif | |
| 2521 | 2529 | s->lossless = 1; |
| 2522 | 2530 | s->ls = 1; |
| 2523 | 2531 | s->progressive = 0; |
| @@ -1919,7 +1919,11 @@ static void mpeg_set_cc_format(AVCodecContext *avctx, enum Mpeg2ClosedCaptionsFo · 1918 unmodified lines | ||
| 1919 | 1919 | av_log(avctx, AV_LOG_DEBUG, "CC: first seen substream is %s format\n", label); |
| 1920 | 1920 | } |
| 1921 | 1921 | |
| 1922 | +#if FF_API_CODEC_PROPS | |
| 1923 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 1922 | 1924 | avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; |
| 1925 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 1926 | +#endif | |
| 1923 | 1927 | } |
| 1924 | 1928 | |
| 1925 | 1929 | static int mpeg_decode_a53_cc(AVCodecContext *avctx, |
| @@ -365,7 +365,11 @@ static int update_context_from_thread(AVCodecContext *dst, const AVCodecContext · 364 unmodified lines | ||
| 365 | 365 | |
| 366 | 366 | dst->has_b_frames = src->has_b_frames; |
| 367 | 367 | dst->idct_algo = src->idct_algo; |
| 368 | +#if FF_API_CODEC_PROPS | |
| 369 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 368 | 370 | dst->properties = src->properties; |
| 371 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 372 | +#endif | |
| 369 | 373 | |
| 370 | 374 | dst->bits_per_coded_sample = src->bits_per_coded_sample; |
| 371 | 375 | dst->sample_aspect_ratio = src->sample_aspect_ratio; |
| @@ -29,7 +29,7 @@ · 28 unmodified lines | ||
| 29 | 29 | |
| 30 | 30 | #include "version_major.h" |
| 31 | 31 | |
| 32 | −#define LIBAVCODEC_VERSION_MINOR 30 | |
| 32 | +#define LIBAVCODEC_VERSION_MINOR 31 | |
| 33 | 33 | #define LIBAVCODEC_VERSION_MICRO 100 |
| 34 | 34 | |
| 35 | 35 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |
| @@ -49,6 +49,7 @@ · 48 unmodified lines | ||
| 49 | 49 | #define FF_API_VDPAU_ALLOC_GET_SET (LIBAVCODEC_VERSION_MAJOR < 62) |
| 50 | 50 | #define FF_API_QUALITY_FACTOR (LIBAVCODEC_VERSION_MAJOR < 62) |
| 51 | 51 | #define FF_API_V408_CODECID (LIBAVCODEC_VERSION_MAJOR < 62) |
| 52 | +#define FF_API_CODEC_PROPS (LIBAVCODEC_VERSION_MAJOR < 63) | |
| 52 | 53 | |
| 53 | 54 | // reminder to remove the OMX encoder on next major bump |
| 54 | 55 | #define FF_CODEC_OMX (LIBAVCODEC_VERSION_MAJOR < 62) |
| @@ -682,8 +682,12 @@ static int decode_frame_header(AVCodecContext *avctx, · 681 unmodified lines | ||
| 682 | 682 | s->s.h.uvac_qdelta = get_bits1(&s->gb) ? get_sbits_inv(&s->gb, 4) : 0; |
| 683 | 683 | s->s.h.lossless = s->s.h.yac_qi == 0 && s->s.h.ydc_qdelta == 0 && |
| 684 | 684 | s->s.h.uvdc_qdelta == 0 && s->s.h.uvac_qdelta == 0; |
| 685 | +#if FF_API_CODEC_PROPS | |
| 686 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 685 | 687 | if (s->s.h.lossless) |
| 686 | 688 | avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; |
| 689 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 690 | +#endif | |
| 687 | 691 | |
| 688 | 692 | /* segmentation header info */ |
| 689 | 693 | if ((s->s.h.segmentation.enabled = get_bits1(&s->gb))) { |
| @@ -1407,7 +1407,11 @@ static int webp_decode_frame(AVCodecContext *avctx, AVFrame *p, · 1406 unmodified lines | ||
| 1407 | 1407 | chunk_size, 0); |
| 1408 | 1408 | if (ret < 0) |
| 1409 | 1409 | return ret; |
| 1410 | +#if FF_API_CODEC_PROPS | |
| 1411 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 1410 | 1412 | avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; |
| 1413 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 1414 | +#endif | |
| 1411 | 1415 | } |
| 1412 | 1416 | bytestream2_skip(&gb, chunk_size); |
| 1413 | 1417 | break; |
| @@ -620,7 +620,11 @@ static void dump_stream_format(const AVFormatContext *ic, int i, · 619 unmodified lines | ||
| 620 | 620 | |
| 621 | 621 | // Fields which are missing from AVCodecParameters need to be taken from the AVCodecContext |
| 622 | 622 | if (sti->avctx) { |
| 623 | +#if FF_API_CODEC_PROPS | |
| 624 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 623 | 625 | avctx->properties = sti->avctx->properties; |
| 626 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 627 | +#endif | |
| 624 | 628 | avctx->codec = sti->avctx->codec; |
| 625 | 629 | avctx->qmin = sti->avctx->qmin; |
| 626 | 630 | avctx->qmax = sti->avctx->qmax; |