From 12cf0917be2db25ef90b8e11d81b988f0fc29df6 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Fri, 16 Mar 2012 15:19:47 +0100 Subject: [PATCH] Get rid of all blackmagic stuff, we now get infos directly from MLT, no more compile warnings :) --- src/CMakeLists.txt | 13 ------------ src/abstractmonitor.cpp | 2 +- src/kdenlivesettingsdialog.cpp | 25 +++++------------------ src/kdenlivesettingsdialog.h | 1 - src/renderer.cpp | 37 ++++++++++++++++++++++++++++++++++ src/renderer.h | 5 +++++ 6 files changed, 48 insertions(+), 35 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 590854be..6b03136e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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) diff --git a/src/abstractmonitor.cpp b/src/abstractmonitor.cpp index c41569cc..fa6f43c9 100644 --- a/src/abstractmonitor.cpp +++ b/src/abstractmonitor.cpp @@ -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); diff --git a/src/kdenlivesettingsdialog.cpp b/src/kdenlivesettingsdialog.cpp index 5f29130f..80e1670a 100644 --- a/src/kdenlivesettingsdialog.cpp +++ b/src/kdenlivesettingsdialog.cpp @@ -22,11 +22,9 @@ #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 #include @@ -268,18 +266,11 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap& 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& 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); diff --git a/src/kdenlivesettingsdialog.h b/src/kdenlivesettingsdialog.h index d1e99ca7..9208107a 100644 --- a/src/kdenlivesettingsdialog.h +++ b/src/kdenlivesettingsdialog.h @@ -74,7 +74,6 @@ private slots: void slotShuttleModified(); void slotDialogModified(); void slotEnableCaptureFolder(); - void slotUpdateHDMIModes(); void slotUpdatev4lDevice(); void slotUpdatev4lCaptureProfile(); void slotManageEncodingProfile(); diff --git a/src/renderer.cpp b/src/renderer.cpp index e7842aab..13fb831f 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -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" diff --git a/src/renderer.h b/src/renderer.h index b2ca2676..b7b53c7a 100644 --- a/src/renderer.h +++ b/src/renderer.h @@ -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: -- 2.39.2