#include <string.h>
#include <stdio.h>
#include <math.h>
+#include <limits.h>
typedef struct
{
producer_swfdec swfdec = mlt_frame_pop_service( frame );
mlt_service service = MLT_PRODUCER_SERVICE( &swfdec->parent );
mlt_profile profile = mlt_service_profile( service );
- mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
mlt_service_lock( service );
*format = mlt_image_rgb24a;
*buffer = mlt_pool_alloc( *width * ( *height + 1 ) * 4 );
- mlt_properties_set_data( properties, "image", *buffer, *width * ( *height + 1 ) * 4, (mlt_destructor) mlt_pool_release, NULL );
+ mlt_frame_set_image( frame, *buffer, *width * ( *height + 1 ) * 4, mlt_pool_release );
// Seek
- mlt_position pos = mlt_properties_get_position( properties, "swfdec.position" );
+ mlt_position pos = mlt_frame_original_position( frame );
if ( pos > swfdec->last_position )
{
gulong msec = 1000UL * ( pos - swfdec->last_position ) * profile->frame_rate_den / profile->frame_rate_num;
mlt_properties_set_int( properties, "test_image", 0 );
mlt_properties_set_int( properties, "width", swfdec->width );
mlt_properties_set_int( properties, "height", swfdec->height );
- mlt_properties_set_int( properties, "real_width", swfdec->width );
- mlt_properties_set_int( properties, "real_height", swfdec->height );
mlt_properties_set_int( properties, "progressive", 1 );
mlt_properties_set_double( properties, "aspect_ratio", 1.0 );
- mlt_properties_set_position( properties, "swfdec.position", mlt_producer_frame( producer ) );
// Push the get_image method on to the stack
mlt_frame_push_service( *frame, swfdec );
return producer;
}
+static mlt_properties metadata( mlt_service_type type, const char *id, void *data )
+{
+ char file[ PATH_MAX ];
+ snprintf( file, PATH_MAX, "%s/swfdec/%s", mlt_environment( "MLT_DATA" ), (char*) data );
+ return mlt_properties_parse_yaml( file );
+}
+
MLT_REPOSITORY
{
swfdec_init();
MLT_REGISTER( producer_type, "swfdec", producer_swfdec_init );
+ MLT_REGISTER_METADATA( producer_type, "swfdec", metadata, "producer_swfdec.yml" );
}