]> git.sesse.net Git - kdenlive/commitdiff
Remove support for non-OpenGL main monitor.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 13 Mar 2014 18:38:13 +0000 (19:38 +0100)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>
Thu, 13 Mar 2014 18:50:02 +0000 (19:50 +0100)
Every machine capable of doing video editing these days should have OpenGL,
so remove the legacy support.

src/CMakeLists.txt
src/kdenlivesettings.kcfg
src/kdenlivesettingsdialog.cpp
src/monitor.cpp
src/monitor.h
src/recmonitor.cpp
src/recmonitor.h
src/ui/configsdl_ui.ui
src/widgets/CMakeLists.txt
src/widgets/abstractmonitor.cpp

index 1ee4b651032330688926f7c5cbb2a064f803d38b..19e34508d20fb88ba1a31c70ecc4079d04a08d02 100644 (file)
@@ -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)
index 59c033410d1fa2c4ae0debc6ba91cbd7ab51490f..7683db81f9a54616da8187118be6afa71753319d 100644 (file)
     </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>
index e64753b3b08b389254e2d617ac4943cffa3addaa..64f9aaeb2668bccaf2d258f44e622912a09f745b 100644 (file)
@@ -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;
index 2b8cd627b7276942a20936f2e85647b526e3978d..b2c430601154dcf536a92cb8a7b0cdbac91d5cc3 100644 (file)
@@ -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);
index 1d7b54cb3fa5e0d4252a6eca2cce2090706f029c..604dd39a52d61c8248660f3d3e379965f12ae661 100644 (file)
@@ -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;
index f3d9ac751b4de4efd1a1c755040a79c727d904a5..de9f07fa4fade8ec82bc78e8a0b6962b3318f51a 100644 (file)
@@ -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();
index 62d9459424954faae2230466f861f3555c4b18d9..ca89f21aaaa3972e4a1d5521b2f905e74861e099 100644 (file)
@@ -70,7 +70,6 @@ public:
 
 protected:
     void mousePressEvent(QMouseEvent * event);
-    void mouseDoubleClickEvent(QMouseEvent * event);
 
 private:
     KDateTime m_captureTime;
index 42df8669f013f823a76efeb4d1f6bf70a5877614..4bb7e3ddf099beebc3de4fa7feba4ceebf801791 100644 (file)
      </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">
      </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">
      </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>
      </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>
      </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>
      </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>
      </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>
index 38108ce2c7a57e4f3769ebaae1f6a97fdc076ec3..4bfb183a9b29e73774c2d1ceee863eca53638a8c 100644 (file)
@@ -14,6 +14,7 @@ set(kdenlive_SRCS
   widgets/noteswidget.cpp
   widgets/renderwidget.cpp
   widgets/titlewidget.cpp
+  widgets/videoglwidget.cpp
   widgets/videosurface.cpp
   PARENT_SCOPE
 )
index e877dc800d3d22147f87b155205413203a957ea7..eb3794a83d6ceab36c6444f76fd091d59e3ad1d6 100644 (file)
@@ -103,8 +103,6 @@ void VideoContainer::wheelEvent(QWheelEvent * event)
 
 void VideoContainer::mouseDoubleClickEvent(QMouseEvent * event)
 {
-    if (!KdenliveSettings::openglmonitors())
-        switchFullScreen();
     event->accept();
 }