Some encoders (e.g. flac) need to send side data when there is no more
data to be output. This enables them to output a packet with no data in
it, only side data.
---
doc/APIchanges | 5 +++++
libavcodec/avcodec.h | 15 +++++++++++++++
libavcodec/options_table.h | 1 +
3 files changed, 21 insertions(+)
diff --git a/doc/APIchanges b/doc/APIchanges
index 2a0084d..e504c38 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,11 @@ libavutil: 2013-12-xx
API changes, most recent first:
+2014-04-xx - xxxxxxx - lavc 55.xx.0 - avcodec.h
+ Add AVCodecContext.side_data_only_packets to allow encoders to output packets
+ with only side data. This option may become mandatory in the future, so all
+ users are recommended to update their code and enable this option.
+
2014-04-xx - xxxxxxx - lavc 55.44.0 - avcodec.h
Add avcodec_free_context(). From now on it should be used for freeing
AVCodecContext.
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index c92b6f1..489e08d 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2788,6 +2788,21 @@ typedef struct AVCodecContext {
* - decoding: unused.
*/
uint64_t vbv_delay;
+
+ /**
+ * Encoding only. Allow encoders to output packets that do not contain any
+ * encoded data, only side data.
+ *
+ * Some encoders need to output such packets, e.g. to update some stream
+ * parameters at the end of encoding.
+ *
+ * All callers are strongly recommended to set this option to 1 and update
+ * their code to deal with such packets, since this behaviour may become
+ * always enabled in the future (then this option will be removed). To
avoid
+ * ABI issues when this happens, the callers should use AVOptions to set
+ * this field.
+ */
+ int side_data_only_packets;
} AVCodecContext;
/**
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 6825e62..f018b21 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -399,6 +399,7 @@ static const AVOption avcodec_options[] = {
{"fltp", "32-bit float planar", 0, AV_OPT_TYPE_CONST, {.i64 =
AV_SAMPLE_FMT_FLTP }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
{"dblp", "64-bit double planar", 0, AV_OPT_TYPE_CONST, {.i64 =
AV_SAMPLE_FMT_DBLP }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
{"refcounted_frames", NULL, OFFSET(refcounted_frames), AV_OPT_TYPE_INT, {.i64
= 0}, 0, 1, A|V|D },
+{"side_data_only_packets", NULL, OFFSET(side_data_only_packets),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, A|V|E },
{NULL},
};
--
1.7.10.4
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel