summaryrefslogtreecommitdiff
path: root/libswscale/utils.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-09-28 22:23:58 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-09-28 22:23:58 +0000
commit0810a5846b22ec016bb1c8ee506aca127d629d62 (patch)
tree1247cc48b56f4198e3f7f3b576c57eb57f88f8ad /libswscale/utils.c
parent499287e0a58939db4db0eac90a14968354ead8ed (diff)
downloadffmpeg-0810a5846b22ec016bb1c8ee506aca127d629d62.tar.gz
Deprecate sws_getContext(), use sws_alloc_context() and
sws_init_context() instead. Originally committed as revision 32401 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
Diffstat (limited to 'libswscale/utils.c')
-rw-r--r--libswscale/utils.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index c817a4d997..23968b6e5e 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1146,6 +1146,7 @@ fail: //FIXME replace things by appropriate error codes
return -1;
}
+#if FF_API_SWS_GETCONTEXT
SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
int dstW, int dstH, enum PixelFormat dstFormat, int flags,
SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param)
@@ -1181,6 +1182,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
return c;
}
+#endif
SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
float lumaSharpen, float chromaSharpen,
@@ -1564,9 +1566,19 @@ struct SwsContext *sws_getCachedContext(struct SwsContext *context,
}
if (!context) {
- return sws_getContext(srcW, srcH, srcFormat,
- dstW, dstH, dstFormat, flags,
- srcFilter, dstFilter, param);
+ if (!(context = sws_alloc_context()))
+ return NULL;
+ context->srcW = srcW;
+ context->srcH = srcH;
+ context->srcFormat = srcFormat;
+ context->dstFormat = dstFormat;
+ context->flags = flags;
+ context->param[0] = param[0];
+ context->param[1] = param[1];
+ if (sws_init_context(context, srcFilter, dstFilter) < 0) {
+ sws_freeContext(context);
+ return NULL;
+ }
}
return context;
}