summaryrefslogtreecommitdiff
path: root/libavformat/avformat.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-06-18 11:19:27 +0200
committerAnton Khirnov <anton@khirnov.net>2011-10-19 17:02:11 +0200
commit569129a6dc503379c0486008224dfaff8f0ee81f (patch)
tree25e88c8ee236c07ea01614e908fe7c08392435d1 /libavformat/avformat.h
parent73447eb4bdba11bf23367f115f1a0ce46ce6f1df (diff)
lavf: add avformat_new_stream as a replacement for av_new_stream.
It takes a codec parameter, thus enabling codec-specific defaults.
Diffstat (limited to 'libavformat/avformat.h')
-rw-r--r--libavformat/avformat.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 4e7e883eb5..65f66d84d3 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1311,6 +1311,7 @@ void av_close_input_file(AVFormatContext *s);
*/
void avformat_free_context(AVFormatContext *s);
+#if FF_API_NEW_STREAM
/**
* Add a new stream to a media file.
*
@@ -1321,7 +1322,27 @@ void avformat_free_context(AVFormatContext *s);
* @param s media file handle
* @param id file-format-dependent stream ID
*/
+attribute_deprecated
AVStream *av_new_stream(AVFormatContext *s, int id);
+#endif
+
+/**
+ * Add a new stream to a media file.
+ *
+ * When demuxing, it is called by the demuxer in read_header(). If the
+ * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also
+ * be called in read_packet().
+ *
+ * When muxing, should be called by the user before avformat_write_header().
+ *
+ * @param c If non-NULL, the AVCodecContext corresponding to the new stream
+ * will be initialized to use this codec. This is needed for e.g. codec-specific
+ * defaults to be set, so codec should be provided if it is known.
+ *
+ * @return newly created stream or NULL on error.
+ */
+AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c);
+
AVProgram *av_new_program(AVFormatContext *s, int id);
/**