|
FFmpeg
|
internal API functions More...
#include "libavutil/internal.h"#include "avfilter.h"#include "formats.h"#include "framepool.h"#include "framequeue.h"#include "thread.h"#include "version.h"#include "video.h"#include "libavcodec/avcodec.h"#include "libavcodec/internal.h"Go to the source code of this file.
Classes | |
| struct | AVFilterCommand |
| struct | AVFilterPad |
| A filter pad used for either input or output. More... | |
| struct | AVFilterGraphInternal |
| struct | AVFilterInternal |
Macros | |
| #define | FF_TPRINTF_START(ctx, func) ff_tlog(NULL, "%-16s: ", #func) |
| #define | AVFILTER_DEFINE_CLASS(fname) |
| #define | FF_INLINK_IDX(link) ((int)((link)->dstpad - (link)->dst->input_pads)) |
| Find the index of a link. More... | |
| #define | FF_OUTLINK_IDX(link) ((int)((link)->srcpad - (link)->src->output_pads)) |
| #define | FF_FILTER_FLAG_HWFRAME_AWARE (1 << 0) |
| The filter is aware of hardware frames, and any hardware frame context should not be automatically propagated through it. | |
Typedefs | |
| typedef struct AVFilterCommand | AVFilterCommand |
Functions | |
| void | ff_avfilter_graph_update_heap (AVFilterGraph *graph, AVFilterLink *link) |
| Update the position of a link in the age heap. | |
| int | ff_fmt_is_in (int fmt, const int *fmts) |
| Tell if an integer is contained in the provided -1-terminated list of integers. More... | |
| av_warn_unused_result int | ff_parse_pixel_format (enum AVPixelFormat *ret, const char *arg, void *log_ctx) |
| Parse a pixel format. More... | |
| av_warn_unused_result int | ff_parse_sample_rate (int *ret, const char *arg, void *log_ctx) |
| Parse a sample rate. More... | |
| av_warn_unused_result int | ff_parse_time_base (AVRational *ret, const char *arg, void *log_ctx) |
| Parse a time base. More... | |
| av_warn_unused_result int | ff_parse_sample_format (int *ret, const char *arg, void *log_ctx) |
| Parse a sample format name or a corresponding integer representation. More... | |
| av_warn_unused_result int | ff_parse_channel_layout (int64_t *ret, int *nret, const char *arg, void *log_ctx) |
| Parse a channel layout or a corresponding integer representation. More... | |
| void | ff_update_link_current_pts (AVFilterLink *link, int64_t pts) |
| void | ff_avfilter_link_set_in_status (AVFilterLink *link, int status, int64_t pts) |
| Set the status field of a link from the source filter. More... | |
| void | ff_avfilter_link_set_out_status (AVFilterLink *link, int status, int64_t pts) |
| Set the status field of a link from the destination filter. More... | |
| void | ff_command_queue_pop (AVFilterContext *filter) |
| char * | ff_get_ref_perms_string (char *buf, size_t buf_size, int perms) |
| void | ff_tlog_ref (void *ctx, AVFrame *ref, int end) |
| void | ff_tlog_link (void *ctx, AVFilterLink *link, int end) |
| int | ff_insert_pad (unsigned idx, unsigned *count, size_t padidx_off, AVFilterPad **pads, AVFilterLink ***links, AVFilterPad *newpad) |
| Insert a new pad. More... | |
| int | ff_poll_frame (AVFilterLink *link) |
| Poll a frame from the filter chain. More... | |
| int | ff_request_frame (AVFilterLink *link) |
| Request an input frame from the filter at the other end of the link. More... | |
| int | ff_filter_frame (AVFilterLink *link, AVFrame *frame) |
| Send a frame of data to the next filter. More... | |
| AVFilterContext * | ff_filter_alloc (const AVFilter *filter, const char *inst_name) |
| Allocate a new filter context and return it. More... | |
| int | ff_filter_activate (AVFilterContext *filter) |
| void | ff_filter_graph_remove_filter (AVFilterGraph *graph, AVFilterContext *filter) |
| Remove a filter from a graph;. | |
| int | ff_filter_graph_run_once (AVFilterGraph *graph) |
| Run one round of processing on a filter graph. | |
| int | ff_filter_get_nb_threads (AVFilterContext *ctx) |
| Get number of threads for current filter instance. More... | |
| int | ff_filter_init_hw_frames (AVFilterContext *avctx, AVFilterLink *link, int default_pool_size) |
| Perform any additional setup required for hardware frames. More... | |
internal API functions
| #define AVFILTER_DEFINE_CLASS | ( | fname | ) |
| #define FF_INLINK_IDX | ( | link | ) | ((int)((link)->dstpad - (link)->dst->input_pads)) |
Find the index of a link.
I.e. find i such that link == ctx->(in|out)puts[i]
| void ff_avfilter_link_set_in_status | ( | AVFilterLink * | link, |
| int | status, | ||
| int64_t | pts | ||
| ) |
Set the status field of a link from the source filter.
The pts should reflect the timestamp of the status change, in link time base and relative to the frames timeline. In particular, for AVERROR_EOF, it should reflect the end time of the last frame.
| void ff_avfilter_link_set_out_status | ( | AVFilterLink * | link, |
| int | status, | ||
| int64_t | pts | ||
| ) |
Set the status field of a link from the destination filter.
The pts should probably be left unset (AV_NOPTS_VALUE).
| AVFilterContext* ff_filter_alloc | ( | const AVFilter * | filter, |
| const char * | inst_name | ||
| ) |
Allocate a new filter context and return it.
| filter | what filter to create an instance of |
| inst_name | name to give to the new filter context |
| int ff_filter_frame | ( | AVFilterLink * | link, |
| AVFrame * | frame | ||
| ) |
Send a frame of data to the next filter.
| link | the output link over which the data is being sent |
| frame | a reference to the buffer of data being sent. The receiving filter will free this reference when it no longer needs it or pass it on to the next filter. |
| int ff_filter_get_nb_threads | ( | AVFilterContext * | ctx | ) |
Get number of threads for current filter instance.
This number is always same or less than graph->nb_threads.
| int ff_filter_init_hw_frames | ( | AVFilterContext * | avctx, |
| AVFilterLink * | link, | ||
| int | default_pool_size | ||
| ) |
Perform any additional setup required for hardware frames.
link->hw_frames_ctx must be set before calling this function. Inside link->hw_frames_ctx, the fields format, sw_format, width and height must be set. If dynamically allocated pools are not supported, then initial_pool_size must also be set, to the minimum hardware frame pool size necessary for the filter to work (taking into account any frames which need to stored for use in operations as appropriate). If default_pool_size is nonzero, then it will be used as the pool size if no other modification takes place (this can be used to preserve compatibility).
| int ff_fmt_is_in | ( | int | fmt, |
| const int * | fmts | ||
| ) |
Tell if an integer is contained in the provided -1-terminated list of integers.
This is useful for determining (for instance) if an AVPixelFormat is in an array of supported formats.
| fmt | provided format |
| fmts | -1-terminated list of formats |
| int ff_insert_pad | ( | unsigned | idx, |
| unsigned * | count, | ||
| size_t | padidx_off, | ||
| AVFilterPad ** | pads, | ||
| AVFilterLink *** | links, | ||
| AVFilterPad * | newpad | ||
| ) |
Insert a new pad.
| idx | Insertion point. Pad is inserted at the end if this point is beyond the end of the list of pads. |
| count | Pointer to the number of pads in the list |
| padidx_off | Offset within an AVFilterLink structure to the element to increment when inserting a new pad causes link numbering to change |
| pads | Pointer to the pointer to the beginning of the list of pads |
| links | Pointer to the pointer to the beginning of the list of links |
| newpad | The new pad to add. A copy is made when adding. |
| av_warn_unused_result int ff_parse_channel_layout | ( | int64_t * | ret, |
| int * | nret, | ||
| const char * | arg, | ||
| void * | log_ctx | ||
| ) |
Parse a channel layout or a corresponding integer representation.
| ret | 64bit integer pointer to where the value should be written. |
| nret | integer pointer to the number of channels; if not NULL, then unknown channel layouts are accepted |
| arg | string to parse |
| log_ctx | log context |
| av_warn_unused_result int ff_parse_pixel_format | ( | enum AVPixelFormat * | ret, |
| const char * | arg, | ||
| void * | log_ctx | ||
| ) |
Parse a pixel format.
| ret | pixel format pointer to where the value should be written |
| arg | string to parse |
| log_ctx | log context |
| av_warn_unused_result int ff_parse_sample_format | ( | int * | ret, |
| const char * | arg, | ||
| void * | log_ctx | ||
| ) |
Parse a sample format name or a corresponding integer representation.
| ret | integer pointer to where the value should be written |
| arg | string to parse |
| log_ctx | log context |
| av_warn_unused_result int ff_parse_sample_rate | ( | int * | ret, |
| const char * | arg, | ||
| void * | log_ctx | ||
| ) |
Parse a sample rate.
| ret | unsigned integer pointer to where the value should be written |
| arg | string to parse |
| log_ctx | log context |
| av_warn_unused_result int ff_parse_time_base | ( | AVRational * | ret, |
| const char * | arg, | ||
| void * | log_ctx | ||
| ) |
Parse a time base.
| ret | unsigned AVRational pointer to where the value should be written |
| arg | string to parse |
| log_ctx | log context |
| int ff_poll_frame | ( | AVFilterLink * | link | ) |
Poll a frame from the filter chain.
| link | the input link |
| int ff_request_frame | ( | AVFilterLink * | link | ) |
Request an input frame from the filter at the other end of the link.
This function must not be used by filters using the activate callback, use ff_link_set_frame_wanted() instead.
The input filter may pass the request on to its inputs, fulfill the request from an internal buffer or any other means specific to its function.
When the end of a stream is reached AVERROR_EOF is returned and no further frames are returned after that.
When a filter is unable to output a frame for example due to its sources being unable to do so or because it depends on external means pushing data into it then AVERROR(EAGAIN) is returned. It is important that a AVERROR(EAGAIN) return is returned all the way to the caller (generally eventually a user application) as this step may (but does not have to be) necessary to provide the input with the next frame.
If a request is successful then some progress has been made towards providing a frame on the link (through ff_filter_frame()). A filter that needs several frames to produce one is allowed to return success if one more frame has been processed but no output has been produced yet. A filter is also allowed to simply forward a success return value.
| link | the input link |
1.8.12