#include <stdio.h>
#include <stdlib.h>
-#include <math.h>
#include <string.h>
//#define DEBUG_PATTERN_GUIDANCE
{
// Put the current image into the image cache, keyed on position
size_t image_size = (*width * *height) << 1;
- mlt_position pos = mlt_frame_get_position( frame );
+ mlt_position pos = mlt_filter_get_position( filter, frame );
uint8_t *image_copy = mlt_pool_alloc( image_size );
memcpy( image_copy, *image, image_size );
char key[20];
- sprintf( key, "%d", pos );
+ sprintf( key, MLT_POSITION_FMT, pos );
mlt_properties_set_data( cx->image_cache, key, image_copy, image_size, (mlt_destructor)mlt_pool_release, NULL );
// Only if we have enough frame images cached
{
pos -= cx->cycle + 1;
// Get the current frame image
- sprintf( key, "%d", pos );
+ sprintf( key, MLT_POSITION_FMT, pos );
cx->fcrp = mlt_properties_get_data( cx->image_cache, key, NULL );
if (!cx->fcrp) return error;
// Do first and last lines.
uint8_t *final = mlt_pool_alloc( image_size );
cx->finalp = final;
- mlt_properties_set_data( frame_properties, "image", final, image_size, (mlt_destructor)mlt_pool_release, NULL );
+ mlt_frame_set_image( frame, final, image_size, mlt_pool_release );
dstpn = cx->dstp + cx->dpitch;
for ( cx->x = 0; cx->x < cx->w; cx->x++ )
{
final:
// Flush frame at tail of period from the cache
- sprintf( key, "%d", pos - 1 );
+ sprintf( key, MLT_POSITION_FMT, pos - 1 );
mlt_properties_set_data( cx->image_cache, key, NULL, 0, NULL, NULL );
}
else
}
else if ( error == 0 && *format == mlt_image_yuv420p )
{
- fprintf(stderr,"%s: %d pos %d\n", __FUNCTION__, *width * *height * 3/2, mlt_frame_get_position(frame) );
+ fprintf(stderr,"%s: %d pos " MLT_POSITION_FMT "\n", __FUNCTION__, *width * *height * 3/2, mlt_frame_get_position(frame) );
}
return error;