mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-02-04 14:30:55 +08:00
avfilter/drawutils: add ff_draw_init_from_link()
The overwhelming majority of references to ff_draw_init2() just set the colorspace properties from a filter link. This wrapper allows us to update all such referencen automatically.
This commit is contained in:
@@ -164,6 +164,12 @@ int ff_draw_init2(FFDrawContext *draw, enum AVPixelFormat format, enum AVColorSp
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ff_draw_init_from_link(FFDrawContext *draw, const AVFilterLink *link,
|
||||
unsigned flags)
|
||||
{
|
||||
return ff_draw_init2(draw, link->format, link->colorspace, link->color_range, flags);
|
||||
}
|
||||
|
||||
int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
|
||||
{
|
||||
return ff_draw_init2(draw, format, AVCOL_SPC_UNSPECIFIED, AVCOL_RANGE_UNSPECIFIED, flags);
|
||||
|
||||
@@ -80,6 +80,13 @@ typedef struct FFDrawColor {
|
||||
int ff_draw_init2(FFDrawContext *draw, enum AVPixelFormat format, enum AVColorSpace csp,
|
||||
enum AVColorRange range, unsigned flags);
|
||||
|
||||
/**
|
||||
* Init a draw context, taking the format, colorspace and range from the given
|
||||
* filter link.
|
||||
*/
|
||||
int ff_draw_init_from_link(FFDrawContext *draw, const AVFilterLink *link,
|
||||
unsigned flags);
|
||||
|
||||
/*
|
||||
* Legacy wrapper for ff_draw_init2.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user