]> git.sesse.net Git - kdenlive/commitdiff
Get rid of all blackmagic stuff, we now get infos directly from MLT, no more compile...
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 16 Mar 2012 14:19:47 +0000 (15:19 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 16 Mar 2012 14:19:47 +0000 (15:19 +0100)
src/CMakeLists.txt
src/abstractmonitor.cpp
src/kdenlivesettingsdialog.cpp
src/kdenlivesettingsdialog.h
src/renderer.cpp
src/renderer.h

index 590854be5d3f574651f8ace2865ba8a48d0453c0..6b03136e4c433f081ee3b71064f6726d43bf11cc 100644 (file)
@@ -13,7 +13,6 @@ macro_optional_find_package(QJSON)
 
 option(WITH_V4L "Build capture support with Video4Linux" ON)
 option(WITH_JogShuttle "Build Jog/Shuttle support" ON)
-option(WITH_BlackMagic "Build Blackmagic Decklinkl support" ON)
 
 if(WITH_V4L)
   # This can be changed to support FreeBSD as soon as we move to a newer V4L2
@@ -31,10 +30,6 @@ if(WITH_JogShuttle)
   endif(HAVE_LINUX_INPUT_H)
 endif(WITH_JogShuttle)
 
-if(WITH_BlackMagic)
-    set(BUILD_BlackMagic TRUE)
-endif(WITH_BlackMagic)
-
 macro_log_feature(QT_QTOPENGL_FOUND
   "QtOpenGL"
   "Qt bindings for the OpenGL library"
@@ -100,10 +95,6 @@ if(BUILD_V4L)
   add_subdirectory(v4l)
 endif(BUILD_V4L)
 
-if(BUILD_BlackMagic)
-  add_subdirectory(blackmagic)
-endif(BUILD_BlackMagic)
-
 list(APPEND kdenlive_SRCS
   main.cpp
   mainwindow.cpp
@@ -360,10 +351,6 @@ if(BUILD_V4L)
   add_definitions(-DUSE_V4L)
 endif(BUILD_V4L)
 
-if(BUILD_BlackMagic)
-  add_definitions(-DUSE_BLACKMAGIC)
-endif(BUILD_BlackMagic)
-
 if(BUILD_JogShuttle)
   add_definitions(-DUSE_JOGSHUTTLE)
 endif(BUILD_JogShuttle)
index c41569cc69e713f2abce332438f92791070a25cc..fa6f43c935e96852f7a65412a2061df3e89c48a1 100644 (file)
@@ -31,8 +31,8 @@
 
 AbstractMonitor::AbstractMonitor(Kdenlive::MONITORID id, MonitorManager *manager, QWidget *parent): 
     QWidget(parent),
-    m_id(id),
     videoSurface(NULL),
+    m_id(id),
     m_monitorManager(manager)
 {
     videoBox = new VideoContainer(this);
index 5f29130f2703e9246586f88905381ed4cdb33e22..80e1670a87c9b1bbcca2e01f6ebede352732bff5 100644 (file)
 #ifdef USE_V4L
 #include "v4l/v4lcapture.h"
 #endif
-#ifdef USE_BLACKMAGIC
-#include "blackmagic/devices.h"
-#endif
 #include "encodingprofilesdialog.h"
 #include "kdenlivesettings.h"
+#include "renderer.h"
 
 #include <KStandardDirs>
 #include <KDebug>
@@ -268,18 +266,11 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
     slotUpdateV4lProfile(-1);
     slotUpdateDecklinkProfile(-1);
 
-#ifdef USE_BLACKMAGIC
-    BMInterface::getBlackMagicDeviceList(m_configCapture.kcfg_decklink_capturedevice);
-    if (m_configCapture.kcfg_decklink_capturedevice->count() > 0) {
-        QStringList modes = m_configCapture.kcfg_decklink_capturedevice->itemData(m_configCapture.kcfg_decklink_capturedevice->currentIndex()).toStringList();
-        m_configCapture.kcfg_decklink_capturedevice->setToolTip(i18n("Supported capture modes:\n") + modes.join("\n"));
+    Render::getBlackMagicDeviceList(m_configCapture.kcfg_decklink_capturedevice);
+    if (!Render::getBlackMagicOutputDeviceList(m_configSdl.kcfg_blackmagic_output_device)) {
+        // No blackmagic card found
+       m_configSdl.kcfg_external_display->setEnabled(false);
     }
-    connect(m_configCapture.kcfg_decklink_capturedevice, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateHDMIModes()));
-
-    if (BMInterface::getBlackMagicOutputDeviceList(m_configSdl.kcfg_blackmagic_output_device)) {
-        // Found blackmagic card
-    } else m_configSdl.kcfg_external_display->setEnabled(false);
-#endif
 
     double dvgrabVersion = 0;
     if (!KdenliveSettings::dvgrab_path().isEmpty()) {
@@ -313,12 +304,6 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
 
 KdenliveSettingsDialog::~KdenliveSettingsDialog() {}
 
-void KdenliveSettingsDialog::slotUpdateHDMIModes()
-{
-    QStringList modes = m_configCapture.kcfg_decklink_capturedevice->itemData(m_configCapture.kcfg_decklink_capturedevice->currentIndex()).toStringList();
-    m_configCapture.kcfg_decklink_capturedevice->setToolTip(i18n("Supported capture modes:\n") + modes.join("\n"));
-}
-
 void KdenliveSettingsDialog::slotUpdateRmdRegionStatus()
 {
     m_configCapture.region_group->setHidden(m_configCapture.kcfg_rmd_capture_type->currentIndex() != 1);
index d1e99ca70d8551ccb022a0f9d7fc1a71f669579d..9208107a22835e2e10592db56d8bad943d68e6a9 100644 (file)
@@ -74,7 +74,6 @@ private slots:
     void slotShuttleModified();
     void slotDialogModified();
     void slotEnableCaptureFolder();
-    void slotUpdateHDMIModes();
     void slotUpdatev4lDevice();
     void slotUpdatev4lCaptureProfile();
     void slotManageEncodingProfile();
index e7842aabe78b81e2c7287fe290c850de6d2ee788..13fb831f09aa90bdbce921cff816c71f4707cb28 100644 (file)
@@ -4213,5 +4213,42 @@ const QString Render::activeClipId()
     return QString();
 }
 
+//static 
+bool Render::getBlackMagicDeviceList(KComboBox *devicelist)
+{
+    Mlt::Profile profile;
+    Mlt::Producer bm(profile, "decklink");
+    int found_devices = 0;
+    if (bm.is_valid()) found_devices = bm.get_int("devices");
+    if (found_devices <= 0) {
+       devicelist->setEnabled(false);
+       return false;
+    }
+    for (int i = 0; i < found_devices; i++) {
+       char *tmp = qstrdup(QString("device.%1").arg(i).toUtf8().constData());
+       devicelist->addItem(bm.get(tmp));
+       delete[] tmp;
+    }
+    return true;
+}
+
+bool Render::getBlackMagicOutputDeviceList(KComboBox *devicelist)
+{
+    Mlt::Profile profile;
+    Mlt::Consumer bm(profile, "decklink");
+    int found_devices = 0;
+    if (bm.is_valid()) found_devices = bm.get_int("devices");
+    if (found_devices <= 0) {
+       devicelist->setEnabled(false);
+       return false;
+    }
+    for (int i = 0; i < found_devices; i++) {
+       char *tmp = qstrdup(QString("device.%1").arg(i).toUtf8().constData());
+       devicelist->addItem(bm.get(tmp));
+       delete[] tmp;
+    }
+    return true;
+}
+
 #include "renderer.moc"
 
index b2ca2676c4e6446a16be89802a6b8befd7382320..b7b53c7acc3a2532b25d8a2d6dd18caa41e87401 100644 (file)
@@ -48,6 +48,8 @@
 class QTimer;
 class QPixmap;
 
+class KComboBox;
+
 namespace Mlt
 {
 class Consumer;
@@ -297,6 +299,9 @@ Q_OBJECT public:
     /** @brief Unlock the MLT service */
     void unlockService(Mlt::Tractor *tractor);
     const QString activeClipId();
+    /** @brief Fill a combobox with the found blackmagic devices */
+    static bool getBlackMagicDeviceList(KComboBox *devicelist);
+    static bool getBlackMagicOutputDeviceList(KComboBox *devicelist);
 
 private: