#include "gentime.h"
#include "definitions.h"
-#include "abstractmonitor.h"
+#include "widgets/abstractmonitor.h"
+#include <GL/gl.h>
#include <mlt/framework/mlt_types.h>
#include <kurl.h>
#include <QtXml/qdom.h>
-#include <qstring.h>
-#include <qmap.h>
+#include <QString>
+#include <QMap>
#include <QList>
#include <QEvent>
#include <QMutex>
#include <QSemaphore>
#include <QTimer>
+class QGLWidget;
class QPixmap;
class KComboBox;
* @param rendererName A unique identifier for this renderer
* @param winid The parent widget identifier (required for SDL display). Set to 0 for OpenGL rendering
* @param profile The MLT profile used for the renderer (default one will be used if empty). */
- Render(Kdenlive::MONITORID rendererName, int winid, QString profile = QString(), QWidget *parent = 0);
+ Render(Kdenlive::MonitorId rendererName, int winid, QString profile = QString(), QWidget *parent = 0, QGLWidget *mainGLContext = 0);
/** @brief Destroy the MLT Renderer. */
virtual ~Render();
protected:
static void consumer_frame_show(mlt_consumer, Render * self, mlt_frame frame_ptr);
static void consumer_gl_frame_show(mlt_consumer, Render * self, mlt_frame frame_ptr);
+ static void consumer_thread_started(mlt_consumer, Render * self, mlt_frame frame_ptr);
+ static void consumer_thread_stopped(mlt_consumer, Render * self, mlt_frame frame_ptr);
private:
*
* Useful to identify the renderers by what they do - e.g. background
* rendering, workspace monitor, etc. */
- Kdenlive::MONITORID m_name;
+ Kdenlive::MonitorId m_name;
Mlt::Consumer * m_mltConsumer;
Mlt::Producer * m_mltProducer;
Mlt::Profile *m_mltProfile;
Mlt::Event *m_showFrameEvent;
+ Mlt::Event *m_consumerThreadStartedEvent;
+ Mlt::Event *m_consumerThreadStoppedEvent;
Mlt::Event *m_pauseEvent;
double m_fps;
bool m_paused;
/** @brief True if this monitor is active. */
bool m_isActive;
+ QGLWidget *m_mainGLContext;
+ QGLWidget *m_GLContext;
+ QMap<pthread_t, QGLWidget *> m_renderThreadGLContexts;
+ Mlt::Filter* m_glslManager;
void closeMlt();
void mltCheckLength(Mlt::Tractor *tractor);
*
* Used in Mac OS X. */
void showImageSignal(QImage);
+ void showImageSignal(Mlt::Frame*, GLuint);
void showAudioSignal(const QVector<double> &);
void addClip(const KUrl &, stringMap);
void checkSeeking();
/** @brief Activate current monitor. */
- void activateMonitor(Kdenlive::MONITORID);
+ void activateMonitor(Kdenlive::MonitorId);
void mltFrameReceived(Mlt::Frame *);
public slots: