CXXFLAGS += $(CFLAGS) $(QTCXXFLAGS) $(EXIFCXXFLAGS) -Wno-deprecated
LDFLAGS += $(QTLIBS) $(EXIFLIBS)
-LDFLAGS += -lstdc++
ifdef USE_KDE
LDFLAGS += -lkio
$(CXX) $(SHFLAGS) -o $@ $(OBJS) $(CPPOBJS) $(LDFLAGS)
depend: $(SRCS)
- $(CC) -MM $(CFLAGS) $(QTCXXFLAGS) $^ 1>.depend
+ $(CXX) -MM $(CXXFLAGS) $^ 1>.depend
distclean: clean
rm -f .depend config.h config.mak
then
# test if we have a Qt3 or Qt4
- if [ -f "$qimage_libdir/libQtCore.so" ] || [ -d "$qimage_libdir/QtGui.framework" ] && [ "$force_qt3" = "" ]
+ if [ -f "$qimage_libdir/libQtCore.so" ] || [ -d "$qimage_libdir/QtGui.framework" ] || [ -f "$qimage_libdir/libQtCore4.a" ] && [ "$force_qt3" = "" ]
then
echo "Qt version 4.x detected, will compile Qt4 qimage producer"
qt4_found=true
then
echo QTCXXFLAGS=$(pkg-config --cflags QtCore QtGui QtXml QtSvg ) >> config.mak
echo QTLIBS=$(pkg-config --libs QtCore QtGui QtXml QtSvg) >> config.mak
+ 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
else
echo QTCXXFLAGS=-I$qimage_includedir >> config.mak
- echo QTLIBS=-L$qimage_libdir -lQtCore -lQtGui -lQtXml -lQtSvg >> config.mak
+ echo QTLIBS=-L$qimage_libdir -lQtCore -lQtGui -lQtXml -lQtSvg >> config.mak
fi
else
if [ -d "$kde_includedir" ]
// 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 );
- }
+ make_tempfile( this, filename );
}
// Obtain filenames
else if ( strchr( filename, '%' ) != NULL )
static void producer_close( mlt_producer parent )
{
producer_qimage this = parent->child;
- pthread_mutex_destroy( &this->mutex );
+ if ( this->mutex )
+ pthread_mutex_destroy( &this->mutex );
parent->close = NULL;
mlt_service_cache_purge( MLT_PRODUCER_SERVICE(parent) );
mlt_producer_close( parent );
#include <QtCore/QSysInfo>
#include <QtCore/QMutex>
#include <QtCore/QtEndian>
+#include <QtCore/QTemporaryFile>
#endif
#ifdef USE_EXIF
g_mutex.unlock();
}
+extern void make_tempfile( producer_qimage self, const char *xml )
+{
+ // Generate a temporary file for the svg
+ QTemporaryFile tempFile( "mlt.XXXXXX" );
+
+ tempFile.setAutoRemove( false );
+ if ( tempFile.open() )
+ {
+ // Write the svg into the temp file
+ char *fullname = tempFile.fileName().toUtf8().data();
+
+ // Strip leading crap
+ while ( xml[0] != '<' )
+ xml++;
+
+ qint64 remaining_bytes = strlen( xml );
+ while ( remaining_bytes > 0 )
+ remaining_bytes -= tempFile.write( xml + strlen( xml ) - remaining_bytes, remaining_bytes );
+ tempFile.close();
+
+ mlt_properties_set( self->filenames, "0", fullname );
+
+ mlt_properties_set_data( MLT_PRODUCER_PROPERTIES( &self->parent ), "__temporary_file__",
+ fullname, 0, ( mlt_destructor )unlink, NULL );
+ }
+}
+
} // extern "C"
typedef struct producer_qimage_s *producer_qimage;
extern void refresh_qimage( producer_qimage, mlt_frame, int width, int height );
+extern void make_tempfile( producer_qimage, const char *xml );
+
#ifdef USE_KDE
extern void init_qimage();
#endif