#include <stdlib.h>
#include <string.h>
-#if LIBAVUTIL_VERSION_INT < (50<<16)
-#define PIX_FMT_RGB32 PIX_FMT_RGBA32
-#define PIX_FMT_YUYV422 PIX_FMT_YUV422
-#endif
-
static inline int convert_mlt_to_av_cs( mlt_image_format format )
{
int value = 0;
case mlt_image_yuv420p:
value = PIX_FMT_YUV420P;
break;
- case mlt_image_none:
+ default:
fprintf( stderr, "Invalid format...\n" );
break;
}
if ( context )
{
// Perform the scaling
- sws_scale( context, input.data, input.linesize, 0, iheight, output.data, output.linesize);
+ sws_scale( context, (const uint8_t* const*) input.data, input.linesize, 0, iheight, output.data, output.linesize);
sws_freeContext( context );
// Now update the frame
avpicture_fill( &output, outbuf, avformat, owidth, oheight );
// Perform the scaling
- sws_scale( context, input.data, input.linesize, 0, iheight, output.data, output.linesize);
+ sws_scale( context, (const uint8_t* const*) input.data, input.linesize, 0, iheight, output.data, output.linesize);
sws_freeContext( context );
// Set it back on the frame
// Test to see if swscale accepts the arg as resolution
if ( arg )
{
- int width = (int) arg;
- struct SwsContext *context = sws_getContext( width, width, PIX_FMT_RGB32, 64, 64, PIX_FMT_RGB32, SWS_BILINEAR, NULL, NULL, NULL);
- if ( context )
- sws_freeContext( context );
- else
- return NULL;
- }
+ int *width = (int*) arg;
+ if ( *width > 0 )
+ {
+ struct SwsContext *context = sws_getContext( *width, *width, PIX_FMT_RGB32, 64, 64, PIX_FMT_RGB32, SWS_BILINEAR, NULL, NULL, NULL);
+ if ( context )
+ sws_freeContext( context );
+ else
+ return NULL;
+ } }
// Create a new scaler
mlt_filter filter = mlt_factory_filter( profile, "rescale", NULL );