mlt_properties_set_int( properties, "height", 576 );
mlt_properties_set_int( properties, "normalised_width", 720 );
mlt_properties_set_int( properties, "normalised_height", 576 );
+ mlt_properties_set_double( properties, "aspect_ratio", 72.0/79.0 );
}
else
{
mlt_properties_set_int( properties, "height", 480 );
mlt_properties_set_int( properties, "normalised_width", 720 );
mlt_properties_set_int( properties, "normalised_height", 480 );
+ mlt_properties_set_double( properties, "aspect_ratio", 128.0/117.0 );
}
- mlt_properties_set_double( properties, "aspect_ratio", 4.0 / 3.0 );
mlt_properties_set_data( properties, "audio", NULL, 0, NULL, NULL );
mlt_properties_set_data( properties, "alpha", NULL, 0, NULL, NULL );
// Construct stacks for frames and methods
- this->stack_get_image = mlt_deque_init( );
- this->stack_frame = mlt_deque_init( );
- this->stack_service = mlt_deque_init( );
+ this->stack_image = mlt_deque_init( );
+ this->stack_audio = mlt_deque_init( );
}
return this;
int mlt_frame_is_test_card( mlt_frame this )
{
- return mlt_properties_get_int( mlt_frame_properties( this ), "test_image" );
+ return mlt_deque_count( this->stack_image ) == 0 || mlt_properties_get_int( mlt_frame_properties( this ), "test_image" );
}
/** Check if we have a way to derive something than test audio.
int mlt_frame_push_get_image( mlt_frame this, mlt_get_image get_image )
{
- return mlt_deque_push_back( this->stack_get_image, get_image );
+ return mlt_deque_push_back( this->stack_image, get_image );
}
/** Pop a get_image callback.
mlt_get_image mlt_frame_pop_get_image( mlt_frame this )
{
- return mlt_deque_pop_back( this->stack_get_image );
+ return mlt_deque_pop_back( this->stack_image );
}
/** Push a frame.
int mlt_frame_push_frame( mlt_frame this, mlt_frame that )
{
- return mlt_deque_push_back( this->stack_frame, that );
+ return mlt_deque_push_back( this->stack_image, that );
}
/** Pop a frame.
mlt_frame mlt_frame_pop_frame( mlt_frame this )
{
- return mlt_deque_pop_back( this->stack_frame );
+ return mlt_deque_pop_back( this->stack_image );
}
/** Push a service.
int mlt_frame_push_service( mlt_frame this, void *that )
{
- return mlt_deque_push_back( this->stack_service, that );
+ return mlt_deque_push_back( this->stack_image, that );
}
/** Pop a service.
void *mlt_frame_pop_service( mlt_frame this )
{
- return mlt_deque_pop_back( this->stack_service );
+ return mlt_deque_pop_back( this->stack_image );
+}
+
+/** Push an audio item on the stack.
+*/
+
+int mlt_frame_push_audio( mlt_frame this, void *that )
+{
+ return mlt_deque_push_back( this->stack_audio, that );
+}
+
+/** Pop an audio item from the stack
+*/
+
+void *mlt_frame_pop_audio( mlt_frame this )
+{
+ return mlt_deque_pop_back( this->stack_audio );
}
int mlt_frame_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
{
mlt_properties test_properties = mlt_frame_properties( test_frame );
mlt_properties_set_double( test_properties, "consumer_aspect_ratio", mlt_properties_get_double( properties, "consumer_aspect_ratio" ) );
- mlt_properties_set_double( test_properties, "consumer_scale", mlt_properties_get_double( properties, "consumer_scale" ) );
mlt_properties_set( test_properties, "rescale.interp", "nearest" );
mlt_frame_get_image( test_frame, buffer, format, width, height, writable );
mlt_properties_set_data( properties, "test_card_frame", test_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
mlt_properties_set_int( properties, "width", *width );
mlt_properties_set_int( properties, "height", *height );
+ mlt_properties_set_int( properties, "aspect_ratio", 1 );
switch( *format )
{
{
if ( this != NULL )
{
- mlt_deque_close( this->stack_get_image );
- mlt_deque_close( this->stack_frame );
- mlt_deque_close( this->stack_service );
+ mlt_deque_close( this->stack_image );
+ mlt_deque_close( this->stack_audio );
mlt_properties_close( &this->parent );
free( this );
}
int active_width = 2 * iwidth;
int inactive_width = out_x_range - in_x_range;
+ uint8_t *p = NULL;
+ uint8_t *end = NULL;
// Loop for the entirety of our output height.
while ( iheight -- )
}
// We're in the input range for this row.
- memcpy( out_ptr, in_middle + in_line, active_width );
- out_ptr += active_width;
+ p = in_middle + in_line;
+ end = out_ptr + active_width;
+ while ( out_ptr != end )
+ {
+ *out_ptr ++ = *p ++;
+ *out_ptr ++ = *p ++;
+ }
// Fill the outer part with black
elements = inactive_width;
return samples;
}
-