History

lavc: add stream-global packet side data

This is similar to what is done for AVStream.

Anton Khirnov committed 11 years ago

Commit 84adab31 parent 31c51f73 files · +20 −2Browse files

Unified · Split

3 files
  1. doc/APIchanges +2 −1
  2. libavcodec/avcodec.h +10 −0
  3. libavcodec/utils.c +8 −1
doc/APIchanges+2−1
@@ -14,7 +14,8 @@ libavutil: 2015-08-28 · 13 unmodified lines
1414 API changes, most recent first:
1515
1616 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.
1819
1920 2015-xx-xx - xxxxxxx - lavc 57.9.1 - avcodec.h
2021 Deprecate rtp_callback without replacement, i.e. it won't be possible to
libavcodec/avcodec.h+10−0
@@ -2925,6 +2925,16 @@ typedef struct AVCodecContext { · 2924 unmodified lines
29252925 * - decoding: Set by libavcodec before calling get_format()
29262926 */
29272927 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+
29282938 } AVCodecContext;
29292939
29302940 /**
libavcodec/utils.c+8−1
@@ -1603,9 +1603,11 @@ void avsubtitle_free(AVSubtitle *sub) · 1602 unmodified lines
16031603
16041604 av_cold int avcodec_close(AVCodecContext *avctx)
16051605 {
1606+ int i;
1607+
16061608 if (avcodec_is_open(avctx)) {
16071609 FramePool *pool = avctx->internal->pool;
1608− int i;
1610+
16091611 if (HAVE_THREADS && avctx->internal->thread_ctx)
16101612 ff_thread_free(avctx);
16111613 if (avctx->codec && avctx->codec->close)
@@ -1622,6 +1624,11 @@ av_cold int avcodec_close(AVCodecContext *avctx) · 10 unmodified lines
16221624 av_freep(&avctx->internal);
16231625 }
16241626
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+
16251632 if (avctx->priv_data && avctx->codec && avctx->codec->priv_class)
16261633 av_opt_free(avctx->priv_data);
16271634 av_opt_free(avctx);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t