Disable OpenGL debugging and minor optimizations

parent b9321c95
......@@ -46,20 +46,13 @@
#endif
#endif
#ifdef QT_NO_DEBUG
#define check_error(fn) \
{ \
}
#if 1
#define check_error(fn) {}
#else
#define check_error(fn) \
{ \
uint err = fn->glGetError(); \
if (err != GL_NO_ERROR) { \
qCCritical(KDENLIVE_LOG) << "GL error" << hex << err << dec << "at" << __FILE__ << ":" << __LINE__; \
} \
}
#define check_error(fn) { int err = fn->glGetError(); if (err != GL_NO_ERROR) { qCritical(KDENLIVE_LOG) << "GL error" << hex << err << dec << "at" << __FILE__ << ":" << __LINE__; } }
#endif
#ifndef GL_TIMEOUT_IGNORED
#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull
#endif
......@@ -215,8 +208,7 @@ void GLWidget::initializeGL()
openglContext()->makeCurrent(this);
connect(m_frameRenderer, &FrameRenderer::textureReady, this, &GLWidget::updateTexture, Qt::DirectConnection);
connect(m_frameRenderer, &FrameRenderer::frameDisplayed, this, &GLWidget::onFrameDisplayed, Qt::QueuedConnection);
connect(m_frameRenderer, &FrameRenderer::audioSamplesSignal, this, &GLWidget::audioSamplesSignal, Qt::QueuedConnection);
connect(m_frameRenderer, &FrameRenderer::frameDisplayed, this, &GLWidget::frameDisplayed, Qt::QueuedConnection);
m_initSem.release();
m_isInitialized = true;
reconfigure();
......@@ -673,7 +665,6 @@ void GLWidget::requestSeek()
void GLWidget::seek(int pos)
{
if (!m_proxy->seeking()) {
m_proxy->setSeekPosition(pos);
m_producer->seek(pos);
if (m_consumer->is_stopped()) {
m_consumer->start();
......@@ -681,9 +672,8 @@ void GLWidget::seek(int pos)
m_consumer->purge();
m_consumer->set("refresh", 1);
}
} else {
m_proxy->setSeekPosition(pos);
}
m_proxy->setSeekPosition(pos);
}
void GLWidget::requestRefresh()
......@@ -1289,7 +1279,6 @@ void GLWidget::onFrameDisplayed(const SharedFrame &frame)
m_sendFrame = sendFrameForAnalysis;
m_contextSharedAccess.unlock();
update();
emit frameDisplayed(frame);
}
void GLWidget::mouseReleaseEvent(QMouseEvent *event)
......@@ -1410,8 +1399,6 @@ void GLWidget::updateTexture(GLuint yName, GLuint uName, GLuint vName)
m_texture[0] = yName;
m_texture[1] = uName;
m_texture[2] = vName;
m_sendFrame = sendFrameForAnalysis;
// update();
}
void GLWidget::on_frame_show(mlt_consumer, void *self, mlt_frame frame_ptr)
......
......@@ -178,7 +178,6 @@ signals:
void mouseSeek(int eventDelta, uint modifiers);
void startDrag();
void analyseFrame(const QImage &);
void audioSamplesSignal(const audioShortVector &, int, int, int);
void showContextMenu(const QPoint &);
void lockMonitor(bool);
void passKeyEvent(QKeyEvent *);
......@@ -320,7 +319,6 @@ public slots:
signals:
void textureReady(GLuint yName, GLuint uName = 0, GLuint vName = 0);
void frameDisplayed(const SharedFrame &frame);
void audioSamplesSignal(const audioShortVector &, int, int, int);
private:
QSemaphore m_semaphore;
......
......@@ -157,8 +157,7 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
connect(m_glMonitor, &GLWidget::passKeyEvent, this, &Monitor::doKeyPressEvent);
connect(m_glMonitor, &GLWidget::panView, this, &Monitor::panView);
connect(m_glMonitor, &GLWidget::seekPosition, this, &Monitor::seekPosition, Qt::DirectConnection);
connect(m_glMonitor, &GLWidget::consumerPosition, this, &Monitor::slotSeekPosition, Qt::DirectConnection);
connect(m_glMonitor, &GLWidget::consumerPosition, this, &Monitor::slotSeekPosition);
connect(m_glMonitor, &GLWidget::activateMonitor, this, &AbstractMonitor::slotActivateMonitor, Qt::DirectConnection);
m_videoWidget = QWidget::createWindowContainer(qobject_cast<QWindow *>(m_glMonitor));
m_videoWidget->setAcceptDrops(true);
......@@ -304,7 +303,6 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
connect(this, &Monitor::scopesClear, m_glMonitor, &GLWidget::releaseAnalyse, Qt::DirectConnection);
connect(m_glMonitor, &GLWidget::analyseFrame, this, &Monitor::frameUpdated);
connect(m_glMonitor, &GLWidget::audioSamplesSignal, this, &Monitor::audioSamplesSignal);
if (id != Kdenlive::ClipMonitor) {
// TODO: reimplement
......
......@@ -123,10 +123,10 @@ void MonitorManager::refreshClipMonitor()
bool MonitorManager::activateMonitor(Kdenlive::MonitorId name)
{
if (m_clipMonitor == nullptr || m_projectMonitor == nullptr) {
if ((m_activeMonitor != nullptr) && m_activeMonitor->id() == name) {
return false;
}
if ((m_activeMonitor != nullptr) && m_activeMonitor->id() == name) {
if (m_clipMonitor == nullptr || m_projectMonitor == nullptr) {
return false;
}
QMutexLocker locker(&m_switchMutex);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment