]> git.sesse.net Git - mlt/blobdiff - src/modules/core/producer_noise.c
move binary modules to libdir - affects MLT_REPOSITORY
[mlt] / src / modules / core / producer_noise.c
index 8bc21c30e6ed422669bb4107234033fde857b2b5..825f5912493f3def1b37289bad2838681275c373 100644 (file)
@@ -3,22 +3,22 @@
  * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
  * Author: Charles Yates <charles.yates@pandora.be>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
  *
- * This program is distributed in the hope that it will be useful,
+ * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * 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>
 
@@ -32,7 +32,7 @@
 static unsigned int seed_x = 521288629;
 static unsigned int seed_y = 362436069;
 
-static unsigned inline int fast_rand( )
+static inline unsigned int fast_rand( )
 {
    static unsigned int a = 18000, b = 30903;
    seed_x = a * ( seed_x & 65535 ) + ( seed_x >> 16 );
@@ -47,7 +47,7 @@ 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( );
@@ -55,11 +55,6 @@ mlt_producer producer_noise_init( void *arg )
        // Initialise the producer
        if ( this != NULL )
        {
-               int is_pal = mlt_properties_get_int( MLT_PRODUCER_PROPERTIES( this ), "normalised_height" ) == 576;
-
-               // Synthetic - aspect ratio of 1
-               mlt_properties_set_double( MLT_PRODUCER_PROPERTIES( this ), "aspect_ratio", is_pal ? 59.0/54.0 : 10.0/11.0 );
-
                // Callback registration
                this->get_frame = producer_get_frame;
                this->close = ( mlt_destructor )producer_close;
@@ -143,7 +138,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 )
@@ -151,14 +146,8 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index
                // Obtain properties of frame
                mlt_properties properties = MLT_FRAME_PROPERTIES( *frame );
 
-               // Obtain properties of producer
-               mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( this );
-
-               // Determine if we're producing PAL or NTSC
-               int is_pal = mlt_properties_get_double( producer_props, "fps" ) == 25.0;
-
-               // Aspect ratio is 1?
-               mlt_properties_set_double( properties, "aspect_ratio", is_pal ? 59.0/54.0 : 10.0/11.0 );
+               // Aspect ratio is whatever it needs to be
+               mlt_properties_set_double( properties, "aspect_ratio", 0 );
 
                // Set producer-specific frame properties
                mlt_properties_set_int( properties, "progressive", 1 );