This is similar to what is done for AVStream.
Unified · Split
| @@ -14,7 +14,8 @@ libavutil: 2015-08-28 · 13 unmodified lines | ||
| 14 | 14 | API changes, most recent first: |
| 15 | 15 | |
| 16 | 16 | 2015-xx-xx - xxxxxxx - lavc 57.11.0 - avcodec.h |
| 17 | − Add av_packet_add_side_data(). | |
| 17 | + xxxxxxx - Add av_packet_add_side_data(). | |
| 18 | + xxxxxxx - Add AVCodecContext.coded_side_data. | |
| 18 | 19 | |
| 19 | 20 | 2015-xx-xx - xxxxxxx - lavc 57.9.1 - avcodec.h |
| 20 | 21 | Deprecate rtp_callback without replacement, i.e. it won't be possible to |
| @@ -2925,6 +2925,16 @@ typedef struct AVCodecContext { · 2924 unmodified lines | ||
| 2925 | 2925 | * - decoding: Set by libavcodec before calling get_format() |
| 2926 | 2926 | */ |
| 2927 | 2927 | enum AVPixelFormat sw_pix_fmt; |
| 2928 | + | |
| 2929 | + /** | |
| 2930 | + * Additional data associated with the entire coded stream. | |
| 2931 | + * | |
| 2932 | + * - decoding: unused | |
| 2933 | + * - encoding: may be set by libavcodec after avcodec_open2(). | |
| 2934 | + */ | |
| 2935 | + AVPacketSideData *coded_side_data; | |
| 2936 | + int nb_coded_side_data; | |
| 2937 | + | |
| 2928 | 2938 | } AVCodecContext; |
| 2929 | 2939 | |
| 2930 | 2940 | /** |
| @@ -1603,9 +1603,11 @@ void avsubtitle_free(AVSubtitle *sub) · 1602 unmodified lines | ||
| 1603 | 1603 | |
| 1604 | 1604 | av_cold int avcodec_close(AVCodecContext *avctx) |
| 1605 | 1605 | { |
| 1606 | + int i; | |
| 1607 | + | |
| 1606 | 1608 | if (avcodec_is_open(avctx)) { |
| 1607 | 1609 | FramePool *pool = avctx->internal->pool; |
| 1608 | − int i; | |
| 1610 | + | |
| 1609 | 1611 | if (HAVE_THREADS && avctx->internal->thread_ctx) |
| 1610 | 1612 | ff_thread_free(avctx); |
| 1611 | 1613 | if (avctx->codec && avctx->codec->close) |
| @@ -1622,6 +1624,11 @@ av_cold int avcodec_close(AVCodecContext *avctx) · 10 unmodified lines | ||
| 1622 | 1624 | av_freep(&avctx->internal); |
| 1623 | 1625 | } |
| 1624 | 1626 | |
| 1627 | + for (i = 0; i < avctx->nb_coded_side_data; i++) | |
| 1628 | + av_freep(&avctx->coded_side_data[i].data); | |
| 1629 | + av_freep(&avctx->coded_side_data); | |
| 1630 | + avctx->nb_coded_side_data = 0; | |
| 1631 | + | |
| 1625 | 1632 | if (avctx->priv_data && avctx->codec && avctx->codec->priv_class) |
| 1626 | 1633 | av_opt_free(avctx->priv_data); |
| 1627 | 1634 | av_opt_free(avctx); |