summaryrefslogtreecommitdiff
path: root/libavformat/avformat.h
diff options
context:
space:
mode:
authorNicolas George <george@nsup.org>2013-12-31 14:09:48 +0100
committerNicolas George <george@nsup.org>2014-02-11 10:29:02 +0100
commit1b05ac220ef1370cb6ba805b82ca764e4c5bed25 (patch)
treefd45a2be18ee8ab1ebc2c610019666db9b7522c8 /libavformat/avformat.h
parent6c12b1de064d2604d19cb4c238a788cfed9679ac (diff)
lavf: add write_uncoded_frame() API.
Diffstat (limited to 'libavformat/avformat.h')
-rw-r--r--libavformat/avformat.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 2d62b5b4f0..2667b37b5c 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -512,6 +512,17 @@ typedef struct AVOutputFormat {
*/
int (*control_message)(struct AVFormatContext *s, int type,
void *data, size_t data_size);
+
+ /**
+ * Write an uncoded AVFrame.
+ *
+ * See av_write_uncoded_frame() for details.
+ *
+ * The library will free *frame afterwards, but the muxer can prevent it
+ * by setting the pointer to NULL.
+ */
+ int (*write_uncoded_frame)(struct AVFormatContext *, int stream_index,
+ AVFrame **frame, unsigned flags);
} AVOutputFormat;
/**
* @}
@@ -2093,6 +2104,44 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt);
int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
/**
+ * Write a uncoded frame to an output media file.
+ *
+ * The frame must be correctly interleaved according to the container
+ * specification; if not, then av_interleaved_write_frame() must be used.
+ *
+ * See av_interleaved_write_frame() for details.
+ */
+int av_write_uncoded_frame(AVFormatContext *s, int stream_index,
+ AVFrame *frame);
+
+/**
+ * Write a uncoded frame to an output media file.
+ *
+ * If the muxer supports it, this function allows to write an AVFrame
+ * structure directly, without encoding it into a packet.
+ * It is mostly useful for devices and similar special muxers that use raw
+ * video or PCM data and will not serialize it into a byte stream.
+ *
+ * To test whether it is possible to use it with a given muxer and stream,
+ * use av_write_uncoded_frame_query().
+ *
+ * The caller gives up ownership of the frame and must not access it
+ * afterwards.
+ *
+ * @return >=0 for success, a negative code on error
+ */
+int av_interleaved_write_uncoded_frame(AVFormatContext *s, int stream_index,
+ AVFrame *frame);
+
+/**
+ * Test whether a muxer supports uncoded frame.
+ *
+ * @return >=0 if an uncoded frame can be written to that muxer and stream,
+ * <0 if not
+ */
+int av_write_uncoded_frame_query(AVFormatContext *s, int stream_index);
+
+/**
* Write the stream trailer to an output media file and free the
* file private data.
*