X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fqimage%2Fqimage_wrapper.cpp;h=63cff87bf87a950a675a01e6f6be58677af8a7c6;hb=a162148e8a943e50f41941104b6c418ac8b95236;hp=f9ea850ae665565fba155797ca4f759cc1046de1;hpb=a38adfca2f3d3313218ca5243bac69bf1ae61dc1;p=melted diff --git a/src/modules/qimage/qimage_wrapper.cpp b/src/modules/qimage/qimage_wrapper.cpp index f9ea850..63cff87 100644 --- a/src/modules/qimage/qimage_wrapper.cpp +++ b/src/modules/qimage/qimage_wrapper.cpp @@ -1,6 +1,6 @@ /* * qimage_wrapper.cpp -- a QT/QImage based producer for MLT - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited + * Copyright (C) 2006 Visual Media * Author: Charles Yates * * NB: This module is designed to be functionally equivalent to the @@ -23,16 +23,33 @@ #include "qimage_wrapper.h" #include + + +#include "config.h" + +#ifdef USE_KDE +#include +#include +#endif + #include extern "C" { #include +#ifdef USE_KDE +static KInstance *instance = 0L; +#endif + static void qimage_delete( void *data ) { QImage *image = ( QImage * )data; delete image; +#ifdef USE_KDE + if (instance) delete instance; + instance = 0L; +#endif } static void clear_buffered_image( mlt_properties producer_props, uint8_t **current_image, uint8_t **current_alpha ) @@ -57,6 +74,16 @@ static void assign_buffered_image( mlt_properties producer_props, uint8_t *curre mlt_events_unblock( producer_props, NULL ); } +void init_qimage() +{ +#ifdef USE_KDE + if (!instance) { + instance = new KInstance("qimage_prod"); + KImageIO::registerFormats(); + } +#endif +} + void refresh_qimage( mlt_frame frame, int width, int height ) { // Obtain a previous assigned qimage (if it exists) @@ -216,7 +243,7 @@ void refresh_qimage( mlt_frame frame, int width, int height ) if ( update_cache ) { - mlt_frame cached = mlt_frame_init( ); + mlt_frame cached = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) ); mlt_properties cached_props = MLT_FRAME_PROPERTIES( cached ); mlt_properties_set_int( cached_props, "width", current_width ); mlt_properties_set_int( cached_props, "height", current_height );