echo "USE_QT4=1" >> config.mak
if [ -d "$qimage_libdir/QtGui.framework" ]
then
- echo QTCXXFLAGS=$(pkg-config --cflags QtCore QtGui QtXml QtSvg ) >> config.mak
- echo QTLIBS=$(pkg-config --libs QtCore QtGui QtXml QtSvg) >> config.mak
+ echo QTCXXFLAGS=$(pkg-config --cflags QtCore QtGui QtXml QtSvg QtOpenGL) >> config.mak
+ echo QTLIBS=$(pkg-config --libs QtCore QtGui QtXml QtSvg QtOpenGL) >> config.mak
elif [ -f "$qimage_libdir/libQtCore4.a" ]
then
echo QTCXXFLAGS=-I$qimage_includedir >> config.mak
- echo QTLIBS=-Wl,-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 -lQtOpenGL4 >> 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 -lQtOpenGL >> config.mak
fi
else
if [ "$without_kde" = "" ] && [ -d "$kde_includedir" ]
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
+ echo QTCXXFLAGS=$(pkg-config --cflags QtCore QtGui QtXml QtSvg QtOpenGL) >> config.mak
+ echo QTLIBS=$(pkg-config --libs QtCore QtGui QtXml QtSvg QtOpenGL) >> config.mak
else
echo "qimage: QT environment not found - disabling"
touch ../disable-qimage
--- /dev/null
+/*
+ * consumer_qglsl.cpp
+ * Copyright (C) 2012 Dan Dennedy <dan@dennedy.org>
+ *
+ * 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.h>
+#include <QtGui/QApplication>
+#include <QtCore/QLocale>
+#include <QtOpenGL/QGLWidget>
+
+static void onThreadStarted(mlt_properties owner, mlt_consumer consumer)
+{
+ mlt_service service = MLT_CONSUMER_SERVICE(consumer);
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES(consumer);
+ mlt_filter filter = (mlt_filter) mlt_properties_get_data(properties, "glslManager", NULL);
+ mlt_properties filter_properties = MLT_FILTER_PROPERTIES(filter);
+ QApplication* app = qApp;
+
+ mlt_log_verbose(service, "%s\n", __FUNCTION__);
+#ifdef linux
+ if ( getenv("DISPLAY") == 0 ) {
+ mlt_log_error(service, "The qglsl consumer requires a X11 environment.\nPlease either run melt from an X session or use a fake X server like xvfb:\nxvfb-run -a melt (...)\n" );
+ } else
+#endif
+ if (!app) {
+ int argc = 1;
+ char* argv[1];
+ argv[0] = (char*) "MLT qglsl consumer";
+ app = new QApplication(argc, argv);
+ const char *localename = mlt_properties_get_lcnumeric(properties);
+ QLocale::setDefault(QLocale(localename));
+ }
+ QGLWidget* renderContext = new QGLWidget;
+ renderContext->resize(0, 0);
+ renderContext->show();
+ app->processEvents();
+ mlt_events_fire(filter_properties, "init glsl", NULL);
+ if (!mlt_properties_get_int(filter_properties, "glsl_supported")) {
+ mlt_log_fatal(service,
+ "OpenGL Shading Language rendering is not supported on this machine.\n" );
+ mlt_events_fire(properties, "consumer-fatal-error", NULL);
+ }
+}
+
+extern "C" {
+
+mlt_consumer consumer_qglsl_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+{
+ mlt_consumer consumer = mlt_factory_consumer(profile, "multi", arg);
+ if (consumer) {
+ mlt_filter filter = mlt_factory_filter(profile, "glsl.manager", 0);
+ if (filter) {
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES(consumer);
+ mlt_properties_set_data(properties, "glslManager", filter, 0, (mlt_destructor) mlt_filter_close, NULL);
+ mlt_events_listen(properties, consumer, "consumer-thread-started", (mlt_listener) onThreadStarted);
+ return consumer;
+ }
+ mlt_consumer_close(consumer);
+ }
+ return NULL;
+}
+
+}
#include <limits.h>
#include <framework/mlt.h>
+extern mlt_consumer consumer_qglsl_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
extern mlt_producer producer_qimage_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
extern mlt_producer producer_kdenlivetitle_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
extern mlt_transition transition_vqm_init( mlt_profile profile, mlt_service_type type, const char *id, void *arg );
MLT_REPOSITORY
{
+ MLT_REGISTER( consumer_type, "qglsl", consumer_qglsl_init );
MLT_REGISTER( producer_type, "qimage", producer_qimage_init );
MLT_REGISTER( producer_type, "kdenlivetitle", producer_kdenlivetitle_init );
MLT_REGISTER_METADATA( producer_type, "qimage", metadata, "producer_qimage.yml" );