Thread: [Mlt-devel] SF.net SVN: mlt:[1182] trunk/mlt/src/modules
Brought to you by:
ddennedy,
lilo_booter
From: <j-...@us...> - 2008-09-22 20:40:01
|
Revision: 1182 http://mlt.svn.sourceforge.net/mlt/?rev=1182&view=rev Author: j-b-m Date: 2008-09-22 20:39:51 +0000 (Mon, 22 Sep 2008) Log Message: ----------- producer_pixbuf.c, qimage_wrapper.c: Add "force_reload" option to force image reloading in the image producers Modified Paths: -------------- trunk/mlt/src/modules/gtk2/producer_pixbuf.c trunk/mlt/src/modules/qimage/qimage_wrapper.cpp Modified: trunk/mlt/src/modules/gtk2/producer_pixbuf.c =================================================================== --- trunk/mlt/src/modules/gtk2/producer_pixbuf.c 2008-09-12 16:51:29 UTC (rev 1181) +++ trunk/mlt/src/modules/gtk2/producer_pixbuf.c 2008-09-22 20:39:51 UTC (rev 1182) @@ -98,6 +98,14 @@ // Obtain properties of producer mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer ); + // Check if user wants us to reload the image + if ( mlt_properties_get_int( producer_props, "force_reload" ) ) + { + pixbuf = NULL; + this->image = NULL; + mlt_properties_set_int( producer_props, "force_reload", 0 ); + } + // Obtain the cache flag and structure int use_cache = mlt_properties_get_int( producer_props, "cache" ); mlt_properties cache = mlt_properties_get_data( producer_props, "_cache", NULL ); Modified: trunk/mlt/src/modules/qimage/qimage_wrapper.cpp =================================================================== --- trunk/mlt/src/modules/qimage/qimage_wrapper.cpp 2008-09-12 16:51:29 UTC (rev 1181) +++ trunk/mlt/src/modules/qimage/qimage_wrapper.cpp 2008-09-22 20:39:51 UTC (rev 1182) @@ -92,6 +92,14 @@ // Obtain properties of producer mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer ); + // Check if user wants us to reload the image + if ( mlt_properties_get_int( producer_props, "force_reload" ) ) + { + qimage = NULL; + self->current_image = NULL; + mlt_properties_set_int( producer_props, "force_reload", 0 ); + } + // Obtain the cache flag and structure int use_cache = mlt_properties_get_int( producer_props, "cache" ); mlt_properties cache = ( mlt_properties )mlt_properties_get_data( producer_props, "_cache", NULL ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dde...@us...> - 2008-12-02 08:03:57
|
Revision: 1247 http://mlt.svn.sourceforge.net/mlt/?rev=1247&view=rev Author: ddennedy Date: 2008-12-02 08:03:53 +0000 (Tue, 02 Dec 2008) Log Message: ----------- producer_pixbuf.c, producer_qimage.c, producer_sdl_image.c: bugfix (kdenlive-422) not validating input file for image producers. Modified Paths: -------------- trunk/mlt/src/modules/gtk2/producer_pixbuf.c trunk/mlt/src/modules/qimage/producer_qimage.c trunk/mlt/src/modules/sdl/producer_sdl_image.c Modified: trunk/mlt/src/modules/gtk2/producer_pixbuf.c =================================================================== --- trunk/mlt/src/modules/gtk2/producer_pixbuf.c 2008-12-02 07:59:53 UTC (rev 1246) +++ trunk/mlt/src/modules/gtk2/producer_pixbuf.c 2008-12-02 08:03:53 UTC (rev 1247) @@ -51,6 +51,8 @@ uint8_t *alpha; }; +static void load_filenames( producer_pixbuf this, mlt_properties producer_properties ); +static void refresh_image( mlt_frame frame, int width, int height ); static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int index ); static void producer_close( mlt_producer parent ); @@ -73,13 +75,114 @@ mlt_properties_set_int( properties, "ttl", 25 ); mlt_properties_set_int( properties, "aspect_ratio", 1 ); mlt_properties_set_int( properties, "progressive", 1 ); - + + // Validate the resource + if ( filename ) + load_filenames( this, properties ); + if ( this->count ) + { + mlt_frame frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) ); + if ( frame ) + { + mlt_properties properties = MLT_FRAME_PROPERTIES( frame ); + mlt_properties_set_data( properties, "producer_pixbuf", this, 0, NULL, NULL ); + mlt_frame_set_position( frame, mlt_producer_position( producer ) ); + mlt_properties_set_position( properties, "pixbuf_position", mlt_producer_position( producer ) ); + refresh_image( frame, 0, 0 ); + mlt_frame_close( frame ); + } + } + if ( this->width == 0 ) + { + producer_close( producer ); + producer = NULL; + } return producer; } free( this ); return NULL; } +static void load_filenames( producer_pixbuf this, mlt_properties producer_properties ) +{ + char *filename = mlt_properties_get( producer_properties, "resource" ); + this->filenames = mlt_properties_new( ); + + // Read xml string + if ( strstr( filename, "<svg" ) ) + { + // Generate a temporary file for the svg + char fullname[ 1024 ] = "/tmp/mlt.XXXXXX"; + int fd = mkstemp( fullname ); + + if ( fd > -1 ) + { + // Write the svg into the temp file + ssize_t remaining_bytes; + char *xml = filename; + + // Strip leading crap + while ( xml[0] != '<' ) + xml++; + + remaining_bytes = strlen( xml ); + while ( remaining_bytes > 0 ) + remaining_bytes -= write( fd, xml + strlen( xml ) - remaining_bytes, remaining_bytes ); + close( fd ); + + mlt_properties_set( this->filenames, "0", fullname ); + + // Teehe - when the producer closes, delete the temp file and the space allo + mlt_properties_set_data( producer_properties, "__temporary_file__", fullname, 0, ( mlt_destructor )unlink, NULL ); + } + } + // Obtain filenames + else if ( strchr( filename, '%' ) != NULL ) + { + // handle picture sequences + int i = mlt_properties_get_int( producer_properties, "begin" ); + int gap = 0; + char full[1024]; + int keyvalue = 0; + char key[ 50 ]; + + while ( gap < 100 ) + { + struct stat buf; + snprintf( full, 1023, filename, i ++ ); + if ( stat( full, &buf ) == 0 ) + { + sprintf( key, "%d", keyvalue ++ ); + mlt_properties_set( this->filenames, key, full ); + gap = 0; + } + else + { + gap ++; + } + } + } + else if ( strstr( filename, "/.all." ) != NULL ) + { + char wildcard[ 1024 ]; + char *dir_name = strdup( filename ); + char *extension = strrchr( dir_name, '.' ); + + *( strstr( dir_name, "/.all." ) + 1 ) = '\0'; + sprintf( wildcard, "*%s", extension ); + + mlt_properties_dir_list( this->filenames, dir_name, wildcard, 1 ); + + free( dir_name ); + } + else + { + mlt_properties_set( this->filenames, "0", filename ); + } + + this->count = mlt_properties_count( this->filenames ); +} + static void refresh_image( mlt_frame frame, int width, int height ) { // Pixbuf @@ -377,85 +480,8 @@ mlt_properties producer_properties = MLT_PRODUCER_PROPERTIES( producer ); if ( this->filenames == NULL && mlt_properties_get( producer_properties, "resource" ) != NULL ) - { - char *filename = mlt_properties_get( producer_properties, "resource" ); - this->filenames = mlt_properties_new( ); + load_filenames( this, producer_properties ); - // Read xml string - if ( strstr( filename, "<svg" ) ) - { - // Generate a temporary file for the svg - char fullname[ 1024 ] = "/tmp/mlt.XXXXXX"; - int fd = mkstemp( fullname ); - - if ( fd > -1 ) - { - // Write the svg into the temp file - ssize_t remaining_bytes; - char *xml = filename; - - // Strip leading crap - while ( xml[0] != '<' ) - xml++; - - remaining_bytes = strlen( xml ); - while ( remaining_bytes > 0 ) - remaining_bytes -= write( fd, xml + strlen( xml ) - remaining_bytes, remaining_bytes ); - close( fd ); - - mlt_properties_set( this->filenames, "0", fullname ); - - // Teehe - when the producer closes, delete the temp file and the space allo - mlt_properties_set_data( producer_properties, "__temporary_file__", fullname, 0, ( mlt_destructor )unlink, NULL ); - } - } - // Obtain filenames - else if ( strchr( filename, '%' ) != NULL ) - { - // handle picture sequences - int i = mlt_properties_get_int( producer_properties, "begin" ); - int gap = 0; - char full[1024]; - int keyvalue = 0; - char key[ 50 ]; - - while ( gap < 100 ) - { - struct stat buf; - snprintf( full, 1023, filename, i ++ ); - if ( stat( full, &buf ) == 0 ) - { - sprintf( key, "%d", keyvalue ++ ); - mlt_properties_set( this->filenames, key, full ); - gap = 0; - } - else - { - gap ++; - } - } - } - else if ( strstr( filename, "/.all." ) != NULL ) - { - char wildcard[ 1024 ]; - char *dir_name = strdup( filename ); - char *extension = strrchr( dir_name, '.' ); - - *( strstr( dir_name, "/.all." ) + 1 ) = '\0'; - sprintf( wildcard, "*%s", extension ); - - mlt_properties_dir_list( this->filenames, dir_name, wildcard, 1 ); - - free( dir_name ); - } - else - { - mlt_properties_set( this->filenames, "0", filename ); - } - - this->count = mlt_properties_count( this->filenames ); - } - // Generate a frame *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) ); Modified: trunk/mlt/src/modules/qimage/producer_qimage.c =================================================================== --- trunk/mlt/src/modules/qimage/producer_qimage.c 2008-12-02 07:59:53 UTC (rev 1246) +++ trunk/mlt/src/modules/qimage/producer_qimage.c 2008-12-02 08:03:53 UTC (rev 1247) @@ -32,6 +32,7 @@ #include <sys/stat.h> #include <unistd.h> +static void load_filenames( producer_qimage this, mlt_properties producer_properties ); static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int index ); static void producer_close( mlt_producer parent ); @@ -58,12 +59,113 @@ mlt_properties_set_int( properties, "aspect_ratio", 1 ); mlt_properties_set_int( properties, "progressive", 1 ); + // Validate the resource + if ( filename ) + load_filenames( this, properties ); + if ( this->count ) + { + mlt_frame frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) ); + if ( frame ) + { + mlt_properties properties = MLT_FRAME_PROPERTIES( frame ); + mlt_properties_set_data( properties, "producer_qimage", this, 0, NULL, NULL ); + mlt_frame_set_position( frame, mlt_producer_position( producer ) ); + mlt_properties_set_position( properties, "qimage_position", mlt_producer_position( producer ) ); + refresh_qimage( frame, 0, 0 ); + mlt_frame_close( frame ); + } + } + if ( this->current_width == 0 ) + { + producer_close( producer ); + producer = NULL; + } return producer; } free( this ); return NULL; } +static void load_filenames( producer_qimage this, mlt_properties producer_properties ) +{ + char *filename = mlt_properties_get( producer_properties, "resource" ); + this->filenames = mlt_properties_new( ); + + // Read xml string + if ( strstr( filename, "<svg" ) ) + { + // Generate a temporary file for the svg + char fullname[ 1024 ] = "/tmp/mlt.XXXXXX"; + int fd = mkstemp( fullname ); + + if ( fd > -1 ) + { + // Write the svg into the temp file + ssize_t remaining_bytes; + char *xml = filename; + + // Strip leading crap + while ( xml[0] != '<' ) + xml++; + + remaining_bytes = strlen( xml ); + while ( remaining_bytes > 0 ) + remaining_bytes -= write( fd, xml + strlen( xml ) - remaining_bytes, remaining_bytes ); + close( fd ); + + mlt_properties_set( this->filenames, "0", fullname ); + + // Teehe - when the producer closes, delete the temp file and the space allo + mlt_properties_set_data( producer_properties, "__temporary_file__", fullname, 0, ( mlt_destructor )unlink, NULL ); + } + } + // Obtain filenames + else if ( strchr( filename, '%' ) != NULL ) + { + // handle picture sequences + int i = mlt_properties_get_int( producer_properties, "begin" ); + int gap = 0; + char full[1024]; + int keyvalue = 0; + char key[ 50 ]; + + while ( gap < 100 ) + { + struct stat buf; + snprintf( full, 1023, filename, i ++ ); + if ( stat( full, &buf ) == 0 ) + { + sprintf( key, "%d", keyvalue ++ ); + mlt_properties_set( this->filenames, key, full ); + gap = 0; + } + else + { + gap ++; + } + } + } + else if ( strstr( filename, "/.all." ) != NULL ) + { + char wildcard[ 1024 ]; + char *dir_name = strdup( filename ); + char *extension = strrchr( dir_name, '.' ); + + *( strstr( dir_name, "/.all." ) + 1 ) = '\0'; + sprintf( wildcard, "*%s", extension ); + + mlt_properties_dir_list( this->filenames, dir_name, wildcard, 1 ); + + free( dir_name ); + } + else + { + mlt_properties_set( this->filenames, "0", filename ); + } + + this->count = mlt_properties_count( this->filenames ); +} + 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 @@ -163,85 +265,8 @@ mlt_properties producer_properties = MLT_PRODUCER_PROPERTIES( producer ); if ( this->filenames == NULL && mlt_properties_get( producer_properties, "resource" ) != NULL ) - { - char *filename = mlt_properties_get( producer_properties, "resource" ); - this->filenames = mlt_properties_new( ); + load_filenames( this, producer_properties ); - // Read xml string - if ( strstr( filename, "<svg" ) ) - { - // Generate a temporary file for the svg - char fullname[ 1024 ] = "/tmp/mlt.XXXXXX"; - int fd = mkstemp( fullname ); - - if ( fd > -1 ) - { - // Write the svg into the temp file - ssize_t remaining_bytes; - char *xml = filename; - - // Strip leading crap - while ( xml[0] != '<' ) - xml++; - - remaining_bytes = strlen( xml ); - while ( remaining_bytes > 0 ) - remaining_bytes -= write( fd, xml + strlen( xml ) - remaining_bytes, remaining_bytes ); - close( fd ); - - mlt_properties_set( this->filenames, "0", fullname ); - - // Teehe - when the producer closes, delete the temp file and the space allo - mlt_properties_set_data( producer_properties, "__temporary_file__", fullname, 0, ( mlt_destructor )unlink, NULL ); - } - } - // Obtain filenames - else if ( strchr( filename, '%' ) != NULL ) - { - // handle picture sequences - int i = mlt_properties_get_int( producer_properties, "begin" ); - int gap = 0; - char full[1024]; - int keyvalue = 0; - char key[ 50 ]; - - while ( gap < 100 ) - { - struct stat buf; - snprintf( full, 1023, filename, i ++ ); - if ( stat( full, &buf ) == 0 ) - { - sprintf( key, "%d", keyvalue ++ ); - mlt_properties_set( this->filenames, key, full ); - gap = 0; - } - else - { - gap ++; - } - } - } - else if ( strstr( filename, "/.all." ) != NULL ) - { - char wildcard[ 1024 ]; - char *dir_name = strdup( filename ); - char *extension = strrchr( dir_name, '.' ); - - *( strstr( dir_name, "/.all." ) + 1 ) = '\0'; - sprintf( wildcard, "*%s", extension ); - - mlt_properties_dir_list( this->filenames, dir_name, wildcard, 1 ); - - free( dir_name ); - } - else - { - mlt_properties_set( this->filenames, "0", filename ); - } - - this->count = mlt_properties_count( this->filenames ); - } - // Generate a frame *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) ); Modified: trunk/mlt/src/modules/sdl/producer_sdl_image.c =================================================================== --- trunk/mlt/src/modules/sdl/producer_sdl_image.c 2008-12-02 07:59:53 UTC (rev 1246) +++ trunk/mlt/src/modules/sdl/producer_sdl_image.c 2008-12-02 08:03:53 UTC (rev 1247) @@ -236,6 +236,17 @@ mlt_properties_set_int( properties, "ttl", 25 ); mlt_properties_set_int( properties, "progressive", 1 ); + // Validate the resource + SDL_Surface *surface = NULL; + if ( file && ( surface = load_image( producer ) ) ) + { + SDL_FreeSurface( surface ); + } + else + { + producer_close( producer ); + producer = NULL; + } return producer; } free( producer ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dde...@us...> - 2008-12-20 01:18:45
|
Revision: 1273 http://mlt.svn.sourceforge.net/mlt/?rev=1273&view=rev Author: ddennedy Date: 2008-12-20 01:18:33 +0000 (Sat, 20 Dec 2008) Log Message: ----------- avformat/Makefile, avformat/factory.c, avformat/filter_swscale.c: add new image scaler using FFmpeg libswcale. fezzik.ini: add swscale at higher priority than gtk2/rescale. Modified Paths: -------------- trunk/mlt/src/modules/avformat/Makefile trunk/mlt/src/modules/avformat/factory.c trunk/mlt/src/modules/fezzik.ini Added Paths: ----------- trunk/mlt/src/modules/avformat/filter_swscale.c Modified: trunk/mlt/src/modules/avformat/Makefile =================================================================== --- trunk/mlt/src/modules/avformat/Makefile 2008-12-19 23:08:26 UTC (rev 1272) +++ trunk/mlt/src/modules/avformat/Makefile 2008-12-20 01:18:33 UTC (rev 1273) @@ -8,6 +8,10 @@ filter_avresample.o \ filter_avdeinterlace.o +ifdef SWSCALE +OBJS += filter_swscale.o +endif + ifdef CODECS OBJS += producer_avformat.o \ consumer_avformat.o Modified: trunk/mlt/src/modules/avformat/factory.c =================================================================== --- trunk/mlt/src/modules/avformat/factory.c 2008-12-19 23:08:26 UTC (rev 1272) +++ trunk/mlt/src/modules/avformat/factory.c 2008-12-20 01:18:33 UTC (rev 1273) @@ -28,6 +28,7 @@ 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 @@ -111,6 +112,8 @@ return filter_avdeinterlace_init( arg ); if ( !strcmp( id, "avresample" ) ) return filter_avresample_init( arg ); + if ( !strcmp( id, "swscale" ) ) + return filter_swscale_init( profile, arg ); return NULL; } @@ -150,4 +153,5 @@ MLT_REGISTER( filter_type, "avcolor_space", create_service ); MLT_REGISTER( filter_type, "avdeinterlace", create_service ); MLT_REGISTER( filter_type, "avresample", create_service ); + MLT_REGISTER( filter_type, "swscale", create_service ); } Added: trunk/mlt/src/modules/avformat/filter_swscale.c =================================================================== --- trunk/mlt/src/modules/avformat/filter_swscale.c (rev 0) +++ trunk/mlt/src/modules/avformat/filter_swscale.c 2008-12-20 01:18:33 UTC (rev 1273) @@ -0,0 +1,148 @@ +/* + * filter_swscale.c -- image scaling filter + * Copyright (C) 2008-2009 Ushodaya Enterprises Limited + * Author: Dan Dennedy <da...@de...> + * + * 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 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 + * Lesser General Public License for more details. + * + * 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 <framework/mlt_filter.h> +#include <framework/mlt_frame.h> +#include <framework/mlt_factory.h> +#include <framework/mlt_factory.h> + + +// ffmpeg Header files +#include <avformat.h> +#include <swscale.h> + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +static inline int is_big_endian( ) +{ + union { int i; char c[ 4 ]; } big_endian_test; + big_endian_test.i = 1; + + return big_endian_test.c[ 0 ] != 1; +} + +static inline int convert_mlt_to_av_cs( mlt_image_format format ) +{ + int value = 0; + + switch( format ) + { + case mlt_image_rgb24: + value = PIX_FMT_RGB24; + break; + case mlt_image_rgb24a: + value = PIX_FMT_RGBA32; + break; + case mlt_image_yuv422: + value = PIX_FMT_YUV422; + break; + case mlt_image_yuv420p: + value = PIX_FMT_YUV420P; + break; + case mlt_image_opengl: + case mlt_image_none: + fprintf( stderr, "Invalid format...\n" ); + break; + } + + return value; +} + +static int filter_scale( mlt_frame this, uint8_t **image, mlt_image_format iformat, mlt_image_format oformat, int iwidth, int iheight, int owidth, int oheight ) +{ + // Get the properties + mlt_properties properties = MLT_FRAME_PROPERTIES( this ); + + // Get the requested interpolation method + char *interps = mlt_properties_get( properties, "rescale.interp" ); + + // Convert to the SwScale flag + int interp = SWS_BILINEAR; + if ( strcmp( interps, "nearest" ) == 0 || strcmp( interps, "neighbor" ) == 0 ) + interp = SWS_POINT; + else if ( strcmp( interps, "tiles" ) == 0 || strcmp( interps, "fast_bilinear" ) == 0 ) + interp = SWS_FAST_BILINEAR; + else if ( strcmp( interps, "bilinear" ) == 0 ) + interp = SWS_BILINEAR; + else if ( strcmp( interps, "bicubic" ) == 0 ) + interp = SWS_BICUBIC; + else if ( strcmp( interps, "bicublin" ) == 0 ) + interp = SWS_BICUBLIN; + else if ( strcmp( interps, "gauss" ) == 0 ) + interp = SWS_GAUSS; + else if ( strcmp( interps, "sinc" ) == 0 ) + interp = SWS_SINC; + else if ( strcmp( interps, "hyper" ) == 0 || strcmp( interps, "lanczos" ) == 0 ) + interp = SWS_LANCZOS; + else if ( strcmp( interps, "spline" ) == 0 ) + interp = SWS_SPLINE; + + // Convert the pixel formats + iformat = convert_mlt_to_av_cs( iformat ); + oformat = convert_mlt_to_av_cs( oformat ); + + // Create the context and output image + struct SwsContext *context = sws_getContext( iwidth, iheight, iformat, owidth, oheight, oformat, interp, NULL, NULL, NULL); + AVPicture input; + avpicture_fill( &input, *image, iformat, iwidth, iheight ); + AVPicture output; + uint8_t *outbuf = mlt_pool_alloc( owidth * ( oheight + 1 ) * 2 ); + avpicture_fill( &output, outbuf, oformat, owidth, oheight ); + + // Perform the scaling + sws_scale( context, input.data, input.linesize, 0, iheight, output.data, output.linesize); + sws_freeContext( context ); + + // Now update the frame + mlt_properties_set_data( properties, "image", outbuf, owidth * ( oheight + 1 ) * 2, ( mlt_destructor )mlt_pool_release, NULL ); + mlt_properties_set_int( properties, "width", owidth ); + mlt_properties_set_int( properties, "height", oheight ); + + // Return the output + *image = outbuf; + + return 0; +} + +/** Constructor for the filter. +*/ + +mlt_filter filter_swscale_init( mlt_profile profile, void *arg ) +{ + // Create a new scaler + mlt_filter this = mlt_factory_filter( profile, "rescale", arg ); + + // If successful, then initialise it + if ( this != NULL ) + { + // Get the properties + mlt_properties properties = MLT_FILTER_PROPERTIES( this ); + + // Set the inerpolation + mlt_properties_set( properties, "interpolation", arg == NULL ? "bilinear" : arg ); + + // Set the method + mlt_properties_set_data( properties, "method", filter_scale, 0, NULL, NULL ); + } + + return this; +} Modified: trunk/mlt/src/modules/fezzik.ini =================================================================== --- trunk/mlt/src/modules/fezzik.ini 2008-12-19 23:08:26 UTC (rev 1272) +++ trunk/mlt/src/modules/fezzik.ini 2008-12-20 01:18:33 UTC (rev 1273) @@ -7,7 +7,7 @@ # the second and third are applied as applicable). deinterlace=deinterlace,avdeinterlace -rescaler=mcrescale,gtkrescale,rescale +rescaler=mcrescale,swscale,gtkrescale,rescale resizer=resize resampler=resample,soxresample,avresample data=data_feed:attr_check This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dde...@us...> - 2008-12-28 02:39:31
|
Revision: 1294 http://mlt.svn.sourceforge.net/mlt/?rev=1294&view=rev Author: ddennedy Date: 2008-12-28 02:39:28 +0000 (Sun, 28 Dec 2008) Log Message: ----------- filter_rescale.c, producer_avformat.c, producer_libdv.c, producer_consumer.c: coerce a deinterlace when scaling an interlaced source. Modified Paths: -------------- trunk/mlt/src/modules/avformat/producer_avformat.c trunk/mlt/src/modules/core/filter_rescale.c trunk/mlt/src/modules/core/producer_consumer.c trunk/mlt/src/modules/dv/producer_libdv.c Modified: trunk/mlt/src/modules/avformat/producer_avformat.c =================================================================== --- trunk/mlt/src/modules/avformat/producer_avformat.c 2008-12-27 20:00:51 UTC (rev 1293) +++ trunk/mlt/src/modules/avformat/producer_avformat.c 2008-12-28 02:39:28 UTC (rev 1294) @@ -985,6 +985,8 @@ // Set the width and height mlt_properties_set_int( frame_properties, "width", codec_context->width ); mlt_properties_set_int( frame_properties, "height", codec_context->height ); + mlt_properties_set_int( frame_properties, "real_width", codec_context->width ); + mlt_properties_set_int( frame_properties, "real_height", codec_context->height ); mlt_properties_set_double( frame_properties, "aspect_ratio", aspect_ratio ); mlt_frame_push_get_image( frame, producer_get_image ); Modified: trunk/mlt/src/modules/core/filter_rescale.c =================================================================== --- trunk/mlt/src/modules/core/filter_rescale.c 2008-12-27 20:00:51 UTC (rev 1293) +++ trunk/mlt/src/modules/core/filter_rescale.c 2008-12-28 02:39:28 UTC (rev 1294) @@ -206,7 +206,12 @@ mlt_properties_set_int( properties, "rescale_width", iwidth ); mlt_properties_set_int( properties, "rescale_height", iheight ); } - + + // Deinterlace if height is changing to prevent fields mixing on interpolation + // One exception: non-interpolated, integral scaling + if ( iheight != oheight && ( strcmp( interps, "nearest" ) || ( iheight % oheight != 0 ) ) ) + mlt_properties_set_int( properties, "consumer_deinterlace", 1 ); + // Get the image as requested mlt_frame_get_image( this, image, format, &iwidth, &iheight, writable ); Modified: trunk/mlt/src/modules/core/producer_consumer.c =================================================================== --- trunk/mlt/src/modules/core/producer_consumer.c 2008-12-27 20:00:51 UTC (rev 1293) +++ trunk/mlt/src/modules/core/producer_consumer.c 2008-12-28 02:39:28 UTC (rev 1294) @@ -161,8 +161,11 @@ // Inform the normalizers about our video properties mlt_properties frame_props = MLT_FRAME_PROPERTIES( *frame ); mlt_properties_set_double( frame_props, "aspect_ratio", mlt_profile_sar( cx->profile ) ); - mlt_properties_set_double( frame_props, "width", cx->profile->width ); - mlt_properties_set_double( frame_props, "height", cx->profile->height ); + mlt_properties_set_int( frame_props, "width", cx->profile->width ); + mlt_properties_set_int( frame_props, "height", cx->profile->height ); + mlt_properties_set_int( frame_props, "real_width", cx->profile->width ); + mlt_properties_set_int( frame_props, "real_height", cx->profile->height ); + mlt_properties_set_int( frame_props, "progressive", cx->profile->progressive ); } // Calculate the next timecode Modified: trunk/mlt/src/modules/dv/producer_libdv.c =================================================================== --- trunk/mlt/src/modules/dv/producer_libdv.c 2008-12-27 20:00:51 UTC (rev 1293) +++ trunk/mlt/src/modules/dv/producer_libdv.c 2008-12-28 02:39:28 UTC (rev 1294) @@ -485,6 +485,8 @@ // Update other info on the frame mlt_properties_set_int( properties, "width", 720 ); mlt_properties_set_int( properties, "height", this->is_pal ? 576 : 480 ); + mlt_properties_set_int( properties, "real_width", 720 ); + mlt_properties_set_int( properties, "real_height", this->is_pal ? 576 : 480 ); mlt_properties_set_int( properties, "top_field_first", !this->is_pal ? 0 : ( data[ 5 ] & 0x07 ) == 0 ? 0 : 1 ); // Parse the header for meta info This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dde...@us...> - 2009-01-29 05:04:51
|
Revision: 1331 http://mlt.svn.sourceforge.net/mlt/?rev=1331&view=rev Author: ddennedy Date: 2009-01-29 05:04:47 +0000 (Thu, 29 Jan 2009) Log Message: ----------- producer_pixbuf.c, producer_qimage.c, producer_sdl_image.c: bugfix (kdenlive-575) large memory consumption loading many pictures. Modified Paths: -------------- trunk/mlt/src/modules/gtk2/producer_pixbuf.c trunk/mlt/src/modules/qimage/producer_qimage.c trunk/mlt/src/modules/sdl/producer_sdl_image.c Modified: trunk/mlt/src/modules/gtk2/producer_pixbuf.c =================================================================== --- trunk/mlt/src/modules/gtk2/producer_pixbuf.c 2009-01-29 05:01:28 UTC (rev 1330) +++ trunk/mlt/src/modules/gtk2/producer_pixbuf.c 2009-01-29 05:04:47 UTC (rev 1331) @@ -84,12 +84,13 @@ mlt_frame frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) ); if ( frame ) { - mlt_properties properties = MLT_FRAME_PROPERTIES( frame ); - mlt_properties_set_data( properties, "producer_pixbuf", this, 0, NULL, NULL ); + mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame ); + mlt_properties_set_data( frame_properties, "producer_pixbuf", this, 0, NULL, NULL ); mlt_frame_set_position( frame, mlt_producer_position( producer ) ); - mlt_properties_set_position( properties, "pixbuf_position", mlt_producer_position( producer ) ); + mlt_properties_set_position( frame_properties, "pixbuf_position", mlt_producer_position( producer ) ); refresh_image( frame, 0, 0 ); mlt_frame_close( frame ); + mlt_properties_set_data( properties, "_pixbuf", NULL, 0, NULL, NULL ); } } if ( this->width == 0 ) Modified: trunk/mlt/src/modules/qimage/producer_qimage.c =================================================================== --- trunk/mlt/src/modules/qimage/producer_qimage.c 2009-01-29 05:01:28 UTC (rev 1330) +++ trunk/mlt/src/modules/qimage/producer_qimage.c 2009-01-29 05:04:47 UTC (rev 1331) @@ -67,12 +67,13 @@ mlt_frame frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) ); if ( frame ) { - mlt_properties properties = MLT_FRAME_PROPERTIES( frame ); - mlt_properties_set_data( properties, "producer_qimage", this, 0, NULL, NULL ); + mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame ); + mlt_properties_set_data( frame_properties, "producer_qimage", this, 0, NULL, NULL ); mlt_frame_set_position( frame, mlt_producer_position( producer ) ); - mlt_properties_set_position( properties, "qimage_position", mlt_producer_position( producer ) ); + mlt_properties_set_position( frame_properties, "qimage_position", mlt_producer_position( producer ) ); refresh_qimage( frame, 0, 0 ); mlt_frame_close( frame ); + mlt_properties_set_data( properties, "_qimage", NULL, 0, NULL, NULL ); } } if ( this->current_width == 0 ) Modified: trunk/mlt/src/modules/sdl/producer_sdl_image.c =================================================================== --- trunk/mlt/src/modules/sdl/producer_sdl_image.c 2009-01-29 05:01:28 UTC (rev 1330) +++ trunk/mlt/src/modules/sdl/producer_sdl_image.c 2009-01-29 05:04:47 UTC (rev 1331) @@ -155,7 +155,7 @@ image_idx = ( int )floor( ( double )position / ttl ) % mlt_properties_count( filenames ); this_resource = mlt_properties_get_value( filenames, image_idx ); - if ( last_resource == NULL || strcmp( last_resource, this_resource ) ) + if ( surface == NULL || last_resource == NULL || strcmp( last_resource, this_resource ) ) { surface = IMG_Load( this_resource ); if ( surface != NULL ) @@ -163,6 +163,8 @@ surface->refcount ++; mlt_properties_set_data( properties, "_surface", surface, 0, ( mlt_destructor )SDL_FreeSurface, 0 ); mlt_properties_set( properties, "_last_resource", this_resource ); + mlt_properties_set_int( properties, "_real_width", surface->w ); + mlt_properties_set_int( properties, "_real_height", surface->h ); } } else if ( surface != NULL ) @@ -244,6 +246,7 @@ if ( file && ( surface = load_image( producer ) ) ) { SDL_FreeSurface( surface ); + mlt_properties_set_data( properties, "_surface", NULL, 0, NULL, NULL ); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dde...@us...> - 2009-02-10 06:25:33
|
Revision: 1345 http://mlt.svn.sourceforge.net/mlt/?rev=1345&view=rev Author: ddennedy Date: 2009-02-10 06:25:30 +0000 (Tue, 10 Feb 2009) Log Message: ----------- producer_vorbis.c, producer_avformat.c, consumer_avformat.c: update headers in services for framework changes with addition of mlt_cache Modified Paths: -------------- trunk/mlt/src/modules/avformat/consumer_avformat.c trunk/mlt/src/modules/avformat/producer_avformat.c trunk/mlt/src/modules/vorbis/producer_vorbis.c Modified: trunk/mlt/src/modules/avformat/consumer_avformat.c =================================================================== --- trunk/mlt/src/modules/avformat/consumer_avformat.c 2009-02-10 06:22:50 UTC (rev 1344) +++ trunk/mlt/src/modules/avformat/consumer_avformat.c 2009-02-10 06:25:30 UTC (rev 1345) @@ -22,6 +22,7 @@ // mlt Header files #include <framework/mlt_consumer.h> #include <framework/mlt_frame.h> +#include <framework/mlt_profile.h> // System header files #include <stdio.h> Modified: trunk/mlt/src/modules/avformat/producer_avformat.c =================================================================== --- trunk/mlt/src/modules/avformat/producer_avformat.c 2009-02-10 06:22:50 UTC (rev 1344) +++ trunk/mlt/src/modules/avformat/producer_avformat.c 2009-02-10 06:25:30 UTC (rev 1345) @@ -22,6 +22,7 @@ // MLT Header files #include <framework/mlt_producer.h> #include <framework/mlt_frame.h> +#include <framework/mlt_profile.h> // ffmpeg Header files #include <avformat.h> Modified: trunk/mlt/src/modules/vorbis/producer_vorbis.c =================================================================== --- trunk/mlt/src/modules/vorbis/producer_vorbis.c 2009-02-10 06:22:50 UTC (rev 1344) +++ trunk/mlt/src/modules/vorbis/producer_vorbis.c 2009-02-10 06:25:30 UTC (rev 1345) @@ -21,6 +21,7 @@ // MLT Header files #include <framework/mlt_producer.h> #include <framework/mlt_frame.h> +#include <framework/mlt_profile.h> // vorbis Header files #include <vorbis/codec.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dde...@us...> - 2009-02-14 07:41:30
|
Revision: 1356 http://mlt.svn.sourceforge.net/mlt/?rev=1356&view=rev Author: ddennedy Date: 2009-02-14 07:41:20 +0000 (Sat, 14 Feb 2009) Log Message: ----------- filter_crop.c: add cropping filter (kdenlive-509) Modified Paths: -------------- trunk/mlt/src/modules/core/Makefile trunk/mlt/src/modules/core/factory.c trunk/mlt/src/modules/fezzik.ini Added Paths: ----------- trunk/mlt/src/modules/core/filter_crop.c Modified: trunk/mlt/src/modules/core/Makefile =================================================================== --- trunk/mlt/src/modules/core/Makefile 2009-02-14 07:38:07 UTC (rev 1355) +++ trunk/mlt/src/modules/core/Makefile 2009-02-14 07:41:20 UTC (rev 1356) @@ -9,6 +9,7 @@ producer_ppm.o \ filter_brightness.o \ filter_channelcopy.o \ + filter_crop.o \ filter_data_feed.o \ filter_data_show.o \ filter_gamma.o \ Modified: trunk/mlt/src/modules/core/factory.c =================================================================== --- trunk/mlt/src/modules/core/factory.c 2009-02-14 07:38:07 UTC (rev 1355) +++ trunk/mlt/src/modules/core/factory.c 2009-02-14 07:41:20 UTC (rev 1356) @@ -24,6 +24,7 @@ extern mlt_consumer consumer_null_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_brightness_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_channelcopy_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); +extern mlt_filter filter_crop_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_data_feed_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_data_show_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_gamma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); @@ -51,6 +52,7 @@ MLT_REGISTER( consumer_type, "null", consumer_null_init ); MLT_REGISTER( filter_type, "brightness", filter_brightness_init ); MLT_REGISTER( filter_type, "channelcopy", filter_channelcopy_init ); + MLT_REGISTER( filter_type, "crop", filter_crop_init ); MLT_REGISTER( filter_type, "data_feed", filter_data_feed_init ); MLT_REGISTER( filter_type, "data_show", filter_data_show_init ); MLT_REGISTER( filter_type, "gamma", filter_gamma_init ); Added: trunk/mlt/src/modules/core/filter_crop.c =================================================================== --- trunk/mlt/src/modules/core/filter_crop.c (rev 0) +++ trunk/mlt/src/modules/core/filter_crop.c 2009-02-14 07:41:20 UTC (rev 1356) @@ -0,0 +1,163 @@ +/* + * filter_crop.c -- cropping filter + * Copyright (C) 2009 Ushodaya Enterprises Limited + * Author: Dan Dennedy <da...@de...> + * + * 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 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 + * Lesser General Public License for more details. + * + * 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 <framework/mlt_filter.h> +#include <framework/mlt_frame.h> +#include <framework/mlt_log.h> + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <math.h> + +static void crop( uint8_t *src, uint8_t *dest, int bpp, int width, int height, int left, int right, int top, int bottom ) +{ + int stride = ( width - left - right ) * bpp + 1; + int y = height - top - bottom + 1; + uint8_t *s = &src[ ( ( top * width ) + left ) * bpp ]; + + while ( --y ) + { + int x = stride; + while ( --x ) + *dest ++ = *s ++; + s += ( right + left ) * bpp; + } +} + +/** Do it :-). +*/ + +static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable ) +{ + int error = 0; + + // Get the properties from the frame + mlt_properties properties = MLT_FRAME_PROPERTIES( this ); + + // 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" ); + } + + // Now get the image + error = mlt_frame_get_image( this, image, format, width, height, writable ); + + int left = mlt_properties_get_int( properties, "crop.left" ); + int right = mlt_properties_get_int( properties, "crop.right" ); + int top = mlt_properties_get_int( properties, "crop.top" ); + int bottom = mlt_properties_get_int( properties, "crop.bottom" ); + int owidth = *width - left - right; + int oheight = *height - top - bottom; + + // We only know how to process yuv422 at the moment + if ( ( owidth != *width || oheight != *height ) && + error == 0 && *format == mlt_image_yuv422 && *image != NULL && owidth > 0 && oheight > 0 ) + { + // Provides a manual override for misreported field order + if ( mlt_properties_get( properties, "meta.top_field_first" ) ) + { + mlt_properties_set_int( properties, "top_field_first", mlt_properties_get_int( properties, "meta.top_field_first" ) ); + mlt_properties_set_int( properties, "meta.top_field_first", 0 ); + } + + if ( top % 2 ) + mlt_properties_set_int( properties, "top_field_first", !mlt_properties_get_int( properties, "top_field_first" ) ); + + // Create the output image + uint8_t *output = mlt_pool_alloc( owidth * ( oheight + 1 ) * 2 ); + if ( output ) + { + // Call the generic resize + crop( *image, output, 2, *width, *height, left, right, top, bottom ); + + // Now update the frame + *image = output; + mlt_properties_set_data( properties, "image", output, owidth * ( oheight + 1 ) * 2, ( mlt_destructor )mlt_pool_release, NULL ); + mlt_properties_set_int( properties, "width", owidth ); + mlt_properties_set_int( properties, "height", oheight ); + } + + // We should resize the alpha too + uint8_t *alpha = mlt_frame_get_alpha_mask( this ); + if ( alpha != NULL ) + { + uint8_t *newalpha = mlt_pool_alloc( owidth * oheight ); + if ( newalpha ) + { + crop( alpha, newalpha, 1, *width, *height, left, right, top, bottom ); + mlt_properties_set_data( properties, "alpha", newalpha, owidth * oheight, ( mlt_destructor )mlt_pool_release, NULL ); + this->get_alpha_mask = NULL; + } + } + *width = owidth; + *height = oheight; + } + + return error; +} + +/** Filter processing. +*/ + +static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) +{ + if ( mlt_properties_get_int( MLT_FILTER_PROPERTIES( this ), "active" ) ) + { + // Push the get_image method on to the stack + mlt_frame_push_get_image( frame, filter_get_image ); + } + else + { + mlt_properties filter_props = MLT_FILTER_PROPERTIES( this ); + mlt_properties frame_props = MLT_FRAME_PROPERTIES( frame ); + int left = mlt_properties_get_int( filter_props, "left" ); + int right = mlt_properties_get_int( filter_props, "right" ); + int top = mlt_properties_get_int( filter_props, "top" ); + int bottom = mlt_properties_get_int( filter_props, "bottom" ); + int width = mlt_properties_get_int( frame_props, "real_width" ); + int height = mlt_properties_get_int( frame_props, "real_height" ); + + mlt_properties_set_int( frame_props, "crop.left", left ); + mlt_properties_set_int( frame_props, "crop.right", right ); + mlt_properties_set_int( frame_props, "crop.top", top ); + mlt_properties_set_int( frame_props, "crop.bottom", bottom ); + mlt_properties_set_int( frame_props, "real_width", width - left - right ); + mlt_properties_set_int( frame_props, "real_height", height - top - bottom ); + } + return frame; +} + +/** Constructor for the filter. +*/ + +mlt_filter filter_crop_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) +{ + mlt_filter this = calloc( sizeof( struct mlt_filter_s ), 1 ); + if ( mlt_filter_init( this, this ) == 0 ) + { + this->process = filter_process; + if ( arg ) + mlt_properties_set_int( MLT_FILTER_PROPERTIES( this ), "active", atoi( arg ) ); + } + return this; +} Modified: trunk/mlt/src/modules/fezzik.ini =================================================================== --- trunk/mlt/src/modules/fezzik.ini 2009-02-14 07:38:07 UTC (rev 1355) +++ trunk/mlt/src/modules/fezzik.ini 2009-02-14 07:41:20 UTC (rev 1356) @@ -6,6 +6,7 @@ # The names of the services on the right dictate the preference used (if unavailable # the second and third are applied as applicable). +crop=crop:1 deinterlace=deinterlace,avdeinterlace rescaler=mcrescale,swscale,gtkrescale,rescale resizer=resize This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dde...@us...> - 2009-04-18 19:24:04
|
Revision: 1414 http://mlt.svn.sourceforge.net/mlt/?rev=1414&view=rev Author: ddennedy Date: 2009-04-18 19:24:03 +0000 (Sat, 18 Apr 2009) Log Message: ----------- Apply patch from Alberto Villa to use pkg-config for resample and vorbis modules. Modified Paths: -------------- trunk/mlt/src/modules/resample/Makefile trunk/mlt/src/modules/vorbis/Makefile Modified: trunk/mlt/src/modules/resample/Makefile =================================================================== --- trunk/mlt/src/modules/resample/Makefile 2009-04-16 17:31:41 UTC (rev 1413) +++ trunk/mlt/src/modules/resample/Makefile 2009-04-18 19:24:03 UTC (rev 1414) @@ -6,11 +6,11 @@ filter_resample.o CFLAGS += -I../.. +CFLAGS += `pkg-config --cflags samplerate` -LDFLAGS += -lsamplerate +LDFLAGS += -L../../framework -lmlt +LDFLAGS += `pkg-config --libs samplerate` -LDFLAGS+=-L../../framework -lmlt - SRCS := $(OBJS:.o=.c) all: $(TARGET) Modified: trunk/mlt/src/modules/vorbis/Makefile =================================================================== --- trunk/mlt/src/modules/vorbis/Makefile 2009-04-16 17:31:41 UTC (rev 1413) +++ trunk/mlt/src/modules/vorbis/Makefile 2009-04-18 19:24:03 UTC (rev 1414) @@ -6,11 +6,13 @@ producer_vorbis.o CFLAGS += -I../.. +CFLAGS += `pkg-config --cflags vorbis` +CFLAGS += `pkg-config --cflags vorbisfile` -LDFLAGS += -lvorbisfile -lvorbis +LDFLAGS += -L../../framework -lmlt +LDFLAGS += `pkg-config --libs vorbis` +LDFLAGS += `pkg-config --libs vorbisfile` -LDFLAGS+=-L../../framework -lmlt - SRCS := $(OBJS:.o=.c) all: $(TARGET) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dde...@us...> - 2009-05-03 00:08:38
|
Revision: 1416 http://mlt.svn.sourceforge.net/mlt/?rev=1416&view=rev Author: ddennedy Date: 2009-05-03 00:08:29 +0000 (Sun, 03 May 2009) Log Message: ----------- Apply ldflags-order part of ldflags_order patch from Alberto Villa. Alberto wrote: "on freebsd (as well as on linuces without /usr/local/lib in default ld path) building concurrent versions of mlt is not possible, because of the wrong linking of -lmlt while using LDFLAGS=-L/usr/local/lib this patch fixes the issue using pkg-config" Signed-off-by: Dan Dennedy <da...@de...> Modified Paths: -------------- trunk/mlt/src/modules/avformat/Makefile trunk/mlt/src/modules/dv/Makefile trunk/mlt/src/modules/gtk2/Makefile trunk/mlt/src/modules/jackrack/Makefile trunk/mlt/src/modules/sdl/Makefile trunk/mlt/src/modules/sox/Makefile trunk/mlt/src/modules/westley/Makefile Modified: trunk/mlt/src/modules/avformat/Makefile =================================================================== --- trunk/mlt/src/modules/avformat/Makefile 2009-04-30 07:25:11 UTC (rev 1415) +++ trunk/mlt/src/modules/avformat/Makefile 2009-05-03 00:08:29 UTC (rev 1416) @@ -1,6 +1,16 @@ include ../../../config.mak + +CFLAGS += -I../.. + +LDFLAGS += -L../../framework -lmlt + include config.mak +LDFLAGS += -lavformat$(AVFORMAT_SUFFIX) +LDFLAGS += -lavcodec$(AVFORMAT_SUFFIX) +LDFLAGS += -lavutil$(AVFORMAT_SUFFIX) +LDFLAGS += -lavdevice$(AVFORMAT_SUFFIX) $(EXTRA_LIBS) + ifndef CODECS TARGET = ../libmltffmpeg$(LIBSUF) else @@ -25,12 +35,6 @@ CFLAGS += -DCODECS endif -CFLAGS+=-I../.. - -LDFLAGS+=-L../../framework - -LDFLAGS+=-lavformat$(AVFORMAT_SUFFIX) -lavcodec$(AVFORMAT_SUFFIX) -lavutil$(AVFORMAT_SUFFIX) -lavdevice$(AVFORMAT_SUFFIX) $(EXTRA_LIBS) -lmlt - ifdef SWSCALE CFLAGS+=-DSWSCALE LDFLAGS+=-lswscale$(AVFORMAT_SUFFIX) Modified: trunk/mlt/src/modules/dv/Makefile =================================================================== --- trunk/mlt/src/modules/dv/Makefile 2009-04-30 07:25:11 UTC (rev 1415) +++ trunk/mlt/src/modules/dv/Makefile 2009-05-03 00:08:29 UTC (rev 1416) @@ -6,12 +6,12 @@ producer_libdv.o \ consumer_libdv.o -CFLAGS += `pkg-config --cflags libdv` -I../.. +CFLAGS += -I../.. +CFLAGS += `pkg-config --cflags libdv` +LDFLAGS += -L../../framework -lmlt LDFLAGS += `pkg-config --libs libdv` -LDFLAGS+=-L../../framework -lmlt - SRCS := $(OBJS:.o=.c) all: $(TARGET) Modified: trunk/mlt/src/modules/gtk2/Makefile =================================================================== --- trunk/mlt/src/modules/gtk2/Makefile 2009-04-30 07:25:11 UTC (rev 1415) +++ trunk/mlt/src/modules/gtk2/Makefile 2009-05-03 00:08:29 UTC (rev 1416) @@ -5,6 +5,9 @@ OBJS = factory.o +CFLAGS += -I../.. +LDFLAGS += -L../../framework -lmlt + ifdef USE_GTK2 OBJS += consumer_gtk2.o CFLAGS += `pkg-config gtk+-2.0 --cflags` @@ -29,9 +32,6 @@ LDFLAGS += `pkg-config pangoft2 --libs` endif -CFLAGS += -I../.. -LDFLAGS+=-L../../framework -lmlt - SRCS := $(OBJS:.o=.c) all: $(TARGET) Modified: trunk/mlt/src/modules/jackrack/Makefile =================================================================== --- trunk/mlt/src/modules/jackrack/Makefile 2009-04-30 07:25:11 UTC (rev 1415) +++ trunk/mlt/src/modules/jackrack/Makefile 2009-05-03 00:08:29 UTC (rev 1416) @@ -13,16 +13,16 @@ filter_jackrack.o \ filter_ladspa.o -CFLAGS += -I../.. `pkg-config --cflags jack` +CFLAGS += -I../.. +CFLAGS += `pkg-config --cflags jack` CFLAGS += `xml2-config --cflags` CFLAGS += `pkg-config glib-2.0 --cflags` +LDFLAGS += -L../../framework -lmlt LDFLAGS += `pkg-config --libs jack` LDFLAGS += `xml2-config --libs` LDFLAGS += `pkg-config glib-2.0 --libs` -LDFLAGS+=-L../../framework -lmlt - SRCS := $(OBJS:.o=.c) all: $(TARGET) Modified: trunk/mlt/src/modules/sdl/Makefile =================================================================== --- trunk/mlt/src/modules/sdl/Makefile 2009-04-30 07:25:11 UTC (rev 1415) +++ trunk/mlt/src/modules/sdl/Makefile 2009-05-03 00:08:29 UTC (rev 1416) @@ -10,18 +10,18 @@ consumer_sdl_still.o ifeq ($(targetos),Darwin) - CFLAGS +=-ObjC - LDFLAGS +=-lobjc -framework Foundation +CFLAGS += -ObjC +LDFLAGS += -lobjc -framework Foundation else - LDFLAGS +=-lX11 +LDFLAGS += -lX11 endif -CFLAGS +=-I../.. `sdl-config --cflags` +CFLAGS += -I../.. +CFLAGS += `sdl-config --cflags` -LDFLAGS +=`sdl-config --libs` +LDFLAGS += -L../../framework -lmlt +LDFLAGS += `sdl-config --libs` -LDFLAGS +=-L../../framework -lmlt - ifeq ($(WITH_SDL_IMAGE),1) OBJS += producer_sdl_image.o CFLAGS += -DWITH_SDL_IMAGE Modified: trunk/mlt/src/modules/sox/Makefile =================================================================== --- trunk/mlt/src/modules/sox/Makefile 2009-04-30 07:25:11 UTC (rev 1415) +++ trunk/mlt/src/modules/sox/Makefile 2009-05-03 00:08:29 UTC (rev 1416) @@ -1,4 +1,9 @@ include ../../../config.mak + +CFLAGS += -I../.. + +LDFLAGS += -L../../framework -lmlt + include config.mak TARGET = ../libmltsox$(LIBSUF) @@ -6,10 +11,6 @@ OBJS = factory.o \ filter_sox.o -CFLAGS += -I../../ - -LDFLAGS += -L../../framework -lmlt - SRCS := $(OBJS:.o=.c) all: $(TARGET) Modified: trunk/mlt/src/modules/westley/Makefile =================================================================== --- trunk/mlt/src/modules/westley/Makefile 2009-04-30 07:25:11 UTC (rev 1415) +++ trunk/mlt/src/modules/westley/Makefile 2009-05-03 00:08:29 UTC (rev 1416) @@ -6,12 +6,12 @@ consumer_westley.o \ producer_westley.o -CFLAGS += -I../../ `xml2-config --cflags` +CFLAGS += -I../.. +CFLAGS += `xml2-config --cflags` +LDFLAGS += -L../../framework -lmlt LDFLAGS += `xml2-config --libs` -LDFLAGS+=-L../../framework -lmlt - SRCS := $(OBJS:.o=.c) all: $(TARGET) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dde...@us...> - 2009-05-03 00:08:55
|
Revision: 1417 http://mlt.svn.sourceforge.net/mlt/?rev=1417&view=rev Author: ddennedy Date: 2009-05-03 00:08:46 +0000 (Sun, 03 May 2009) Log Message: ----------- Apply FreeBSD fixes part of ldflags_order patch from Alberto Villa. Signed-off-by: Dan Dennedy <da...@de...> Modified Paths: -------------- trunk/mlt/src/modules/avformat/configure trunk/mlt/src/modules/qimage/configure Modified: trunk/mlt/src/modules/avformat/configure =================================================================== --- trunk/mlt/src/modules/avformat/configure 2009-05-03 00:08:29 UTC (rev 1416) +++ trunk/mlt/src/modules/avformat/configure 2009-05-03 00:08:46 UTC (rev 1417) @@ -33,7 +33,7 @@ Darwin) export LIBSUF=.dylib ;; - Linux) + Linux|FreeBSD) export LIBSUF=.so ;; *) Modified: trunk/mlt/src/modules/qimage/configure =================================================================== --- trunk/mlt/src/modules/qimage/configure 2009-05-03 00:08:29 UTC (rev 1416) +++ trunk/mlt/src/modules/qimage/configure 2009-05-03 00:08:46 UTC (rev 1417) @@ -16,13 +16,13 @@ else targetos=$(uname -s) case $targetos in - MINGW32*) - export LIBSUF=.dll - ;; + MINGW32*) + export LIBSUF=.dll + ;; Darwin) export LIBSUF=.dylib ;; - Linux) + Linux|FreeBSD) export LIBSUF=.so ;; *) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |