]> git.sesse.net Git - mlt/blobdiff - src/modules/core/producer_noise.c
remove invalid metadata item for pango
[mlt] / src / modules / core / producer_noise.c
index 996721d572120df5fec26df276dd7c20994ee37b..655ff23caec45121501f4e3a5b28b40b893f04d0 100644 (file)
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "producer_noise.h"
+#include <framework/mlt_producer.h>
 #include <framework/mlt_frame.h>
 #include <framework/mlt_pool.h>
 
@@ -47,10 +47,10 @@ static void producer_close( mlt_producer this );
 /** Initialise.
 */
 
-mlt_producer producer_noise_init( void *arg )
+mlt_producer producer_noise_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        // Create a new producer object
-       mlt_producer this = mlt_producer_new( );
+       mlt_producer this = mlt_producer_new( profile );
 
        // Initialise the producer
        if ( this != NULL )
@@ -65,9 +65,6 @@ mlt_producer producer_noise_init( void *arg )
 
 static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
 {
-       // Obtain properties of frame
-       mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
-
        // Calculate the size of the image
        int size = *width * *height * 2;
 
@@ -78,9 +75,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
        *buffer = mlt_pool_alloc( size );
 
        // Update the frame
-       mlt_properties_set_data( properties, "image", *buffer, size, mlt_pool_release, NULL );
-       mlt_properties_set_int( properties, "width", *width );
-       mlt_properties_set_int( properties, "height", *height );
+       mlt_frame_set_image( frame, *buffer, size, mlt_pool_release );
 
        // Before we write to the image, make sure we have one
        if ( *buffer != NULL )
@@ -105,9 +100,6 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
 
 static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
 {
-       // Get the frame properties
-       mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
-
        int size = 0;
 
        // Correct the returns if necessary
@@ -130,7 +122,7 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
        }
 
        // Set the buffer for destruction
-       mlt_properties_set_data( properties, "audio", *buffer, size, ( mlt_destructor )mlt_pool_release, NULL );
+       mlt_frame_set_audio( frame, *buffer, *format, size, mlt_pool_release );
 
        return 0;
 }
@@ -138,7 +130,7 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
 static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index )
 {
        // Generate a frame
-       *frame = mlt_frame_init( );
+       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( this ) );
 
        // Check that we created a frame and initialise it
        if ( *frame != NULL )
@@ -147,7 +139,7 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index
                mlt_properties properties = MLT_FRAME_PROPERTIES( *frame );
 
                // Aspect ratio is whatever it needs to be
-               mlt_properties_set_double( properties, "aspect_ratio", 0 );
+               mlt_properties_set_double( properties, "aspect_ratio", mlt_properties_get_double( MLT_PRODUCER_PROPERTIES( this ), "aspect_ratio" ) );
 
                // Set producer-specific frame properties
                mlt_properties_set_int( properties, "progressive", 1 );