comparison libswscale/utils.c @ 32315:549b1ad3f777

Deprecate sws_getContext(), use sws_alloc_context() and sws_init_context() instead.
author stefano
date Tue, 28 Sep 2010 22:23:58 +0000
parents ecb8e52d4add
children 6f41498718cd
comparison
equal deleted inserted replaced
32314:ba0ba590dc81 32315:549b1ad3f777
1144 return 0; 1144 return 0;
1145 fail: //FIXME replace things by appropriate error codes 1145 fail: //FIXME replace things by appropriate error codes
1146 return -1; 1146 return -1;
1147 } 1147 }
1148 1148
1149 #if FF_API_SWS_GETCONTEXT
1149 SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, 1150 SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
1150 int dstW, int dstH, enum PixelFormat dstFormat, int flags, 1151 int dstW, int dstH, enum PixelFormat dstFormat, int flags,
1151 SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param) 1152 SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param)
1152 { 1153 {
1153 SwsContext *c; 1154 SwsContext *c;
1179 return NULL; 1180 return NULL;
1180 } 1181 }
1181 1182
1182 return c; 1183 return c;
1183 } 1184 }
1185 #endif
1184 1186
1185 SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, 1187 SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
1186 float lumaSharpen, float chromaSharpen, 1188 float lumaSharpen, float chromaSharpen,
1187 float chromaHShift, float chromaVShift, 1189 float chromaHShift, float chromaVShift,
1188 int verbose) 1190 int verbose)
1562 sws_freeContext(context); 1564 sws_freeContext(context);
1563 context = NULL; 1565 context = NULL;
1564 } 1566 }
1565 1567
1566 if (!context) { 1568 if (!context) {
1567 return sws_getContext(srcW, srcH, srcFormat, 1569 if (!(context = sws_alloc_context()))
1568 dstW, dstH, dstFormat, flags, 1570 return NULL;
1569 srcFilter, dstFilter, param); 1571 context->srcW = srcW;
1572 context->srcH = srcH;
1573 context->srcFormat = srcFormat;
1574 context->dstFormat = dstFormat;
1575 context->flags = flags;
1576 context->param[0] = param[0];
1577 context->param[1] = param[1];
1578 if (sws_init_context(context, srcFilter, dstFilter) < 0) {
1579 sws_freeContext(context);
1580 return NULL;
1581 }
1570 } 1582 }
1571 return context; 1583 return context;
1572 } 1584 }
1573 1585