summaryrefslogtreecommitdiffstats
path: root/libavformat/avformat.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-05-22 08:37:25 +0200
committerAnton Khirnov <anton@khirnov.net>2011-06-16 20:24:56 +0200
commit05e84c95c7f0543553af8f0ebd50fb5604e7e2ff (patch)
tree0b1399a338e2d8d3bda48477f35286c56bbc901c /libavformat/avformat.h
parentdc59ec5e79d813228e3dfbc8942a5fe424b399a0 (diff)
downloadffmpeg-streaming-05e84c95c7f0543553af8f0ebd50fb5604e7e2ff.zip
ffmpeg-streaming-05e84c95c7f0543553af8f0ebd50fb5604e7e2ff.tar.gz
lavf: add avformat_open_input() as a replacement for av_open_input_*
Add support for demuxer private options.
Diffstat (limited to 'libavformat/avformat.h')
-rw-r--r--libavformat/avformat.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 2b5b50e..56a9d57 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -730,6 +730,7 @@ typedef struct AVFormatContext {
#if FF_API_FLAG_RTP_HINT
#define AVFMT_FLAG_RTP_HINT 0x0040 ///< Deprecated, use the -movflags rtphint muxer specific AVOption instead
#endif
+#define AVFMT_FLAG_CUSTOM_IO 0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it.
int loop_input;
@@ -1041,6 +1042,27 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
AVFormatParameters *ap);
/**
+ * Open an input stream and read the header. The codecs are not opened.
+ * The stream must be closed with av_close_input_file().
+ *
+ * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context).
+ * May be a pointer to NULL, in which case an AVFormatContext is allocated by this
+ * function and written into ps.
+ * Note that a user-supplied AVFormatContext will be freed on failure.
+ * @param filename Name of the stream to open.
+ * @param fmt If non-NULL, this parameter forces a specific input format.
+ * Otherwise the format is autodetected.
+ * @param options A dictionary filled with AVFormatContext and demuxer-private options.
+ * On return this parameter will be destroyed and replaced with a dict containing
+ * options that were not found. May be NULL.
+ *
+ * @return 0 on success, a negative AVERROR on failure.
+ *
+ * @note If you want to use custom IO, preallocate the format context and set its pb field.
+ */
+int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options);
+
+/**
* Allocate an AVFormatContext.
* avformat_free_context() can be used to free the context and everything
* allocated by the framework within it.
OpenPOWER on IntegriCloud