Revision 0810a584

View differences:

libswscale/swscale.h
44 44
#define LIBSWSCALE_IDENT        "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION)
45 45

  
46 46
/**
47
 * Those FF_API_* defines are not part of public API.
48
 * They may change, break or disappear at any time.
49
 */
50
#ifndef FF_API_SWS_GETCONTEXT
51
#define FF_API_SWS_GETCONTEXT  (LIBSWSCALE_VERSION_MAJOR < 1)
52
#endif
53

  
54
/**
47 55
 * Returns the LIBSWSCALE_VERSION_INT constant.
48 56
 */
49 57
unsigned swscale_version(void);
......
164 172
 */
165 173
void sws_freeContext(struct SwsContext *swsContext);
166 174

  
175
#if FF_API_SWS_GETCONTEXT
167 176
/**
168 177
 * Allocates and returns a SwsContext. You need it to perform
169 178
 * scaling/conversion operations using sws_scale().
......
178 187
 * @return a pointer to an allocated context, or NULL in case of error
179 188
 * @deprecated use sws_alloc_context() and sws_init_context()
180 189
 */
190
attribute_deprecated
181 191
struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
182 192
                                  int dstW, int dstH, enum PixelFormat dstFormat,
183 193
                                  int flags, SwsFilter *srcFilter,
184 194
                                  SwsFilter *dstFilter, const double *param);
195
#endif
185 196

  
186 197
/**
187 198
 * Scales the image slice in srcSlice and puts the resulting scaled
libswscale/utils.c
1146 1146
    return -1;
1147 1147
}
1148 1148

  
1149
#if FF_API_SWS_GETCONTEXT
1149 1150
SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
1150 1151
                           int dstW, int dstH, enum PixelFormat dstFormat, int flags,
1151 1152
                           SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param)
......
1181 1182

  
1182 1183
    return c;
1183 1184
}
1185
#endif
1184 1186

  
1185 1187
SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
1186 1188
                                float lumaSharpen, float chromaSharpen,
......
1564 1566
    }
1565 1567

  
1566 1568
    if (!context) {
1567
        return sws_getContext(srcW, srcH, srcFormat,
1568
                              dstW, dstH, dstFormat, flags,
1569
                              srcFilter, dstFilter, param);
1569
        if (!(context = sws_alloc_context()))
1570
            return NULL;
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 1583
    return context;
1572 1584
}

Also available in: Unified diff