[FFmpeg-devel] [PATCH v2 07/11] avformat/avformat.h: Add comments regarding AVFMT_FLAG_NONBLOCK.

sebechlebskyjan at gmail.com sebechlebskyjan at gmail.com
Thu Aug 4 16:00:28 EEST 2016


From: Jan Sebechlebsky <sebechlebskyjan at gmail.com>

Add comments regarding AVFMG_FLAG_NONBLOCK usage with muxers.

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan at gmail.com>
---
 There are no changes in this patch, it is just rebased version
 because of change in previous patch.

 libavformat/avformat.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 3f6a6eb..e2c4c41 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1428,7 +1428,7 @@ typedef struct AVFormatContext {
     int flags;
 #define AVFMT_FLAG_GENPTS       0x0001 ///< Generate missing pts even if it requires parsing future frames.
 #define AVFMT_FLAG_IGNIDX       0x0002 ///< Ignore index.
-#define AVFMT_FLAG_NONBLOCK     0x0004 ///< Do not block when reading packets from input.
+#define AVFMT_FLAG_NONBLOCK     0x0004 ///< Do not block when reading packets from input / writing packets to output.
 #define AVFMT_FLAG_IGNDTS       0x0008 ///< Ignore DTS on frames that contain both DTS & PTS
 #define AVFMT_FLAG_NOFILLIN     0x0010 ///< Do not infer any values from other values, just return what is stored in the container
 #define AVFMT_FLAG_NOPARSE      0x0020 ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled
@@ -2391,6 +2391,10 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options);
  * the interleaving should call av_interleaved_write_frame() instead of this
  * function.
  *
+ * In case the muxer is operating in non-blocking mode (AVFMT_FLAG_NONBLOCK
+ * is set), this function can return AVERROR(EAGAIN) meaning the call should
+ * be repeated.
+ *
  * @param s media file handle
  * @param pkt The packet containing the data to be written. Note that unlike
  *            av_interleaved_write_frame(), this function does not take
@@ -2433,6 +2437,9 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt);
  * knowledge of future packets, improving e.g. the behaviour of the mp4
  * muxer for VFR content in fragmenting mode.
  *
+ * This call is not supported and must not be called if muxer is operating
+ * in non-blocking mode (AVFMT_FLAG_NONBLOCK is set).
+ *
  * @param s media file handle
  * @param pkt The packet containing the data to be written.
  *            <br>
-- 
1.9.1



More information about the ffmpeg-devel mailing list