+void Render::consumer_thread_started(mlt_consumer, Render * self, mlt_frame)
+{
+ pthread_t thr = pthread_self();
+ if (self->m_renderThreadGLContexts.count(thr) == 0) {
+ QGLWidget *ctx = new QGLWidget(0, self->m_mainGLContext);
+ ctx->resize(0, 0);
+ self->m_renderThreadGLContexts.insert(thr, ctx);
+ }
+ self->m_renderThreadGLContexts[thr]->makeCurrent();
+ self->m_glslManager->fire_event("init glsl");
+ if (!self->m_glslManager->get_int("glsl_supported")) {
+ QMessageBox::critical(NULL, i18n("Movit failed initialization"),
+ i18n("Initialization of OpenGL filters failed. Exiting."));
+ qApp->quit();
+ }
+}
+
+void Render::consumer_thread_stopped(mlt_consumer, Render * self, mlt_frame)
+{
+ pthread_t thr = pthread_self();
+ assert(self->m_renderThreadGLContexts.count(thr) != 0);
+ self->m_renderThreadGLContexts[thr]->makeCurrent();
+ delete self->m_renderThreadGLContexts[thr];
+ self->m_renderThreadGLContexts.remove(thr);
+}
+