summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteinar H. Gunderson <sgunderson@bigfoot.com>2014-03-13 18:38:13 (GMT)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>2014-03-13 18:50:02 (GMT)
commitd9b09bd1f1fbd5c1dbbbce217ae89ceb57f090c5 (patch)
tree88d99d5690c80128b584386b332aed8e3d210f48
parent483f57143911f2c00a63e418e78ff8403340e33a (diff)
Remove support for non-OpenGL main monitor.
Every machine capable of doing video editing these days should have OpenGL, so remove the legacy support.
-rw-r--r--src/CMakeLists.txt10
-rw-r--r--src/kdenlivesettings.kcfg4
-rw-r--r--src/kdenlivesettingsdialog.cpp4
-rw-r--r--src/monitor.cpp104
-rw-r--r--src/monitor.h11
-rw-r--r--src/recmonitor.cpp8
-rw-r--r--src/recmonitor.h1
-rw-r--r--src/ui/configsdl_ui.ui39
-rw-r--r--src/widgets/CMakeLists.txt1
-rw-r--r--src/widgets/abstractmonitor.cpp2
10 files changed, 38 insertions, 146 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1ee4b65..19e3450 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -258,10 +258,6 @@ kde4_add_ui_files(kdenlive_UIS
ui/importkeyframesdialog_ui.ui
)
-if(OPENGL_FOUND)
- list(APPEND kdenlive_SRCS widgets/videoglwidget.cpp)
-endif(OPENGL_FOUND)
-
if(BUILD_JogShuttle)
list(APPEND kdenlive_SRCS
jogaction.cpp
@@ -322,6 +318,7 @@ target_link_libraries(kdenlive
${LIBMLTPLUS_LIBRARY}
${CMAKE_DL_LIBS}
${CMAKE_THREAD_LIBS_INIT}
+ ${OPENGL_LIBRARIES}
kiss_fft
)
@@ -330,11 +327,6 @@ if(Q_WS_X11)
target_link_libraries(kdenlive ${X11_LIBRARIES})
endif(Q_WS_X11)
-if(OPENGL_FOUND AND QT_QTOPENGL_FOUND)
- add_definitions(-DUSE_OPENGL)
- target_link_libraries(kdenlive ${OPENGL_LIBRARIES})
-endif(OPENGL_FOUND AND QT_QTOPENGL_FOUND)
-
if(SDL_FOUND)
target_link_libraries(kdenlive ${SDL_LIBRARY})
endif(SDL_FOUND)
diff --git a/src/kdenlivesettings.kcfg b/src/kdenlivesettings.kcfg
index 59c0334..7683db8 100644
--- a/src/kdenlivesettings.kcfg
+++ b/src/kdenlivesettings.kcfg
@@ -197,10 +197,6 @@
</group>
<group name="sdl">
- <entry name="openglmonitors" type="Bool">
- <label>Use OpenGL for video display.</label>
- <default>false</default>
- </entry>
<entry name="video_driver" type="UInt">
<label>Video driver used for output.</label>
diff --git a/src/kdenlivesettingsdialog.cpp b/src/kdenlivesettingsdialog.cpp
index e64753b..64f9aae 100644
--- a/src/kdenlivesettingsdialog.cpp
+++ b/src/kdenlivesettingsdialog.cpp
@@ -175,10 +175,6 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
m_configSdl.reload_blackmagic->setIcon(KIcon("view-refresh"));
connect(m_configSdl.reload_blackmagic, SIGNAL(clicked(bool)), this, SLOT(slotReloadBlackMagic()));
-#ifndef USE_OPENGL
- m_configSdl.kcfg_openglmonitors->setHidden(true);
-#endif
-
m_page6 = addPage(p6, i18n("Playback"), "media-playback-start");
QWidget *p7 = new QWidget;
diff --git a/src/monitor.cpp b/src/monitor.cpp
index 2b8cd62..b2c4306 100644
--- a/src/monitor.cpp
+++ b/src/monitor.cpp
@@ -24,7 +24,6 @@
#include "abstractclipitem.h"
#include "monitorscene.h"
#include "widgets/monitoreditwidget.h"
-#include "widgets/videosurface.h"
#include "kdenlivesettings.h"
#include <KDebug>
@@ -62,9 +61,7 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QString profil
, m_effectWidget(NULL)
, m_selectedClip(NULL)
, m_loopClipTransition(true)
-#ifdef USE_OPENGL
, m_glWidget(NULL)
-#endif
, m_editMarker(NULL)
{
QVBoxLayout *layout = new QVBoxLayout;
@@ -153,29 +150,11 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QString profil
if (profile.isEmpty())
profile = KdenliveSettings::current_profile();
- bool monitorCreated = false;
-#ifdef Q_WS_MAC
createOpenGlWidget(videoBox, profile);
- monitorCreated = true;
- //m_glWidget->setFixedSize(width, height);
-#elif defined(USE_OPENGL)
- if (KdenliveSettings::openglmonitors()) {
- monitorCreated = createOpenGlWidget(videoBox, profile);
- }
-#endif
- if (!monitorCreated) {
- createVideoSurface();
- render = new Render(m_id, (int) videoSurface->winId(), profile, this);
- connect(videoSurface, SIGNAL(refreshMonitor()), render, SLOT(doRefresh()));
- }
-#ifdef USE_OPENGL
- else if (m_glWidget) {
- QVBoxLayout *lay = new QVBoxLayout;
- lay->setContentsMargins(0, 0, 0, 0);
- lay->addWidget(m_glWidget);
- videoBox->setLayout(lay);
- }
-#endif
+ QVBoxLayout *lay = new QVBoxLayout;
+ lay->setContentsMargins(0, 0, 0, 0);
+ lay->addWidget(m_glWidget);
+ videoBox->setLayout(lay);
// Monitor ruler
m_ruler = new SmallRuler(this, render);
@@ -195,8 +174,6 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QString profil
connect(m_ruler, SIGNAL(zoneChanged(QPoint)), this, SLOT(setClipZone(QPoint)));
}
- if (videoSurface) videoSurface->show();
-
if (id == Kdenlive::ProjectMonitor) {
m_effectWidget = new MonitorEditWidget(render, videoBox);
connect(m_effectWidget, SIGNAL(showEdit(bool,bool)), this, SLOT(slotShowEffectScene(bool,bool)));
@@ -230,21 +207,20 @@ QWidget *Monitor::container()
return videoBox;
}
-#ifdef USE_OPENGL
-bool Monitor::createOpenGlWidget(QWidget *parent, const QString &profile)
+void Monitor::createOpenGlWidget(QWidget *parent, const QString &profile)
{
render = new Render(id(), 0, profile, this);
m_glWidget = new VideoGLWidget(parent);
if (m_glWidget == NULL) {
// Creation failed, we are in trouble...
- return false;
+ QMessageBox::critical(this, i18n("Missing OpenGL support"),
+ i18n("You need working OpenGL support to run Kdenlive. Exiting."));
+ qApp->quit();
}
m_glWidget->setImageAspectRatio(render->dar());
m_glWidget->setBackgroundColor(KdenliveSettings::window_background());
connect(render, SIGNAL(showImageSignal(QImage)), m_glWidget, SLOT(showImage(QImage)));
- return true;
}
-#endif
void Monitor::setupMenu(QMenu *goMenu, QAction *playZone, QAction *loopZone, QMenu *markerMenu, QAction *loopClip)
{
@@ -562,14 +538,6 @@ void Monitor::wheelEvent(QWheelEvent * event)
event->accept();
}
-void Monitor::mouseDoubleClickEvent(QMouseEvent * event)
-{
- if (!KdenliveSettings::openglmonitors()) {
- videoBox->switchFullScreen();
- event->accept();
- }
-}
-
void Monitor::slotMouseSeek(int eventDelta, bool fast)
{
if (fast) {
@@ -791,9 +759,7 @@ void Monitor::stop()
void Monitor::start()
{
if (!isVisible() || !isActive()) return;
-#ifdef USE_OPENGL
if (m_glWidget) m_glWidget->activateMonitor();
-#endif
if (render) render->startConsumer();
}
@@ -940,9 +906,7 @@ void Monitor::setCustomProfile(const QString &profile, const Timecode &tc)
if (!render->hasProfile(profile)) {
slotActivateMonitor();
render->resetProfile(profile);
-#ifdef USE_OPENGL
if (m_glWidget) m_glWidget->setImageAspectRatio(render->dar());
-#endif
}
}
@@ -953,9 +917,7 @@ void Monitor::resetProfile(const QString &profile)
if (!render->hasProfile(profile)) {
slotActivateMonitor();
render->resetProfile(profile);
-#ifdef USE_OPENGL
if (m_glWidget) m_glWidget->setImageAspectRatio(render->dar());
-#endif
}
if (m_effectWidget)
m_effectWidget->resetProfile(render);
@@ -989,28 +951,13 @@ void Monitor::slotSwitchMonitorInfo(bool show)
KdenliveSettings::setDisplayMonitorInfo(show);
if (show) {
if (m_overlay) return;
- if (videoSurface == NULL) {
- // Using OpenGL display
-#ifdef USE_OPENGL
- if (m_glWidget->layout()) delete m_glWidget->layout();
- m_overlay = new Overlay();
- connect(m_overlay, SIGNAL(editMarker()), this, SLOT(slotEditMarker()));
- QVBoxLayout *layout = new QVBoxLayout;
- layout->addStretch(10);
- layout->addWidget(m_overlay);
- m_glWidget->setLayout(layout);
-#endif
- } else {
- if (videoSurface->layout()) delete videoSurface->layout();
- m_overlay = new Overlay();
- connect(m_overlay, SIGNAL(editMarker()), this, SLOT(slotEditMarker()));
- QVBoxLayout *layout = new QVBoxLayout;
- layout->addStretch(10);
- layout->addWidget(m_overlay);
- videoSurface->setLayout(layout);
- m_overlay->raise();
- m_overlay->setHidden(true);
- }
+ if (m_glWidget->layout()) delete m_glWidget->layout();
+ m_overlay = new Overlay();
+ connect(m_overlay, SIGNAL(editMarker()), this, SLOT(slotEditMarker()));
+ QVBoxLayout *layout = new QVBoxLayout;
+ layout->addStretch(10);
+ layout->addWidget(m_overlay);
+ m_glWidget->setLayout(layout);
checkOverlay();
} else {
delete m_overlay;
@@ -1074,31 +1021,14 @@ void Monitor::slotShowEffectScene(bool show, bool manuallyTriggered)
return;
setUpdatesEnabled(false);
if (show) {
- if (videoSurface) {
- videoSurface->setVisible(false);
- // Preview is handeled internally through the Render::showFrame method
- render->disablePreview(true);
-#ifdef USE_OPENGL
- } else {
- m_glWidget->setVisible(false);
-#endif
- }
+ m_glWidget->setVisible(false);
m_effectWidget->setVisible(true);
m_effectWidget->getScene()->slotZoomFit();
emit requestFrameForAnalysis(true);
} else {
m_effectWidget->setVisible(false);
emit requestFrameForAnalysis(false);
- if (videoSurface) {
- videoSurface->setVisible(true);
- // Preview is handeled internally through the Render::showFrame method
- render->disablePreview(false);
-
-#ifdef USE_OPENGL
- } else {
- m_glWidget->setVisible(true);
-#endif
- }
+ m_glWidget->setVisible(true);
}
if (!manuallyTriggered)
m_effectWidget->showVisibilityButton(show);
diff --git a/src/monitor.h b/src/monitor.h
index 1d7b54c..604dd39 100644
--- a/src/monitor.h
+++ b/src/monitor.h
@@ -26,9 +26,7 @@
#include "definitions.h"
#include "timecodedisplay.h"
#include "widgets/abstractmonitor.h"
-#ifdef USE_OPENGL
#include "widgets/videoglwidget.h"
-#endif
#include <QLabel>
#include <QDomElement>
@@ -45,7 +43,8 @@ class MonitorEditWidget;
class Monitor;
class MonitorManager;
class QSlider;
-
+class VideoGLWidget;
+class QGLWidget;
class Overlay : public QLabel
{
@@ -101,7 +100,6 @@ public:
protected:
void mousePressEvent(QMouseEvent * event);
void mouseReleaseEvent(QMouseEvent * event);
- void mouseDoubleClickEvent(QMouseEvent * event);
void resizeEvent(QResizeEvent *event);
/** @brief Move to another position on mouse wheel event.
@@ -143,11 +141,8 @@ private:
/** true if selected clip is transition, false = selected clip is clip.
* Necessary because sometimes we get two signals, e.g. we get a clip and we get selected transition = NULL. */
bool m_loopClipTransition;
-
-#ifdef USE_OPENGL
VideoGLWidget *m_glWidget;
- bool createOpenGlWidget(QWidget *parent, const QString &profile);
-#endif
+ void createOpenGlWidget(QWidget *parent, const QString &profile);
GenTime getSnapForPos(bool previous);
Qt::WindowFlags m_baseFlags;
diff --git a/src/recmonitor.cpp b/src/recmonitor.cpp
index f3d9ac7..de9f07f 100644
--- a/src/recmonitor.cpp
+++ b/src/recmonitor.cpp
@@ -185,14 +185,6 @@ RecMonitor::~RecMonitor()
delete m_captureDevice;
}
-void RecMonitor::mouseDoubleClickEvent(QMouseEvent * event)
-{
- if (!KdenliveSettings::openglmonitors() && videoBox && videoBox->isVisible()) {
- videoBox->switchFullScreen();
- event->accept();
- }
-}
-
void RecMonitor::slotSwitchFullScreen()
{
videoBox->switchFullScreen();
diff --git a/src/recmonitor.h b/src/recmonitor.h
index 62d9459..ca89f21 100644
--- a/src/recmonitor.h
+++ b/src/recmonitor.h
@@ -70,7 +70,6 @@ public:
protected:
void mousePressEvent(QMouseEvent * event);
- void mouseDoubleClickEvent(QMouseEvent * event);
private:
KDateTime m_captureTime;
diff --git a/src/ui/configsdl_ui.ui b/src/ui/configsdl_ui.ui
index 42df866..4bb7e3d 100644
--- a/src/ui/configsdl_ui.ui
+++ b/src/ui/configsdl_ui.ui
@@ -21,14 +21,7 @@
</property>
</widget>
</item>
- <item row="1" column="0" colspan="5">
- <widget class="QCheckBox" name="kcfg_openglmonitors">
- <property name="text">
- <string>Use OpenGL for video display (restart Kdenlive to apply)</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
+ <item row="1" column="0">
<widget class="QLabel" name="textLabel1_2_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
@@ -44,10 +37,10 @@
</property>
</widget>
</item>
- <item row="2" column="2" colspan="3">
+ <item row="1" column="2" colspan="3">
<widget class="KComboBox" name="kcfg_video_driver"/>
</item>
- <item row="3" column="0">
+ <item row="2" column="0">
<widget class="QLabel" name="textLabel1_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
@@ -63,10 +56,10 @@
</property>
</widget>
</item>
- <item row="3" column="2" colspan="3">
+ <item row="2" column="2" colspan="3">
<widget class="KComboBox" name="kcfg_audio_driver"/>
</item>
- <item row="4" column="0">
+ <item row="3" column="0">
<widget class="QLabel" name="textLabel1">
<property name="text">
<string>Audio device:</string>
@@ -76,17 +69,17 @@
</property>
</widget>
</item>
- <item row="4" column="2" colspan="3">
+ <item row="3" column="2" colspan="3">
<widget class="KComboBox" name="kcfg_audio_device"/>
</item>
- <item row="5" column="0" colspan="2">
+ <item row="4" column="0" colspan="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Preview volume:</string>
</property>
</widget>
</item>
- <item row="5" column="2">
+ <item row="4" column="2">
<widget class="QSpinBox" name="kcfg_volume">
<property name="suffix">
<string>%</string>
@@ -99,14 +92,14 @@
</property>
</widget>
</item>
- <item row="6" column="0" colspan="2">
+ <item row="5" column="0" colspan="2">
<widget class="QLabel" name="label">
<property name="text">
<string>Monitor background color:</string>
</property>
</widget>
</item>
- <item row="6" column="2" colspan="3">
+ <item row="5" column="2" colspan="3">
<widget class="KColorButton" name="kcfg_window_background">
<property name="defaultColor">
<color>
@@ -117,28 +110,28 @@
</property>
</widget>
</item>
- <item row="7" column="0" colspan="5">
+ <item row="6" column="0" colspan="5">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
- <item row="8" column="0" colspan="4">
+ <item row="7" column="0" colspan="4">
<widget class="QCheckBox" name="kcfg_external_display">
<property name="text">
<string>Use external display (Blackmagic card)</string>
</property>
</widget>
</item>
- <item row="9" column="0">
+ <item row="8" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Output device</string>
</property>
</widget>
</item>
- <item row="9" column="1" colspan="3">
+ <item row="8" column="1" colspan="3">
<widget class="KComboBox" name="kcfg_blackmagic_output_device">
<property name="enabled">
<bool>true</bool>
@@ -151,14 +144,14 @@
</property>
</widget>
</item>
- <item row="9" column="4">
+ <item row="8" column="4">
<widget class="QToolButton" name="reload_blackmagic">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
- <item row="10" column="3">
+ <item row="9" column="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt
index 38108ce..4bfb183 100644
--- a/src/widgets/CMakeLists.txt
+++ b/src/widgets/CMakeLists.txt
@@ -14,6 +14,7 @@ set(kdenlive_SRCS
widgets/noteswidget.cpp
widgets/renderwidget.cpp
widgets/titlewidget.cpp
+ widgets/videoglwidget.cpp
widgets/videosurface.cpp
PARENT_SCOPE
)
diff --git a/src/widgets/abstractmonitor.cpp b/src/widgets/abstractmonitor.cpp
index e877dc8..eb3794a 100644
--- a/src/widgets/abstractmonitor.cpp
+++ b/src/widgets/abstractmonitor.cpp
@@ -103,8 +103,6 @@ void VideoContainer::wheelEvent(QWheelEvent * event)
void VideoContainer::mouseDoubleClickEvent(QMouseEvent * event)
{
- if (!KdenliveSettings::openglmonitors())
- switchFullScreen();
event->accept();
}