|
FFmpeg
|
#include <stdbool.h>#include "libavutil/slicethread.h"#include "libavutil/buffer.h"#include "swscale.h"#include "format.h"Go to the source code of this file.
Data Structures | |
| struct | SwsPassBuffer |
| Represents an output buffer for a filter pass. More... | |
| struct | SwsPass |
| Represents a single filter pass in the scaling graph. More... | |
| struct | SwsGraph |
| Filter graph, which represents a 'baked' pixel format conversion. More... | |
Typedefs | |
| typedef void(* | SwsPassFunc) (const SwsFrame *out, const SwsFrame *in, int y, int h, const SwsPass *pass) |
Output h lines of filtered data. More... | |
| typedef int(* | SwsPassSetup) (const SwsFrame *out, const SwsFrame *in, const SwsPass *pass) |
| Function to run from the main thread before processing any lines. More... | |
Functions | |
| static av_always_inline av_const int | ff_fmt_vshift (enum AVPixelFormat fmt, int plane) |
| int | ff_sws_pass_aligned_width (const SwsPass *pass, int width) |
Align width to the optimal size for pass. More... | |
| SwsGraph * | ff_sws_graph_alloc (void) |
| Allocate an empty SwsGraph. More... | |
| int | ff_sws_graph_init (SwsGraph *graph, SwsContext *ctx, const SwsFormat *dst, const SwsFormat *src, int field) |
| Initialize the filter graph for a given pair of formats. More... | |
| int | ff_sws_graph_create (SwsContext *ctx, const SwsFormat *dst, const SwsFormat *src, int field, SwsGraph **out_graph) |
| Allocate and initialize the filter graph. More... | |
| int | ff_sws_graph_add_pass (SwsGraph *graph, enum AVPixelFormat fmt, int width, int height, SwsPass *input, int align, SwsPassFunc run, SwsPassSetup setup, void *priv, void(*free)(void *priv), SwsPass **out_pass) |
| Allocate and add a new pass to the filter graph. More... | |
| void | ff_sws_graph_rollback (SwsGraph *graph, int since_idx) |
| Remove all passes added since the given index. More... | |
| void | ff_sws_graph_free (SwsGraph **graph) |
| Uninitialize any state associate with this filter graph and free it. More... | |
| void | ff_sws_graph_update_metadata (SwsGraph *graph, const SwsColor *color) |
| Update dynamic per-frame HDR metadata without requiring a full reinit. More... | |
| int | ff_sws_graph_reinit (SwsGraph *graph, SwsContext *ctx, const SwsFormat *dst, const SwsFormat *src, int field) |
| Wrapper around ff_sws_graph_init() that reuses the existing graph if the format is compatible. More... | |
| int | ff_sws_graph_run (SwsGraph *graph, const AVFrame *dst, const AVFrame *src) |
| Dispatch the filter graph on a single field of the given frames. More... | |
|
static |
Definition at line 32 of file graph.h.
Referenced by frame_shift(), and run_copy().
| int ff_sws_pass_aligned_width | ( | const SwsPass * | pass, |
| int | width | ||
| ) |
Align width to the optimal size for pass.
Definition at line 42 of file graph.c.
Referenced by sws_frame_setup().
| SwsGraph* ff_sws_graph_alloc | ( | void | ) |
Allocate an empty SwsGraph.
Returns NULL on failure.
Definition at line 749 of file graph.c.
Referenced by ff_sws_graph_create(), main(), and sws_frame_setup().
| int ff_sws_graph_init | ( | SwsGraph * | graph, |
| SwsContext * | ctx, | ||
| const SwsFormat * | dst, | ||
| const SwsFormat * | src, | ||
| int | field | ||
| ) |
Initialize the filter graph for a given pair of formats.
Returns 0 or a negative error.
Definition at line 765 of file graph.c.
Referenced by ff_sws_graph_create(), and ff_sws_graph_reinit().
| int ff_sws_graph_create | ( | SwsContext * | ctx, |
| const SwsFormat * | dst, | ||
| const SwsFormat * | src, | ||
| int | field, | ||
| SwsGraph ** | out_graph | ||
| ) |
| int ff_sws_graph_add_pass | ( | SwsGraph * | graph, |
| enum AVPixelFormat | fmt, | ||
| int | width, | ||
| int | height, | ||
| SwsPass * | input, | ||
| int | align, | ||
| SwsPassFunc | run, | ||
| SwsPassSetup | setup, | ||
| void * | priv, | ||
| void(*)(void *priv) | free, | ||
| SwsPass ** | out_pass | ||
| ) |
Allocate and add a new pass to the filter graph.
Takes over ownership of priv, even on failure.
| graph | Filter graph to add the pass to. |
| fmt | Pixel format of the output image. |
| w | Width of the output image. |
| h | Height of the output image. |
| input | Previous pass to read from, or NULL for the input image. |
| align | Minimum slice alignment for this pass, or 0 for no threading. |
| run | Filter function to run. |
| setup | Optional setup function to run from the main thread. |
| priv | Private state for the filter run function. |
| free | Function to free the private state. |
| out_pass | The newly added pass will be written here on success. |
Definition at line 127 of file graph.c.
Referenced by adapt_colors(), compile(), init_legacy_subpass(), and init_passes().
| void ff_sws_graph_rollback | ( | SwsGraph * | graph, |
| int | since_idx | ||
| ) |
Remove all passes added since the given index.
Definition at line 830 of file graph.c.
Referenced by ff_sws_compile_pass().
| void ff_sws_graph_free | ( | SwsGraph ** | graph | ) |
Uninitialize any state associate with this filter graph and free it.
Definition at line 837 of file graph.c.
Referenced by ff_sws_graph_create(), main(), sws_frame_setup(), and sws_freeContext().
Update dynamic per-frame HDR metadata without requiring a full reinit.
Definition at line 881 of file graph.c.
Referenced by ff_sws_graph_reinit().
| int ff_sws_graph_reinit | ( | SwsGraph * | graph, |
| SwsContext * | ctx, | ||
| const SwsFormat * | dst, | ||
| const SwsFormat * | src, | ||
| int | field | ||
| ) |
Wrapper around ff_sws_graph_init() that reuses the existing graph if the format is compatible.
This will also update dynamic per-frame metadata.
Must also be called after changing any of the fields in ctx, or else they will have no effect.
Definition at line 867 of file graph.c.
Referenced by sws_frame_setup().
1.8.17