summaryrefslogtreecommitdiffstats
path: root/libavfilter/buffersrc.h
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-02-24 16:03:57 +0000
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-02-24 16:03:57 +0000
commit10424024a16a7646169b9c9008c5f7b77cbc2211 (patch)
treeea852976be3a8b8d0cd3d57bc1beb918b89991d0 /libavfilter/buffersrc.h
parent6992276acaaee32b33bd5f6e2f0d89588c4ae59a (diff)
parentb3dd30db0b2d857147fc0e1461a00bd6172a26a3 (diff)
downloadffmpeg-streaming-10424024a16a7646169b9c9008c5f7b77cbc2211.zip
ffmpeg-streaming-10424024a16a7646169b9c9008c5f7b77cbc2211.tar.gz
Merge commit 'b3dd30db0b2d857147fc0e1461a00bd6172a26a3'
* commit 'b3dd30db0b2d857147fc0e1461a00bd6172a26a3': lavfi: pass the hw frames context through the filter chain Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavfilter/buffersrc.h')
-rw-r--r--libavfilter/buffersrc.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/libavfilter/buffersrc.h b/libavfilter/buffersrc.h
index 847c093..e4db1f7 100644
--- a/libavfilter/buffersrc.h
+++ b/libavfilter/buffersrc.h
@@ -66,6 +66,80 @@ enum {
unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src);
/**
+ * This structure contains the parameters describing the frames that will be
+ * passed to this filter.
+ *
+ * It should be allocated with av_buffersrc_parameters_alloc() and freed with
+ * av_free(). All the allocated fields in it remain owned by the caller.
+ */
+typedef struct AVBufferSrcParameters {
+ /**
+ * video: the pixel format, value corresponds to enum AVPixelFormat
+ * audio: the sample format, value corresponds to enum AVSampleFormat
+ */
+ int format;
+ /**
+ * The timebase to be used for the timestamps on the input frames.
+ */
+ AVRational time_base;
+
+ /**
+ * Video only, the display dimensions of the input frames.
+ */
+ int width, height;
+
+ /**
+ * Video only, the sample (pixel) aspect ratio.
+ */
+ AVRational sample_aspect_ratio;
+
+ /**
+ * Video only, the frame rate of the input video. This field must only be
+ * set to a non-zero value if input stream has a known constant framerate
+ * and should be left at its initial value if the framerate is variable or
+ * unknown.
+ */
+ AVRational frame_rate;
+
+ /**
+ * Video with a hwaccel pixel format only. This should be a reference to an
+ * AVHWFramesContext instance describing the input frames.
+ */
+ AVBufferRef *hw_frames_ctx;
+
+ /**
+ * Audio only, the audio sampling rate in samples per secon.
+ */
+ int sample_rate;
+
+ /**
+ * Audio only, the audio channel layout
+ */
+ uint64_t channel_layout;
+} AVBufferSrcParameters;
+
+/**
+ * Allocate a new AVBufferSrcParameters instance. It should be freed by the
+ * caller with av_free().
+ */
+AVBufferSrcParameters *av_buffersrc_parameters_alloc(void);
+
+/**
+ * Initialize the buffersrc or abuffersrc filter with the provided parameters.
+ * This function may be called multiple times, the later calls override the
+ * previous ones. Some of the parameters may also be set through AVOptions, then
+ * whatever method is used last takes precedence.
+ *
+ * @param ctx an instance of the buffersrc or abuffersrc filter
+ * @param param the stream parameters. The frames later passed to this filter
+ * must conform to those parameters. All the allocated fields in
+ * param remain owned by the caller, libavfilter will make internal
+ * copies or references when necessary.
+ * @return 0 on success, a negative AVERROR code on failure.
+ */
+int av_buffersrc_parameters_set(AVFilterContext *ctx, AVBufferSrcParameters *param);
+
+/**
* Add a frame to the buffer source.
*
* @param ctx an instance of the buffersrc filter
OpenPOWER on IntegriCloud