summaryrefslogtreecommitdiff
path: root/libavformat/avformat.h
diff options
context:
space:
mode:
authorRodger Combs <rodger.combs@gmail.com>2015-10-07 21:32:14 -0500
committerRodger Combs <rodger.combs@gmail.com>2015-12-28 08:40:35 -0600
commit1f9139b07b8a896b62c1f28f3d04acac33978c0d (patch)
tree343964318a9d131e6dfe0886ac7776463fb69328 /libavformat/avformat.h
parent7a161b74ad13e8005f413770cce8af37bd051d32 (diff)
lavf: add automatic bitstream filtering; bump version
This solves the problem discussed in https://ffmpeg.org/pipermail/ffmpeg-devel/2015-September/179238.html by allowing AVCodec::write_header to be delayed until after packets have been run through required bitstream filters in order to generate global extradata. It also provides a mechanism by which a muxer can add a bitstream filter to a stream automatically, rather than prompting the user to do so.
Diffstat (limited to 'libavformat/avformat.h')
-rw-r--r--libavformat/avformat.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 39aedb5c6d..95a645b35c 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -600,6 +600,29 @@ typedef struct AVOutputFormat {
*/
int (*free_device_capabilities)(struct AVFormatContext *s, struct AVDeviceCapabilitiesQuery *caps);
enum AVCodecID data_codec; /**< default data codec */
+ /**
+ * Initialize format. May allocate data here, and set any AVFormatContext or
+ * AVStream parameters that need to be set before packets are sent.
+ * This method must not write output.
+ *
+ * Any allocations made here must be freed in deinit().
+ */
+ int (*init)(struct AVFormatContext *);
+ /**
+ * Deinitialize format. If present, this is called whenever the muxer is being
+ * destroyed, regardless of whether or not the header has been written.
+ *
+ * If a trailer is being written, this is called after write_trailer().
+ *
+ * This is called if init() fails as well.
+ */
+ void (*deinit)(struct AVFormatContext *);
+ /**
+ * Set up any necessary bitstream filtering and extract any extra data needed
+ * for the global header.
+ * Return 0 if more packets from this stream must be checked; 1 if not.
+ */
+ int (*check_bitstream)(struct AVFormatContext *, const AVPacket *pkt);
} AVOutputFormat;
/**
* @}