Browse Source

lavc: add stream-global packet side data

This is similar to what is done for AVStream.
tags/n3.0
Anton Khirnov 10 years ago
parent
commit
84adab333c
3 changed files with 20 additions and 2 deletions
  1. +2
    -1
      doc/APIchanges
  2. +10
    -0
      libavcodec/avcodec.h
  3. +8
    -1
      libavcodec/utils.c

+ 2
- 1
doc/APIchanges View File

@@ -14,7 +14,8 @@ libavutil: 2015-08-28
API changes, most recent first: API changes, most recent first:


2015-xx-xx - xxxxxxx - lavc 57.11.0 - avcodec.h 2015-xx-xx - xxxxxxx - lavc 57.11.0 - avcodec.h
Add av_packet_add_side_data().
xxxxxxx - Add av_packet_add_side_data().
xxxxxxx - Add AVCodecContext.coded_side_data.


2015-xx-xx - xxxxxxx - lavc 57.9.1 - avcodec.h 2015-xx-xx - xxxxxxx - lavc 57.9.1 - avcodec.h
Deprecate rtp_callback without replacement, i.e. it won't be possible to Deprecate rtp_callback without replacement, i.e. it won't be possible to


+ 10
- 0
libavcodec/avcodec.h View File

@@ -2925,6 +2925,16 @@ typedef struct AVCodecContext {
* - decoding: Set by libavcodec before calling get_format() * - decoding: Set by libavcodec before calling get_format()
*/ */
enum AVPixelFormat sw_pix_fmt; enum AVPixelFormat sw_pix_fmt;

/**
* Additional data associated with the entire coded stream.
*
* - decoding: unused
* - encoding: may be set by libavcodec after avcodec_open2().
*/
AVPacketSideData *coded_side_data;
int nb_coded_side_data;

} AVCodecContext; } AVCodecContext;


/** /**


+ 8
- 1
libavcodec/utils.c View File

@@ -1603,9 +1603,11 @@ void avsubtitle_free(AVSubtitle *sub)


av_cold int avcodec_close(AVCodecContext *avctx) av_cold int avcodec_close(AVCodecContext *avctx)
{ {
int i;

if (avcodec_is_open(avctx)) { if (avcodec_is_open(avctx)) {
FramePool *pool = avctx->internal->pool; FramePool *pool = avctx->internal->pool;
int i;
if (HAVE_THREADS && avctx->internal->thread_ctx) if (HAVE_THREADS && avctx->internal->thread_ctx)
ff_thread_free(avctx); ff_thread_free(avctx);
if (avctx->codec && avctx->codec->close) if (avctx->codec && avctx->codec->close)
@@ -1622,6 +1624,11 @@ av_cold int avcodec_close(AVCodecContext *avctx)
av_freep(&avctx->internal); av_freep(&avctx->internal);
} }


for (i = 0; i < avctx->nb_coded_side_data; i++)
av_freep(&avctx->coded_side_data[i].data);
av_freep(&avctx->coded_side_data);
avctx->nb_coded_side_data = 0;

if (avctx->priv_data && avctx->codec && avctx->codec->priv_class) if (avctx->priv_data && avctx->codec && avctx->codec->priv_class)
av_opt_free(avctx->priv_data); av_opt_free(avctx->priv_data);
av_opt_free(avctx); av_opt_free(avctx);


Loading…
Cancel
Save