Constness changes
[melted] / src / modules / avformat / factory.c
index 2b6d234..54adf93 100644 (file)
@@ -28,6 +28,7 @@ extern mlt_consumer consumer_avformat_init( mlt_profile profile, char *file );
 extern mlt_filter filter_avcolour_space_init( void *arg );
 extern mlt_filter filter_avdeinterlace_init( void *arg );
 extern mlt_filter filter_avresample_init( char *arg );
+extern mlt_filter filter_swscale_init( mlt_profile profile, char *arg );
 extern mlt_producer producer_avformat_init( mlt_profile profile, char *file );
 
 // ffmpeg Header files
@@ -89,35 +90,41 @@ static void avformat_init( )
                pthread_mutex_init( &avformat_mutex, NULL );
                av_register_all( );
                mlt_factory_register_for_clean_up( NULL, avformat_destroy );
-               av_log_set_level( -1 );
+               av_log_set_level( mlt_log_get_level() );
        }
 }
 
 static void *create_service( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
 {
        avformat_init( );
+#ifdef CODECS
        if ( !strcmp( id, "avformat" ) )
        {
                if ( type == producer_type )
                        return producer_avformat_init( profile, arg );
                else if ( type == consumer_type )
-                       return consumer_avformat_init( profile, arg );          
+                       return consumer_avformat_init( profile, arg );
        }
+#endif
+#ifdef FILTERS
        if ( !strcmp( id, "avcolour_space" ) )
                return filter_avcolour_space_init( arg );
-#ifdef USE_MMX
        if ( !strcmp( id, "avdeinterlace" ) )
                return filter_avdeinterlace_init( arg );
-#endif
        if ( !strcmp( id, "avresample" ) )
                return filter_avresample_init( arg );
+#ifdef SWSCALE
+       if ( !strcmp( id, "swscale" ) )
+               return filter_swscale_init( profile, arg );
+#endif
+#endif
        return NULL;
 }
 
 static mlt_properties avformat_metadata( mlt_service_type type, const char *id, void *data )
 {
        char file[ PATH_MAX ];
-       char *service_type = NULL;
+       const char *service_type = NULL;
        switch ( type )
        {
                case consumer_type:
@@ -141,12 +148,18 @@ static mlt_properties avformat_metadata( mlt_service_type type, const char *id,
 
 MLT_REPOSITORY
 {
+#ifdef CODECS
        MLT_REGISTER( consumer_type, "avformat", create_service );
        MLT_REGISTER( producer_type, "avformat", create_service );
+       MLT_REGISTER_METADATA( producer_type, "avformat", avformat_metadata, NULL );
+#endif
+#ifdef FILTERS
        MLT_REGISTER( filter_type, "avcolour_space", create_service );
        MLT_REGISTER( filter_type, "avcolor_space", create_service );
        MLT_REGISTER( filter_type, "avdeinterlace", create_service );
        MLT_REGISTER( filter_type, "avresample", create_service );
-       
-       MLT_REGISTER_METADATA( producer_type, "avformat", avformat_metadata, NULL );
+#ifdef SWSCALE
+       MLT_REGISTER( filter_type, "swscale", create_service );
+#endif
+#endif
 }