mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-24 03:39:45 +00:00
Make the scale filter set in the input and output links only the
respective pixel formats effectively supported by libswscale. Originally committed as revision 21105 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
a7ac9c2f62
commit
27d8f6b660
@ -69,13 +69,27 @@ static av_cold void uninit(AVFilterContext *ctx)
|
|||||||
static int query_formats(AVFilterContext *ctx)
|
static int query_formats(AVFilterContext *ctx)
|
||||||
{
|
{
|
||||||
AVFilterFormats *formats;
|
AVFilterFormats *formats;
|
||||||
|
enum PixelFormat pix_fmt;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (ctx->inputs[0]) {
|
if (ctx->inputs[0]) {
|
||||||
formats = avfilter_all_colorspaces();
|
formats = NULL;
|
||||||
|
for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++)
|
||||||
|
if ( sws_isSupportedInput(pix_fmt)
|
||||||
|
&& (ret = avfilter_add_colorspace(&formats, pix_fmt)) < 0) {
|
||||||
|
avfilter_formats_unref(&formats);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
avfilter_formats_ref(formats, &ctx->inputs[0]->out_formats);
|
avfilter_formats_ref(formats, &ctx->inputs[0]->out_formats);
|
||||||
}
|
}
|
||||||
if (ctx->outputs[0]) {
|
if (ctx->outputs[0]) {
|
||||||
formats = avfilter_all_colorspaces();
|
formats = NULL;
|
||||||
|
for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++)
|
||||||
|
if ( sws_isSupportedOutput(pix_fmt)
|
||||||
|
&& (ret = avfilter_add_colorspace(&formats, pix_fmt)) < 0) {
|
||||||
|
avfilter_formats_unref(&formats);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
avfilter_formats_ref(formats, &ctx->outputs[0]->in_formats);
|
avfilter_formats_ref(formats, &ctx->outputs[0]->in_formats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user