static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
{
int error = 0;
+ mlt_profile profile = mlt_frame_pop_service( frame );
// Get the properties from the frame
mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
// Correct Width/height if necessary
if ( *width == 0 || *height == 0 )
{
- *width = mlt_properties_get_int( properties, "normalised_width" );
- *height = mlt_properties_get_int( properties, "normalised_height" );
+ *width = profile->width;
+ *height = profile->height;
}
int left = mlt_properties_get_int( properties, "crop.left" );
if ( mlt_properties_get_int( MLT_FILTER_PROPERTIES( filter ), "active" ) )
{
// Push the get_image method on to the stack
+ mlt_frame_push_service( frame, mlt_service_profile( MLT_FILTER_SERVICE( filter ) ) );
mlt_frame_push_get_image( frame, filter_get_image );
}
else
#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
+#include <framework/mlt_profile.h>
#include <stdio.h>
#include <stdlib.h>
static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
{
- // Get the frame properties
- mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
-
// Pop the top of stack now
mlt_filter filter = mlt_frame_pop_service( frame );
{
// Get the filter properties
mlt_properties properties = MLT_FILTER_PROPERTIES( filter );
-
- // Obtain the normalised width and height from the frame
- int normalised_width = mlt_properties_get_int( frame_properties, "normalised_width" );
- int normalised_height = mlt_properties_get_int( frame_properties, "normalised_height" );
+ mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( filter ) );
// Structures for geometry
struct geometry_s result;
float position = mlt_filter_get_progress( filter, frame );
// Now parse the geometries
- geometry_parse( &start, NULL, mlt_properties_get( properties, "start" ), normalised_width, normalised_height );
- geometry_parse( &end, &start, mlt_properties_get( properties, "end" ), normalised_width, normalised_height );
+ geometry_parse( &start, NULL, mlt_properties_get( properties, "start" ), profile->width, profile->height );
+ geometry_parse( &end, &start, mlt_properties_get( properties, "end" ), profile->width, profile->height );
// Do the calculation
geometry_calculate( &result, &start, &end, position, *width, *height );
#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <framework/mlt_log.h>
+#include <framework/mlt_profile.h>
#include <stdio.h>
#include <string.h>
// Correct Width/height if necessary
if ( *width == 0 || *height == 0 )
{
- *width = mlt_properties_get_int( properties, "normalised_width" );
- *height = mlt_properties_get_int( properties, "normalised_height" );
+ mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( filter ) );
+ *width = profile->width;
+ *height = profile->height;
}
// There can be problems with small images - avoid them (by hacking - gah)
// Pop the top of stack now
mlt_filter filter = mlt_frame_pop_service( frame );
+ mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( filter ) );
// Retrieve the aspect ratio
double aspect_ratio = mlt_deque_pop_back_double( MLT_FRAME_IMAGE_STACK( frame ) );
// Correct Width/height if necessary
if ( *width == 0 || *height == 0 )
{
- *width = mlt_properties_get_int( properties, "normalised_width" );
- *height = mlt_properties_get_int( properties, "normalised_height" );
+ *width = profile->width;
+ *height = profile->height;
}
// Assign requested width/height from our subordinate
if ( mlt_properties_get_int( properties, "distort" ) == 0 )
{
// Normalise the input and out display aspect
- int normalised_width = mlt_properties_get_int( properties, "normalised_width" );
- int normalised_height = mlt_properties_get_int( properties, "normalised_height" );
+ int normalised_width = profile->width;
+ int normalised_height = profile->height;
int real_width = mlt_properties_get_int( properties, "real_width" );
int real_height = mlt_properties_get_int( properties, "real_height" );
if ( real_width == 0 )
if ( mlt_frame_get_aspect_ratio( frame ) == 0 )
mlt_properties_set_double( a_props, "aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
- mlt_properties_set_int( b_props, "normalised_width", mlt_properties_get_int( a_props, "normalised_width" ) );
- mlt_properties_set_int( b_props, "normalised_height", mlt_properties_get_int( a_props, "normalised_height" ) );
-
if ( mlt_properties_get_int( properties, "distort" ) )
{
mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( composite ), "distort", 1 );
mlt_geometry start = mlt_properties_get_data( properties, "geometries", NULL );
// Obtain the normalised width and height from the a_frame
- int normalised_width = mlt_properties_get_int( a_props, "normalised_width" );
- int normalised_height = mlt_properties_get_int( a_props, "normalised_height" );
+ mlt_profile profile = mlt_service_profile( MLT_TRANSITION_SERVICE( self ) );
+ int normalised_width = profile->width;
+ int normalised_height = profile->height;
char *name = mlt_properties_get( properties, "_unique_id" );
char key[ 256 ];
// Get the image from the b frame
uint8_t *image_b = NULL;
- int width_b = *width > 0 ? *width : mlt_properties_get_int( a_props, "normalised_width" );
- int height_b = *height > 0 ? *height : mlt_properties_get_int( a_props, "normalised_height" );
+ mlt_profile profile = mlt_service_profile( MLT_TRANSITION_SERVICE( self ) );
+ int width_b = *width > 0 ? *width : profile->width;
+ int height_b = *height > 0 ? *height : profile->height;
// Vars for alphas
uint8_t *alpha_a = NULL;
mlt_service_unlock( MLT_FILTER_SERVICE( filter ) );
mlt_transition_process( transition, a_frame, this );
- if (mlt_properties_get_int( properties, "use_normalised" ))
+ if ( mlt_properties_get_int( properties, "use_normalised" ) )
{
- // Use the normalised width & height from the a_frame
- *width = mlt_properties_get_int( MLT_FRAME_PROPERTIES( a_frame ), "normalised_width" );
- *height = mlt_properties_get_int( MLT_FRAME_PROPERTIES( a_frame ), "normalised_height" );
+ // Use the normalised width & height
+ mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( filter ) );
+ *width = profile->width;
+ *height = profile->height;
}
mlt_frame_get_image( a_frame, image, format, width, height, writable );
}
// Obtain the normalised width and height from the a_frame
- int normalised_width = mlt_properties_get_int( a_props, "normalised_width" );
- int normalised_height = mlt_properties_get_int( a_props, "normalised_height" );
+ mlt_profile profile = mlt_service_profile( MLT_TRANSITION_SERVICE( transition ) );
+ int normalised_width = profile->width;
+ int normalised_height = profile->height;
double consumer_ar = mlt_properties_get_double( a_props, "consumer_aspect_ratio" );