FFmpeg
4.3.1
|
Files | |
file | buffersrc.h |
Memory buffer source API. | |
Data Structures | |
struct | AVBufferSrcParameters |
This structure contains the parameters describing the frames that will be passed to this filter. More... | |
Enumerations | |
enum | { AVFILTER_AUTO_CONVERT_ALL = 0, AVFILTER_AUTO_CONVERT_NONE = -1, AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT = 1, AV_BUFFERSRC_FLAG_PUSH = 4, AV_BUFFERSRC_FLAG_KEEP_REF = 8, AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX = 0x01, AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX = 0x02, AV_CODEC_HW_CONFIG_METHOD_INTERNAL = 0x04, AV_CODEC_HW_CONFIG_METHOD_AD_HOC = 0x08, AV_FRAME_CROP_UNALIGNED = 1 << 0, AV_HWFRAME_MAP_READ = 1 << 0, AV_HWFRAME_MAP_WRITE = 1 << 1, AV_HWFRAME_MAP_OVERWRITE = 1 << 2, AV_HWFRAME_MAP_DIRECT = 1 << 3, AV_DRM_MAX_PLANES = 4, AV_VAAPI_DRIVER_QUIRK_USER_SET = (1 << 0), AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS = (1 << 1), AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE = (1 << 2), AV_VAAPI_DRIVER_QUIRK_SURFACE_ATTRIBUTES = (1 << 3), AV_OPT_FLAG_IMPLICIT_KEY = 1 } |
Functions | |
unsigned | av_buffersrc_get_nb_failed_requests (AVFilterContext *buffer_src) |
Get the number of failed requests. More... | |
AVBufferSrcParameters * | av_buffersrc_parameters_alloc (void) |
Allocate a new AVBufferSrcParameters instance. More... | |
int | av_buffersrc_parameters_set (AVFilterContext *ctx, AVBufferSrcParameters *param) |
Initialize the buffersrc or abuffersrc filter with the provided parameters. More... | |
av_warn_unused_result int | av_buffersrc_write_frame (AVFilterContext *ctx, const AVFrame *frame) |
Add a frame to the buffer source. More... | |
av_warn_unused_result int | av_buffersrc_add_frame (AVFilterContext *ctx, AVFrame *frame) |
Add a frame to the buffer source. More... | |
av_warn_unused_result int | av_buffersrc_add_frame_flags (AVFilterContext *buffer_src, AVFrame *frame, int flags) |
Add a frame to the buffer source. More... | |
int | av_buffersrc_close (AVFilterContext *ctx, int64_t pts, unsigned flags) |
Close the buffer source after EOF. More... | |
anonymous enum |
Enumerator | |
---|---|
AVFILTER_AUTO_CONVERT_ALL | all automatic conversions enabled |
AVFILTER_AUTO_CONVERT_NONE | all automatic conversions disabled |
AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT | Do not check for format changes. |
AV_BUFFERSRC_FLAG_PUSH | Immediately push the frame to the output. |
AV_BUFFERSRC_FLAG_KEEP_REF | Keep a reference to the frame. If the frame if reference-counted, create a new reference; otherwise copy the frame data. |
AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX | The codec supports this format via the hw_device_ctx interface. When selecting this format, AVCodecContext.hw_device_ctx should have been set to a device of the specified type before calling avcodec_open2(). |
AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX | The codec supports this format via the hw_frames_ctx interface. When selecting this format for a decoder, AVCodecContext.hw_frames_ctx should be set to a suitable frames context inside the get_format() callback. The frames context must have been created on a device of the specified type. When selecting this format for an encoder, AVCodecContext.hw_frames_ctx should be set to the context which will be used for the input frames before calling avcodec_open2(). |
AV_CODEC_HW_CONFIG_METHOD_INTERNAL | The codec supports this format by some internal method. This format can be selected without any additional configuration - no device or frames context is required. |
AV_CODEC_HW_CONFIG_METHOD_AD_HOC | The codec supports this format by some ad-hoc method. Additional settings and/or function calls are required. See the codec-specific documentation for details. (Methods requiring this sort of configuration are deprecated and others should be used in preference.) |
AV_FRAME_CROP_UNALIGNED | Apply the maximum possible cropping, even if it requires setting the AVFrame.data[] entries to unaligned pointers. Passing unaligned data to FFmpeg API is generally not allowed, and causes undefined behavior (such as crashes). You can pass unaligned data only to FFmpeg APIs that are explicitly documented to accept it. Use this flag only if you absolutely know what you are doing. |
AV_HWFRAME_MAP_READ | The mapping must be readable. |
AV_HWFRAME_MAP_WRITE | The mapping must be writeable. |
AV_HWFRAME_MAP_OVERWRITE | The mapped frame will be overwritten completely in subsequent operations, so the current frame data need not be loaded. Any values which are not overwritten are unspecified. |
AV_HWFRAME_MAP_DIRECT | The mapping must be direct. That is, there must not be any copying in the map or unmap steps. Note that performance of direct mappings may be much lower than normal memory. |
AV_DRM_MAX_PLANES | The maximum number of layers/planes in a DRM frame. |
AV_VAAPI_DRIVER_QUIRK_USER_SET | The quirks field has been set by the user and should not be detected automatically by av_hwdevice_ctx_init(). |
AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS | The driver does not destroy parameter buffers when they are used by vaRenderPicture(). Additional code will be required to destroy them separately afterwards. |
AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE | The driver does not support the VASurfaceAttribMemoryType attribute, so the surface allocation code will not try to use it. |
AV_VAAPI_DRIVER_QUIRK_SURFACE_ATTRIBUTES | The driver does not support surface attributes at all. The surface allocation code will never pass them to surface allocation, and the results of the vaQuerySurfaceAttributes() call will be faked. |
AV_OPT_FLAG_IMPLICIT_KEY | Accept to parse a value without a key; the key will then be returned as NULL. |
Definition at line 36 of file buffersrc.h.
unsigned av_buffersrc_get_nb_failed_requests | ( | AVFilterContext * | buffer_src | ) |
Get the number of failed requests.
A failed request is when the request_frame method is called while no frame is present in the buffer. The number is reset when a frame is added.
AVBufferSrcParameters* av_buffersrc_parameters_alloc | ( | void | ) |
Allocate a new AVBufferSrcParameters instance.
It should be freed by the caller with av_free().
int av_buffersrc_parameters_set | ( | AVFilterContext * | ctx, |
AVBufferSrcParameters * | param | ||
) |
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.
ctx | an instance of the buffersrc or abuffersrc filter |
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. |
av_warn_unused_result int av_buffersrc_write_frame | ( | AVFilterContext * | ctx, |
const AVFrame * | frame | ||
) |
Add a frame to the buffer source.
ctx | an instance of the buffersrc filter |
frame | frame to be added. If the frame is reference counted, this function will make a new reference to it. Otherwise the frame data will be copied. |
This function is equivalent to av_buffersrc_add_frame_flags() with the AV_BUFFERSRC_FLAG_KEEP_REF flag.
av_warn_unused_result int av_buffersrc_add_frame | ( | AVFilterContext * | ctx, |
AVFrame * | frame | ||
) |
Add a frame to the buffer source.
ctx | an instance of the buffersrc filter |
frame | frame to be added. If the frame is reference counted, this function will take ownership of the reference(s) and reset the frame. Otherwise the frame data will be copied. If this function returns an error, the input frame is not touched. |
This function is equivalent to av_buffersrc_add_frame_flags() without the AV_BUFFERSRC_FLAG_KEEP_REF flag.
Referenced by main().
av_warn_unused_result int av_buffersrc_add_frame_flags | ( | AVFilterContext * | buffer_src, |
AVFrame * | frame, | ||
int | flags | ||
) |
Add a frame to the buffer source.
By default, if the frame is reference-counted, this function will take ownership of the reference(s) and reset the frame. This can be controlled using the flags.
If this function returns an error, the input frame is not touched.
buffer_src | pointer to a buffer source context |
frame | a frame, or NULL to mark EOF |
flags | a combination of AV_BUFFERSRC_FLAG_* |
Referenced by filter_encode_write_frame(), and main().
int av_buffersrc_close | ( | AVFilterContext * | ctx, |
int64_t | pts, | ||
unsigned | flags | ||
) |
Close the buffer source after EOF.
This is similar to passing NULL to av_buffersrc_add_frame_flags() except it takes the timestamp of the EOF, i.e. the timestamp of the end of the last frame.