FFmpeg
Data Structures | Typedefs | Functions
graph.h File Reference
#include "libavutil/slicethread.h"
#include "swscale.h"
#include "utils.h"

Go to the source code of this file.

Data Structures

struct  SwsImg
 Represents a view into a single field of frame data. 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(* sws_filter_run_t) (const SwsImg *out, const SwsImg *in, int y, int h, const SwsPass *pass)
 Output h lines of filtered data. More...
 

Functions

int sws_graph_create (SwsContext *ctx, const SwsFormat *dst, const SwsFormat *src, int field, SwsGraph **out_graph)
 Allocate and initialize the filter graph. More...
 
void sws_graph_free (SwsGraph **graph)
 Uninitialize any state associate with this filter graph and free it. More...
 
void sws_graph_update_metadata (SwsGraph *graph, const SwsColor *color)
 Update dynamic per-frame HDR metadata without requiring a full reinit. More...
 
int sws_graph_reinit (SwsContext *ctx, const SwsFormat *dst, const SwsFormat *src, int field, SwsGraph **graph)
 Wrapper around sws_graph_create() that reuses the existing graph if the format is compatible. More...
 
void sws_graph_run (SwsGraph *graph, uint8_t *const out_data[4], const int out_linesize[4], const uint8_t *const in_data[4], const int in_linesize[4])
 Dispatch the filter graph on a single field. More...
 

Typedef Documentation

◆ sws_filter_run_t

typedef void(* sws_filter_run_t) (const SwsImg *out, const SwsImg *in, int y, int h, const SwsPass *pass)

Output h lines of filtered data.

out and in point to the start of the image buffer for this pass.

Definition at line 44 of file graph.h.

Function Documentation

◆ sws_graph_create()

int sws_graph_create ( SwsContext ctx,
const SwsFormat dst,
const SwsFormat src,
int  field,
SwsGraph **  out_graph 
)

Allocate and initialize the filter graph.

Returns 0 or a negative error.

Definition at line 610 of file graph.c.

Referenced by sws_graph_reinit().

◆ sws_graph_free()

void sws_graph_free ( SwsGraph **  graph)

Uninitialize any state associate with this filter graph and free it.

Definition at line 648 of file graph.c.

Referenced by sws_frame_setup(), sws_freeContext(), sws_graph_create(), and sws_graph_reinit().

◆ sws_graph_update_metadata()

void sws_graph_update_metadata ( SwsGraph graph,
const SwsColor color 
)

Update dynamic per-frame HDR metadata without requiring a full reinit.

Definition at line 703 of file graph.c.

Referenced by sws_graph_reinit().

◆ sws_graph_reinit()

int sws_graph_reinit ( SwsContext ctx,
const SwsFormat dst,
const SwsFormat src,
int  field,
SwsGraph **  graph 
)

Wrapper around sws_graph_create() that reuses the existing graph if the format is compatible.

This will also update dynamic per-frame metadata. Must be called after changing any of the fields in ctx, or else they will have no effect.

Definition at line 687 of file graph.c.

Referenced by sws_frame_setup().

◆ sws_graph_run()

void sws_graph_run ( SwsGraph graph,
uint8_t *const  out_data[4],
const int  out_linesize[4],
const uint8_t *const  in_data[4],
const int  in_linesize[4] 
)

Dispatch the filter graph on a single field.

Internally threaded.

Definition at line 711 of file graph.c.

Referenced by sws_scale_frame().