1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-07-16 22:42:38 +02:00

swscale/internal: expose sws_init_single_context() internally

Used by the graph API swscale wrapper, for now.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
This commit is contained in:
Niklas Haas
2024-10-10 23:24:31 +02:00
parent fb16964009
commit c461dcf291
2 changed files with 7 additions and 4 deletions

View File

@ -958,6 +958,9 @@ extern const int32_t ff_yuv2rgb_coeffs[11][4];
extern const AVClass ff_sws_context_class; extern const AVClass ff_sws_context_class;
int ff_sws_init_single_context(SwsContext *sws, SwsFilter *srcFilter,
SwsFilter *dstFilter);
/** /**
* Set c->convert_unscaled to an unscaled converter if one exists for the * Set c->convert_unscaled to an unscaled converter if one exists for the
* specific source and destination formats, bit depths, flags, etc. * specific source and destination formats, bit depths, flags, etc.

View File

@ -1312,8 +1312,8 @@ static enum AVPixelFormat alphaless_fmt(enum AVPixelFormat fmt)
} }
} }
static av_cold int sws_init_single_context(SwsContext *sws, SwsFilter *srcFilter, av_cold int ff_sws_init_single_context(SwsContext *sws, SwsFilter *srcFilter,
SwsFilter *dstFilter) SwsFilter *dstFilter)
{ {
int i; int i;
int usesVFilter, usesHFilter; int usesVFilter, usesHFilter;
@ -2064,7 +2064,7 @@ static int context_init_threaded(SwsContext *sws,
return ret; return ret;
slice->threads = 1; slice->threads = 1;
ret = sws_init_single_context(slice, src_filter, dst_filter); ret = ff_sws_init_single_context(slice, src_filter, dst_filter);
if (ret < 0) if (ret < 0)
return ret; return ret;
@ -2109,7 +2109,7 @@ av_cold int sws_init_context(SwsContext *sws, SwsFilter *srcFilter,
// threading disabled in this build, init as single-threaded // threading disabled in this build, init as single-threaded
} }
return sws_init_single_context(sws, srcFilter, dstFilter); return ff_sws_init_single_context(sws, srcFilter, dstFilter);
} }
SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat, SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat,