]> git.sesse.net Git - mlt/commitdiff
Merge remote-tracking branch 'original/master'
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 31 May 2012 06:24:22 +0000 (08:24 +0200)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 31 May 2012 06:24:22 +0000 (08:24 +0200)
15 files changed:
configure
src/framework/mlt_cache.c
src/framework/mlt_cache.h
src/mlt++/configure
src/modules/avformat/producer_avformat.c
src/modules/decklink/producer_decklink.cpp
src/modules/gtk2/Makefile
src/modules/gtk2/configure
src/modules/gtk2/scale_line_22_yuv_mmx.S
src/modules/jackrack/Makefile
src/modules/jackrack/configure
src/modules/jackrack/filter_jackrack.c
src/modules/qimage/configure
src/modules/swfdec/Makefile
src/modules/videostab/stab/estimate.c

index 89307f346b9c671a8e39d714786f79d5b97c69a9..8ae178f0717c8d92627004441b0918c25bfa3586 100755 (executable)
--- a/configure
+++ b/configure
@@ -27,6 +27,8 @@ General build options:
   --disable-sse2          - Compile without SSE2 support (default: on)
   --arch='arch'           - Compile for a specific architecture (default: none)
   --cpu='cpu'             - Compile for a specific CPU (default: none)
+  --target-os='os'        - Cross-compile to a specific OS (default: $(uname -s))
+  --target-arch='arch'    - Cross-compile to a specific CPU architecture
 
 Module disable options:
 
@@ -69,6 +71,7 @@ build_config()
 
                echo "LARGE_FILE=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
 
+               [ "$amd64" = "true" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
                [ "$arch" != "" ] && echo "TARGETARCH=-march=$arch"
                [ "$cpu" != "" ] && echo "TARGETCPU=-mcpu=$cpu"
                if [ "$optimisations" = "true" ]
@@ -84,13 +87,11 @@ build_config()
 
                case $targetos in
                Darwin)
-               sysctl -a hw | grep "x86_64: 1" > /dev/null && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
                echo "CFLAGS+=-fPIC -D__DARWIN__ `sdl-config --cflags`"
                echo "SHFLAGS=-dynamiclib"
                echo "LDFLAGS+=`sdl-config --libs`"
                ;;
                Linux|GNU/kFreeBSD|GNU)
-               [ "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
                [ "$optimisations" = "true" ] &&
                        echo "OPTIMISATIONS+=-ffast-math"
                echo "CFLAGS+=-fPIC -pthread"
@@ -100,7 +101,6 @@ build_config()
                echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
                ;;
                FreeBSD)
-               [ "$(uname -m)" = "amd64" -o "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
                [ "$optimisations" = "true" ] &&
                        echo "OPTIMISATIONS+=-ffast-math"
                echo "CFLAGS+=-fPIC -pthread"
@@ -109,7 +109,6 @@ build_config()
                echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
                ;;
                NetBSD)
-               [ "$(uname -m)" = "amd64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
                [ "$optimisations" = "true" ] &&
                        echo "OPTIMISATIONS+=-ffast-math"
                echo "CFLAGS+=-pthread"
@@ -118,7 +117,6 @@ build_config()
                echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
                ;;
                MinGW)
-               [ "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
                [ "$optimisations" = "true" ] &&
                        echo "OPTIMISATIONS+=-ffast-math"
                echo "SHFLAGS=-shared"
@@ -193,33 +191,15 @@ export gpl=false
 export gpl3=false
 export arch=
 export cpu=
-export targetos=
-
-# Determine OS
-targetos=$(uname -s)
-# Chose appropriate suffix for libraries
-case $targetos in
-       Darwin)
-       LIBSUF=".dylib"
-       ;;
-       Linux|FreeBSD|NetBSD)
-       LIBSUF=".so"
-       ;;
-       MINGW32_NT-*)
-       targetos="MinGW"
-       LIBSUF=".dll"
-       ;;
-       *)
-       LIBSUF=".so"
-       ;;
-esac
-export LIBSUF
+export targetos=$(uname -s)
+export targetarch=
+export amd64=false
 
 # Iterate through arguments
 for i in "$@"
 do
        case $i in
-               --help )                        help=1 ;;
+               --help )                help=1 ;;
                --prefix=* )            prefix="${i#--prefix=}" ;;
                --libdir=* )            libdir="${i#--libdir=}" ;;
                --datadir=* )           datadir="${i#--datadir=}" ;;
@@ -231,11 +211,40 @@ do
                --disable-sse2 )        sse2=false ;;
                --enable-gpl )          gpl=true ;;
                --enable-gpl3 )         gpl3=true ;;
-               --arch=* )                      arch="${i#--arch=}" ;;
-               --cpu=* )                       cpu="${i#--cpu=}" ;;
+               --arch=* )              arch="${i#--arch=}" ;;
+               --cpu=* )               cpu="${i#--cpu=}" ;;
+               --target-os=* )         targetos="${i#--target-os=}" ;;
+               --target-arch=* )       targetarch="${i#--target-arch=}" ;;
        esac
 done
 
+# Chose appropriate suffix for libraries
+case $targetos in
+       Darwin)
+       LIBSUF=".dylib"
+       if [ "$targetarch" = "" ]
+       then
+               sysctl -a hw | grep "x86_64: 1" > /dev/null
+               [ "$?" = "0" ] && targetarch="amd64"
+       fi
+       ;;
+       Linux|FreeBSD|NetBSD)
+       LIBSUF=".so"
+       ;;
+       MINGW32_NT-*|MinGW|mingw)
+       targetos="MinGW"
+       LIBSUF=".dll"
+       ;;
+       *)
+       LIBSUF=".so"
+       ;;
+esac
+export LIBSUF
+
+# Determine if we are compiling for 64-bit Intel architecture
+[ "$targetarch" = "" ] && targetarch=$(uname -m)
+[ "$targetarch" = "amd64" -o "$targetarch" = "x86_64" ] && amd64=true
+
 # Determine the libdir if it's not specified in the args
 [ "$libdir" = "" ] && libdir=$prefix/lib
 [ "$datadir" = "" ] && datadir=$prefix/share
index 250ea4156994203b1c4c4fbf7ea6df176ce00bce..7938f79e2d18a48008f0219af803d2dc3689235b 100644 (file)
@@ -1,9 +1,9 @@
 /**
- * \file mlt_profile.c
+ * \file mlt_cache.c
  * \brief least recently used cache
  * \see mlt_profile_s
  *
- * Copyright (C) 2007-2009 Ushodaya Enterprises Limited
+ * Copyright (C) 2007-2012 Ushodaya Enterprises Limited
  * \author Dan Dennedy <dan@dennedy.org>
  *
  * This library is free software; you can redistribute it and/or
@@ -25,6 +25,7 @@
 #include "mlt_log.h"
 #include "mlt_properties.h"
 #include "mlt_cache.h"
+#include "mlt_frame.h"
 
 #include <stdlib.h>
 #include <pthread.h>
@@ -336,6 +337,11 @@ static void** shuffle_get_hit( mlt_cache cache, void *object )
 }
 
 /** Put a chunk of data in the cache.
+ *
+ * This function and mlt_cache_get() are not scalable with a large volume
+ * of unique \p object paramter values. Therefore, it does not make sense
+ * to use it for a frame/image cache using the frame position for \p object.
+ * Instead, use mlt_cache_put_frame() for that.
  *
  * \public \memberof mlt_cache_s
  * \param cache a cache object
@@ -451,3 +457,137 @@ mlt_cache_item mlt_cache_get( mlt_cache cache, void *object )
        
        return result;
 }
+
+/** Shuffle the cache entries between the two arrays and return the frame for a position.
+ *
+ * \private \memberof mlt_cache_s
+ * \param cache a cache object
+ * \param position the position of the frame that you want
+ * \return a frame if there was a hit or NULL for a miss
+ */
+
+static mlt_frame* shuffle_get_frame( mlt_cache cache, mlt_position position )
+{
+       int i = cache->count;
+       int j = cache->count - 1;
+       mlt_frame *hit = NULL;
+       mlt_frame *alt = (mlt_frame*) ( cache->current == cache->A ? cache->B : cache->A );
+
+       if ( cache->count > 0 && cache->count < cache->size )
+       {
+               // first determine if we have a hit
+               while ( i-- && !hit )
+               {
+                       mlt_frame *o = (mlt_frame*) &cache->current[ i ];
+                       if ( mlt_frame_get_position( *o ) == position )
+                               hit = o;
+               }
+               // if there was no hit, we will not be shuffling out an entry
+               // and are still filling the cache
+               if ( !hit )
+                       ++j;
+               // reset these
+               i = cache->count;
+               hit = NULL;
+       }
+
+       // shuffle the existing entries to the alternate array
+       while ( i-- )
+       {
+               mlt_frame *o = (mlt_frame*) &cache->current[ i ];
+
+               if ( !hit && mlt_frame_get_position( *o ) == position )
+               {
+                       hit = o;
+               }
+               else if ( j > 0 )
+               {
+                       alt[ --j ] = *o;
+//                     mlt_log( NULL, MLT_LOG_DEBUG, "%s: shuffle %d = %p\n", __FUNCTION__, j, alt[j] );
+               }
+       }
+       return hit;
+}
+
+/** Put a frame in the cache.
+ *
+ * Unlike mlt_cache_put() this version is more suitable for caching frames
+ * and their data - like images. However, this version does not use reference
+ * counting and garbage collection. Rather, frames are cloned with deep copy
+ * to avoid those things.
+ *
+ * \public \memberof mlt_cache_s
+ * \param cache a cache object
+ * \param frame the frame to cache
+ * \see mlt_frame_get_frame
+ */
+
+void mlt_cache_put_frame( mlt_cache cache, mlt_frame frame )
+{
+       pthread_mutex_lock( &cache->mutex );
+       mlt_frame *hit = shuffle_get_frame( cache, mlt_frame_get_position( frame ) );
+       mlt_frame *alt = (mlt_frame*) ( cache->current == cache->A ? cache->B : cache->A );
+
+       // add the frame to the cache
+       if ( hit )
+       {
+               // release the old data
+               mlt_frame_close( *hit );
+               // the MRU end gets the updated data
+               hit = &alt[ cache->count - 1 ];
+       }
+       else if ( cache->count < cache->size )
+       {
+               // more room in cache, add it to MRU end
+               hit = &alt[ cache->count++ ];
+       }
+       else
+       {
+               // release the entry at the LRU end
+               mlt_frame_close( cache->current[0] );
+
+               // The MRU end gets the new item
+               hit = &alt[ cache->count - 1 ];
+       }
+       *hit = mlt_frame_clone( frame, 1 );
+       mlt_log( NULL, MLT_LOG_DEBUG, "%s: put %d = %p\n", __FUNCTION__, cache->count - 1, frame );
+
+       // swap the current array
+       cache->current = (void**) alt;
+       pthread_mutex_unlock( &cache->mutex );
+}
+
+/** Get a frame from the cache.
+ *
+ * You must call mlt_frame_close() on the frame you receive from this.
+ *
+ * \public \memberof mlt_cache_s
+ * \param cache a cache object
+ * \param position the position of the frame that you want
+ * \return a frame if found or NULL if not found or has been flushed from the cache
+ * \see mlt_frame_put_frame
+ */
+
+mlt_frame mlt_cache_get_frame( mlt_cache cache, mlt_position position )
+{
+       mlt_frame result = NULL;
+       pthread_mutex_lock( &cache->mutex );
+       mlt_frame *hit = shuffle_get_frame( cache, position );
+       mlt_frame *alt = (mlt_frame*) ( cache->current == cache->A ? cache->B : cache->A );
+
+       if ( hit )
+       {
+               // copy the hit to the MRU end
+               alt[ cache->count - 1 ] = *hit;
+               hit = &alt[ cache->count - 1 ];
+
+               result = mlt_frame_clone( *hit, 1 );
+               mlt_log( NULL, MLT_LOG_DEBUG, "%s: get %d = %p\n", __FUNCTION__, cache->count - 1, *hit );
+
+               // swap the current array
+               cache->current = (void**) alt;
+       }
+       pthread_mutex_unlock( &cache->mutex );
+
+       return result;
+}
index fb0cca6a048c9e60f1a1e7c68facb6cb38089288..cd26522cdfbccf8df58a2089383757374a16349b 100644 (file)
@@ -3,7 +3,7 @@
  * \brief least recently used cache
  * \see mlt_cache_s
  *
- * Copyright (C) 2007-2009 Ushodaya Enterprises Limited
+ * Copyright (C) 2007-2012 Ushodaya Enterprises Limited
  * \author Dan Dennedy <dan@dennedy.org>
  *
  * This library is free software; you can redistribute it and/or
@@ -36,5 +36,7 @@ extern void mlt_cache_close( mlt_cache cache );
 extern void mlt_cache_purge( mlt_cache cache, void *object );
 extern void mlt_cache_put( mlt_cache cache, void *object, void* data, int size, mlt_destructor destructor );
 extern mlt_cache_item mlt_cache_get( mlt_cache cache, void *object );
+extern void mlt_cache_put_frame( mlt_cache cache, mlt_frame frame );
+extern mlt_frame mlt_cache_get_frame( mlt_cache cache, mlt_position position );
 
 #endif
index 98e470af90d2fa6d59949a27e307de51bb58fd0e..0a4d37a187b657ca7bb63420b693f3a7d7b7bb81 100755 (executable)
@@ -18,6 +18,6 @@ case $targetos in
        MinGW)
                echo LIBSUF=.dll
                echo "CXXFLAGS+=-Wall $WARNINGS -DPIC"
-               echo "LIBFLAGS=-enable-auto-import -shared"
+               echo "LIBFLAGS=-Wl,-enable-auto-import -shared"
                ;;
 esac >> config.mak
index 8983ebd6587817936ca24d69a89cc9b77a0bc893..455de31c9dbd7a840364fd5425d613ff0e1cd92d 100644 (file)
@@ -1425,8 +1425,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
        }
        if ( self->image_cache )
        {
-               mlt_cache_item item = mlt_cache_get( self->image_cache, (void*) position );
-               uint8_t *original = mlt_cache_item_data( item, (int*) format );
+               mlt_frame original = mlt_cache_get_frame( self->image_cache, mlt_frame_get_position( frame ) );
                if ( original )
                {
                        // Set the resolution
@@ -1437,33 +1436,15 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
                        if ( *height == 1088 && mlt_profile_dar( mlt_service_profile( MLT_PRODUCER_SERVICE( producer ) ) ) == 16.0/9.0 )
                                *height = 1080;
 
-                       // Cache hit
-                       int size = mlt_image_format_size( *format, *width, *height, NULL );
-                       if ( writable )
-                       {
-                               *buffer = mlt_pool_alloc( size );
-                               mlt_frame_set_image( frame, *buffer, size, mlt_pool_release );
-                               memcpy( *buffer, original, size );
-                               mlt_cache_item_close( item );
-                       }
-                       else
-                       {
-                               *buffer = original;
-                               mlt_properties_set_data( frame_properties, "avformat.image_cache", item, 0, ( mlt_destructor )mlt_cache_item_close, NULL );
-                               mlt_frame_set_image( frame, *buffer, size, NULL );
-                       }
+                       int size = 0;
+                       *buffer = mlt_properties_get_data( MLT_FRAME_PROPERTIES( original ), "alpha", &size );
+                       if (*buffer)
+                               mlt_frame_set_alpha( frame, *buffer, size, NULL );
+                       *buffer = mlt_properties_get_data( MLT_FRAME_PROPERTIES( original ), "image", &size );
+                       mlt_frame_set_image( frame, *buffer, size, NULL );
+                       mlt_properties_set_data( frame_properties, "avformat.image_cache", original, 0, (mlt_destructor) mlt_frame_close, NULL );
                        got_picture = 1;
 
-                       // check for alpha
-                       item = mlt_cache_get( self->alpha_cache, (void*) position );
-                       original = mlt_cache_item_data( item, &size );
-                       if ( original )
-                       {
-                               alpha = mlt_pool_alloc( size );
-                               memcpy( alpha, original, size );
-                               mlt_cache_item_close( item );
-                       }
-
                        goto exit_get_image;
                }
        }
@@ -1765,20 +1746,12 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
                }
        }
 
+       // set alpha
+       if ( alpha )
+               mlt_frame_set_alpha( frame, alpha, (*width) * (*height), mlt_pool_release );
+
        if ( image_size > 0 && self->image_cache )
-       {
-               // Copy buffer to image cache   
-               uint8_t *image = mlt_pool_alloc( image_size );
-               memcpy( image, *buffer, image_size );
-               mlt_cache_put( self->image_cache, (void*) position, image, *format, mlt_pool_release );
-               if ( alpha )
-               {
-                       int alpha_size = (*width) * (*height);
-                       image = mlt_pool_alloc( alpha_size );
-                       memcpy( image, alpha, alpha_size );
-                       mlt_cache_put( self->alpha_cache, (void*) position, image, alpha_size, mlt_pool_release );
-               }
-       }
+               mlt_cache_put_frame( self->image_cache, frame );
 
        // Try to duplicate last image if there was a decoding failure
        // TODO: with multithread decoding a partial frame decoding resulting
@@ -1837,10 +1810,6 @@ exit_get_image:
        mlt_properties_set_int( properties, "meta.media.progressive", mlt_properties_get_int( frame_properties, "progressive" ) );
        mlt_service_unlock( MLT_PRODUCER_SERVICE( producer ) );
 
-       // set alpha
-       if ( alpha )
-               mlt_frame_set_alpha( frame, alpha, (*width) * (*height), mlt_pool_release );
-
        return !got_picture;
 }
 
index 3ae216c290a6b8b3fac0c087d063ac66c887ad67..b535b8c8a4340e0b626160c57c95dad56b5b7ddd 100644 (file)
@@ -254,12 +254,11 @@ public:
 
        mlt_frame getFrame()
        {
-               mlt_frame frame = NULL;
                struct timeval now;
                struct timespec tm;
                double fps = mlt_producer_get_fps( getProducer() );
                mlt_position position = mlt_producer_position( getProducer() );
-               mlt_cache_item cached = mlt_cache_get( m_cache, (void*) position );
+               mlt_frame frame = mlt_cache_get_frame( m_cache, position );
 
                // Allow the buffer to fill to the requested initial buffer level.
                if ( m_isBuffering )
@@ -284,13 +283,7 @@ public:
                        pthread_mutex_unlock( &m_mutex );
                }
 
-               if ( cached )
-               {
-                       // Copy cached frame instead of pulling from queue
-                       frame = mlt_frame_clone( (mlt_frame) mlt_cache_item_data( cached, NULL ), 0 );
-                       mlt_cache_item_close( cached );
-               }
-               else
+               if ( !frame )
                {
                        // Wait if queue is empty
                        pthread_mutex_lock( &m_mutex );
@@ -311,8 +304,10 @@ public:
 
                        // add to cache
                        if ( frame )
-                               mlt_cache_put( m_cache, (void*) position, mlt_frame_clone( frame, 1 ), 0,
-                                       (mlt_destructor) mlt_frame_close );
+                       {
+                               mlt_frame_set_position( frame, position );
+                               mlt_cache_put_frame( m_cache, frame );
+                       }
                }
 
                // Set frame timestamp and properties
@@ -601,7 +596,6 @@ static int get_frame( mlt_producer producer, mlt_frame_ptr frame, int index )
                *frame = mlt_frame_init( MLT_PRODUCER_SERVICE(producer) );
 
        // Calculate the next timecode
-       mlt_frame_set_position( *frame, mlt_producer_position( producer ) );
        mlt_producer_prepare_next( producer );
 
        // Close DeckLink if at end
index b286dbe46b4d2d4a4d147806c97a874c9b2e1d86..acf161c27acd19ec60047325338a0b562a35d1f2 100644 (file)
@@ -11,14 +11,14 @@ OBJS = factory.o
 
 ifdef USE_GTK2
 OBJS += consumer_gtk2.o
-CFLAGS += `pkg-config gtk+-2.0 --cflags`
-LDFLAGS += `pkg-config gtk+-2.0 --libs`
+CFLAGS += `pkg-config $(PKGCONFIG_PREFIX) --cflags gtk+-2.0`
+LDFLAGS += `pkg-config $(PKGCONFIG_PREFIX) --libs gtk+-2.0`
 endif
 
 ifdef USE_PIXBUF
 OBJS += producer_pixbuf.o pixops.o filter_rescale.o
-CFLAGS += `pkg-config gdk-pixbuf-2.0 --cflags`
-LDFLAGS += `pkg-config gdk-pixbuf-2.0 --libs`
+CFLAGS += `pkg-config $(PKGCONFIG_PREFIX) --cflags gdk-pixbuf-2.0`
+LDFLAGS += `pkg-config $(PKGCONFIG_PREFIX) --libs gdk-pixbuf-2.0`
 endif
 
 ifdef USE_EXIF
@@ -35,8 +35,8 @@ endif
 ifdef USE_PANGO
 OBJS += producer_pango.o
 OBJS += filter_dynamictext.o
-CFLAGS += `pkg-config pangoft2 --cflags`
-LDFLAGS += `pkg-config pangoft2 --libs`
+CFLAGS += `pkg-config $(PKGCONFIG_PREFIX) --cflags pangoft2`
+LDFLAGS += `pkg-config $(PKGCONFIG_PREFIX) --libs pangoft2`
 ifeq ($(targetos),Darwin)
 LDFLAGS += -liconv
 endif
index 06ca6a61dee3349b4bbd88a812179cf3075b0a81..60f8dd7845eb332ba609e3822d64628e0c676426 100755 (executable)
@@ -1,15 +1,31 @@
 #!/bin/sh
 
-if [ "$help" != "1" ]
+if [ "$help" = "1" ]
 then
+       cat << EOF
+GTK+ options:
 
-       pkg-config gtk+-2.0 2> /dev/null
+  --gtk2-prefix=path      - Override the gtk+-2.0 prefix for pkg-config
+
+EOF
+
+else
+       pkgconfig_prefix=
+       for i in "$@"
+       do
+               case $i in
+                       --gtk2-prefix=* )       pkgconfig_prefix="${i#--gtk2-prefix=}" ;;
+               esac
+       done
+       [ "$pkgconfig_prefix" != "" ] && pkgconfig_prefix="--define-variable=prefix=\"$pkgconfig_prefix\""
+
+       pkg-config $pkgconfig_prefix gtk+-2.0 2> /dev/null
        disable_gtk2=$?
 
-       pkg-config gdk-pixbuf-2.0 2> /dev/null
+       pkg-config $pkgconfig_prefix gdk-pixbuf-2.0 2> /dev/null
        disable_pixbuf=$?
 
-       pkg-config gdk-pixbuf-2.0 pangoft2 2> /dev/null
+       pkg-config $pkgconfig_prefix gdk-pixbuf-2.0 pangoft2 2> /dev/null
        disable_pango=$?
 
        if [ "$disable_gtk2" != "0" -a "$disable_pixbuf" != 0 -a "$disable_pango" != "0" ]
@@ -33,6 +49,8 @@ then
        [ "$disable_pixbuf" = "0" ] && echo "USE_PIXBUF=1" >> config.mak
        [ "$disable_pango" = "0" ] && echo "USE_PANGO=1" >> config.mak
 
+       [ "$pkgconfig_prefix" != "" ] && echo "PKGCONFIG_PREFIX=$pkgconfig_prefix" >> config.mak
+
        pkg-config --exists 'libexif'
        if [ $? -eq 0 ]
        then
index c929f52682d2202896aa316d6515a3a886e98df9..12e451ee1e580d46704a2b38d2e3b9f7daad7dfa 100644 (file)
@@ -19,7 +19,6 @@
  */
        .file   "scale_line_22_yuv_mmx.S"
        .version        "01.01"
-       .section .note.GNU-stack,"",%progbits
 
 .extern printf
 
@@ -31,7 +30,9 @@ MSG: .ascii "scale_line_22_yuv_mmx: %d %d\n"
        .align 16
 
 #if !defined(__MINGW32__) && !defined(__CYGWIN__)      
-       
+
+       .section .note.GNU-stack,"",%progbits
+
 .globl pixops_scale_line_22_yuv_mmx
        .type    pixops_scale_line_22_yuv_mmx,@function
 pixops_scale_line_22_yuv_mmx:
index 5932a47852f10727f2526c9579d86e91db70d674..0d1fee44535cd695eb7d4558f032778dead7cc3b 100644 (file)
@@ -27,11 +27,11 @@ ifdef GPL
 OBJS += $(GPL_OBJS)
 CFLAGS += -DGPL
 CFLAGS += `pkg-config --cflags libxml-2.0`
-CFLAGS += `pkg-config --cflags glib-2.0`
+CFLAGS += `pkg-config $(PKGCONFIG_PREFIX) --cflags glib-2.0`
 
 LDFLAGS += $(LIBDL)
 LDFLAGS += `pkg-config --libs libxml-2.0`
-LDFLAGS += `pkg-config --libs glib-2.0`
+LDFLAGS += `pkg-config $(PKGCONFIG_PREFIX) --libs glib-2.0`
 LDFLAGS += -lm
 
 YML_FILES = *.yml
index 22f57615b27bf800ddc9fc9e957e09063c5f8f6c..fee51cb955d365192649f52aa523897e19b825b5 100755 (executable)
@@ -1,7 +1,15 @@
 #!/bin/sh
 
-if [ "$help" != "1" ]
+if [ "$help" = "1" ]
 then
+       cat << EOF
+JACK Rack options:
+
+  --gtk2-prefix=path      - Override the gtk+-2.0 prefix for pkg-config
+
+EOF
+
+else
 
        pkg-config jack
        disable_jack=$?
@@ -23,6 +31,14 @@ then
                fi
                disable_ladspa=`[ -f "$ladspa_prefix/include/ladspa.h" ] && echo 0 || echo 1`
                echo GPL=1 > config.mak
+
+               for i in "$@"
+               do
+                       case $i in
+                               --gtk2-prefix=* )       pkgconfig_prefix="${i#--gtk2-prefix=}" ;;
+                       esac
+               done
+               [ "$pkgconfig_prefix" != "" ] && echo "PKGCONFIG_PREFIX=--define-variable=prefix=\"$pkgconfig_prefix\"" >> config.mak
        fi
 
        if [ "$disable_jack" = "1" -o "$disable_xml2" = "1" -o "$disable_ladspa" = "1" ]
index 8b850cbe0904ea73bac5c944f4e6cc0284e11482..c15d31e82db81f7d892a2a3d98adf0505215a767 100644 (file)
@@ -431,12 +431,20 @@ mlt_filter filter_jackrack_init( mlt_profile profile, mlt_service_type type, con
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
        {
-               char name[14];
-               
+               char name[16];
+               char *jack_client_name;
+               jack_status_t status = 0;
+
                snprintf( name, sizeof( name ), "mlt%d", getpid() );
-               jack_client_t *jack_client = jack_client_open( name, JackNullOption, NULL );
+               jack_client_t *jack_client = jack_client_open( name, JackNullOption, &status, NULL );
                if ( jack_client )
                {
+                       if ( status & JackNameNotUnique ) 
+                       {
+                               jack_client_name = jack_get_client_name ( jack_client );
+                               strcpy( name, jack_client_name );
+                       }
+
                        mlt_properties properties = MLT_FILTER_PROPERTIES( this );
                        pthread_mutex_t *output_lock = mlt_pool_alloc( sizeof( pthread_mutex_t ) );
                        pthread_cond_t  *output_ready = mlt_pool_alloc( sizeof( pthread_cond_t ) );
index d97aad5682b807e471cfc427767cf9b79d5c6c9b..b85606854cbb1a09e68df5d19b10b66a7c75857a 100755 (executable)
@@ -31,8 +31,8 @@ else
                ;;
        esac
 
-       qimage_includedir=/usr/include/qt4
-       qimage_libdir=/usr/lib/qt4
+       qimage_includedir=
+       qimage_libdir=
 
        if [ ! -d "$qimage_libdir" -o ! -d "$qimage_includedir" ]
        then
@@ -95,19 +95,8 @@ else
                fi
        fi
 
-       pkg-config --exists 'QtGui >= 4'
-       if [ $? -eq 0 ] && [ "$force_qt3" = "" ]
+       if [ -d "$qimage_libdir" -a -d "$qimage_includedir" ]
        then
-               echo "Qt version 4.x detected, will compile Qt4 qimage producer"
-               qt4_found=true
-               echo "#define USE_QT4" >> config.h
-               echo "USE_QT4=1" >> config.mak
-               echo QTCXXFLAGS=$(pkg-config --cflags QtCore QtGui QtXml QtSvg ) >> config.mak
-               echo QTLIBS=$(pkg-config --libs QtCore QtGui QtXml QtSvg) >> config.mak
-               
-       elif [ -d "$qimage_libdir" -a -d "$qimage_includedir" ]
-       then
-
                # test if we have a Qt3 or Qt4
                if [ -f "$qimage_libdir/libQtCore.so" ] || [ -d "$qimage_libdir/QtGui.framework" ] || [ -f "$qimage_libdir/libQtCore4.a" ] && [ "$force_qt3" = "" ]
                then
@@ -130,7 +119,7 @@ else
                        elif [ -f "$qimage_libdir/libQtCore4.a" ]
                        then
                                echo QTCXXFLAGS=-I$qimage_includedir >> config.mak
-                               echo QTLIBS=-enable-auto-import -L$qimage_libdir -lQtCore4 -lQtGui4 -lQtXml4 -lQtSvg4 >> config.mak
+                               echo QTLIBS=-Wl,-enable-auto-import -L$qimage_libdir -lQtCore4 -lQtGui4 -lQtXml4 -lQtSvg4 >> config.mak
                        else
                                echo QTCXXFLAGS=-I$qimage_includedir >> config.mak
                                echo QTLIBS=-L$qimage_libdir -lQtCore -lQtGui -lQtXml -lQtSvg >> config.mak
@@ -153,8 +142,19 @@ else
                    fi
                fi
        else
-               echo "qimage: QT environment not found - disabling"
-               touch ../disable-qimage
+               pkg-config --exists 'QtGui >= 4'
+               if [ $? -eq 0 ] && [ "$force_qt3" = "" ]
+               then
+                       echo "Qt version 4.x detected, will compile Qt4 qimage producer"
+                       qt4_found=true
+                       echo "#define USE_QT4" >> config.h
+                       echo "USE_QT4=1" >> config.mak
+                       echo QTCXXFLAGS=$(pkg-config --cflags QtCore QtGui QtXml QtSvg ) >> config.mak
+                       echo QTLIBS=$(pkg-config --libs QtCore QtGui QtXml QtSvg) >> config.mak
+               else
+                       echo "qimage: QT environment not found - disabling"
+                       touch ../disable-qimage
+               fi
        fi
        [ "$gpl3" = "true" ] && echo GPL3=1 >> config.mak
        exit 0
index 32d5d5d4b6fd84713c90632a77bc22dbf29786ad..e6839e73e916ec64869f8412a43222f92c9e1830 100644 (file)
@@ -10,7 +10,7 @@ TARGET = ../libmltswfdec$(LIBSUF)
 OBJS = producer_swfdec.o
 
 ifeq ($(targetos), MinGW)
-LDFLAGS += -enable-auto-import -lz
+LDFLAGS += -Wl,enable-auto-import -lz
 endif
 
 SRCS := $(OBJS:.o=.c)
index 8d39cec6ecd4ce11a80dad116fd4de3c7866970a..1585153597cdb798e72249a6df421cf8c54ee51c 100644 (file)
@@ -18,7 +18,7 @@
 #include <stdlib.h>
 #include <math.h>
 #include <string.h>
-#if !defined(__DARWIN__) && !defined(__FreeBSD__)
+#if !defined(__DARWIN__) && !defined(__FreeBSD__) && !defined(WIN32)
 #include <values.h>
 #endif