From 5146194bfa083fab7fdd93f48ca4f44280a7a03a Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Sat, 14 Jan 2012 19:16:53 +0100 Subject: [PATCH] * Update MLT capture to use the new multi consumer for preview * Add cmake option to disable Blackmagic support * Compile warning fixes --- src/CMakeLists.txt | 14 ++- src/abstractmonitor.cpp | 2 + src/blackmagic/include/DeckLinkAPIVersion.h | 4 +- src/blackmagic/include/LinuxCOM.h | 10 +- src/clipproperties.cpp | 1 - src/customtrackview.cpp | 2 +- src/kdenlivesettings.kcfg | 4 +- src/kdenlivesettingsdialog.cpp | 4 + src/mltdevicecapture.cpp | 118 ++++++++++++++++---- src/mltdevicecapture.h | 8 +- src/projectitem.cpp | 9 -- src/projectitem.h | 1 - src/projectlist.cpp | 2 +- src/recmonitor.cpp | 25 +++-- src/recmonitor.h | 5 +- src/renderer.cpp | 5 + src/stopmotion/stopmotion.cpp | 5 +- 17 files changed, 158 insertions(+), 61 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 915c1c4b..6b3197b8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,6 +13,7 @@ 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 @@ -30,6 +31,10 @@ 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" @@ -75,7 +80,6 @@ macro_log_feature(QJSON_FOUND add_subdirectory(audioscopes) add_subdirectory(beziercurve) -add_subdirectory(blackmagic) add_subdirectory(colorcorrection) add_subdirectory(colorscopes) add_subdirectory(commands) @@ -97,6 +101,10 @@ 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 @@ -355,6 +363,10 @@ 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 270bd4f6..8ba3527b 100644 --- a/src/abstractmonitor.cpp +++ b/src/abstractmonitor.cpp @@ -32,6 +32,8 @@ VideoPreviewContainer::VideoPreviewContainer(QWidget *parent) : { setFrameShape(QFrame::NoFrame); setFocusPolicy(Qt::ClickFocus); + setAttribute(Qt::WA_PaintOnScreen); + setAttribute(Qt::WA_OpaquePaintEvent); setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); connect(&m_refreshTimer, SIGNAL(timeout()), this, SLOT(update())); m_refreshTimer.setSingleShot(false); diff --git a/src/blackmagic/include/DeckLinkAPIVersion.h b/src/blackmagic/include/DeckLinkAPIVersion.h index de9b497a..2681ed0a 100644 --- a/src/blackmagic/include/DeckLinkAPIVersion.h +++ b/src/blackmagic/include/DeckLinkAPIVersion.h @@ -30,8 +30,8 @@ #ifndef __DeckLink_API_Verison_h__ #define __DeckLink_API_Version_h__ -#define BLACKMAGIC_DECKLINK_API_VERSION 0x08060100 -#define BLACKMAGIC_DECKLINK_API_VERSION_STRING "8.6.1" +#define BLACKMAGIC_DECKLINK_API_VERSION 0x09000000 +#define BLACKMAGIC_DECKLINK_API_VERSION_STRING "9.0" #endif // __DeckLink_API_Version_h__ diff --git a/src/blackmagic/include/LinuxCOM.h b/src/blackmagic/include/LinuxCOM.h index 85231be2..2b13697d 100644 --- a/src/blackmagic/include/LinuxCOM.h +++ b/src/blackmagic/include/LinuxCOM.h @@ -88,12 +88,10 @@ typedef void *LPVOID; #ifdef __cplusplus class IUnknown { -public: - virtual ~IUnknown() = 0; - - virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) = 0; - virtual ULONG STDMETHODCALLTYPE AddRef(void) = 0; - virtual ULONG STDMETHODCALLTYPE Release(void) = 0; + public: + virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) = 0; + virtual ULONG STDMETHODCALLTYPE AddRef(void) = 0; + virtual ULONG STDMETHODCALLTYPE Release(void) = 0; }; #endif diff --git a/src/clipproperties.cpp b/src/clipproperties.cpp index 59dfe0c2..b448d453 100644 --- a/src/clipproperties.cpp +++ b/src/clipproperties.cpp @@ -475,7 +475,6 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg Nepomuk::Resource res( url.path() ); // Check if file has a license if (res.hasProperty(Nepomuk::Vocabulary::NIE::license())) { - QGridLayout *l = static_cast(layout()); QString ltype = res.property(Nepomuk::Vocabulary::NIE::licenseType()).toString(); m_view.clip_license->setText(i18n("License: %1", res.property(Nepomuk::Vocabulary::NIE::license()).toString())); if (ltype.startsWith("http")) { diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index 4624e28f..cc75b20f 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -6776,7 +6776,7 @@ void CustomTrackView::adjustEffects(ClipItem* item, ItemInfo oldInfo, QUndoComma } -void CustomTrackView::slotGotFilterJobResults(const QString &id, int startPos, int track, const QString &filter, stringMap filterParams) +void CustomTrackView::slotGotFilterJobResults(const QString &/*id*/, int startPos, int track, const QString &filter, stringMap filterParams) { ClipItem *clip = getClipItemAt(GenTime(startPos, m_document->fps()), track); if (clip == NULL) { diff --git a/src/kdenlivesettings.kcfg b/src/kdenlivesettings.kcfg index f58b8233..c3ceaf16 100644 --- a/src/kdenlivesettings.kcfg +++ b/src/kdenlivesettings.kcfg @@ -781,9 +781,9 @@ true - + - 0 + true diff --git a/src/kdenlivesettingsdialog.cpp b/src/kdenlivesettingsdialog.cpp index 7af5147c..5f29130f 100644 --- a/src/kdenlivesettingsdialog.cpp +++ b/src/kdenlivesettingsdialog.cpp @@ -22,7 +22,9 @@ #ifdef USE_V4L #include "v4l/v4lcapture.h" #endif +#ifdef USE_BLACKMAGIC #include "blackmagic/devices.h" +#endif #include "encodingprofilesdialog.h" #include "kdenlivesettings.h" @@ -266,6 +268,7 @@ 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(); @@ -276,6 +279,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap& map 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()) { diff --git a/src/mltdevicecapture.cpp b/src/mltdevicecapture.cpp index 8414b074..aebcf41c 100644 --- a/src/mltdevicecapture.cpp +++ b/src/mltdevicecapture.cpp @@ -19,9 +19,6 @@ #include "mltdevicecapture.h" #include "kdenlivesettings.h" #include "definitions.h" -//#include "recmonitor.h" -//#include "renderer.h" -#include "blackmagic/devices.h" #include @@ -90,13 +87,16 @@ MltDeviceCapture::MltDeviceCapture(QString profile, VideoPreviewContainer *surfa m_mltProfile(NULL), m_showFrameEvent(NULL), m_droppedFrames(0), - m_livePreview(KdenliveSettings::recording_preview()), + m_livePreview(KdenliveSettings::enable_recording_preview()), m_captureDisplayWidget(surface), m_winid((int) surface->winId()) { if (profile.isEmpty()) profile = KdenliveSettings::current_profile(); buildConsumer(profile); connect(this, SIGNAL(unblockPreview()), this, SLOT(slotPreparePreview())); + m_droppedFramesTimer.setSingleShot(false); + m_droppedFramesTimer.setInterval(1000); + connect(&m_droppedFramesTimer, SIGNAL(timeout()), this, SLOT(slotCheckDroppedFrames())); } MltDeviceCapture::~MltDeviceCapture() @@ -128,7 +128,8 @@ void MltDeviceCapture::buildConsumer(const QString &profileName) } } setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 1); - + + if (m_winid == 0) { // OpenGL monitor m_mltConsumer = new Mlt::Consumer(*m_mltProfile, "sdl_audio"); @@ -164,6 +165,7 @@ void MltDeviceCapture::buildConsumer(const QString &profileName) void MltDeviceCapture::stop() { + m_droppedFramesTimer.stop(); bool isPlaylist = false; disconnect(this, SIGNAL(imageReady(QImage)), this, SIGNAL(frameUpdated(QImage))); m_captureDisplayWidget->stop(); @@ -305,10 +307,22 @@ bool MltDeviceCapture::slotStartPreview(const QString &producer, bool xmlFormat) m_mltConsumer = NULL; return 0; } + m_droppedFramesTimer.start(); connect(this, SIGNAL(imageReady(QImage)), this, SIGNAL(frameUpdated(QImage))); return 1; } +void MltDeviceCapture::slotCheckDroppedFrames() +{ + if (m_mltProducer) { + int dropped = m_mltProducer->get_int("dropped"); + if (dropped > m_droppedFrames) { + m_droppedFrames = dropped; + emit droppedFrames(m_droppedFrames); + } + } +} + void MltDeviceCapture::gotCapturedFrame(Mlt::Frame& frame) { if (m_mltProducer) { @@ -319,8 +333,8 @@ void MltDeviceCapture::gotCapturedFrame(Mlt::Frame& frame) } } m_frameCount++; - if (m_livePreview == 2) return; - if (m_livePreview == 0 && (m_frameCount % 10 > 0)) return; + if (!m_livePreview) return; + //if (m_livePreview == 0 && (m_frameCount % 10 > 0)) return; mlt_image_format format = mlt_image_rgb24; int width = 0; int height = 0; @@ -384,7 +398,7 @@ void MltDeviceCapture::captureFrame(const QString &path) doCapture = 5; } -bool MltDeviceCapture::slotStartCapture(const QString ¶ms, const QString &path, const QString &playlist, int livePreview, bool xmlPlaylist) +bool MltDeviceCapture::slotStartCapture(const QString ¶ms, const QString &path, const QString &playlist, bool livePreview, bool xmlPlaylist) { stop(); m_livePreview = livePreview; @@ -394,12 +408,34 @@ bool MltDeviceCapture::slotStartCapture(const QString ¶ms, const QString &pa char *tmp = qstrdup(m_activeProfile.toUtf8().constData()); m_mltProfile = new Mlt::Profile(tmp); delete[] tmp; - m_mltProfile->get_profile()->is_explicit = 1; - kDebug()<<"-- CREATING CAP: "<get_profile()->is_explicit = 1; + + + /*kDebug()<<"-- CREATING CAP: "<set("real_time", -KdenliveSettings::mltthreads()); - delete[] tmp; + delete[] tmp;*/ + + m_mltConsumer = new Mlt::Consumer(*m_mltProfile, "multi"); + if (m_mltConsumer == NULL || !m_mltConsumer->is_valid()) { + if (m_mltConsumer) { + delete m_mltConsumer; + m_mltConsumer = NULL; + } + return false; + } + + m_winid = (int) m_captureDisplayWidget->winId(); + + // Create multi consumer setup + Mlt::Properties *renderProps = new Mlt::Properties; + renderProps->set("mlt_service", "avformat"); + renderProps->set("target", path.toUtf8().constData()); + renderProps->set("real_time", -KdenliveSettings::mltthreads()); + renderProps->set("terminate_on_pause", 0); + renderProps->set("mlt_profile", m_activeProfile.toUtf8().constData()); + QStringList paramList = params.split(" ", QString::SkipEmptyParts); char *tmp2; @@ -408,20 +444,64 @@ bool MltDeviceCapture::slotStartCapture(const QString ¶ms, const QString &pa QString value = paramList.at(i).section("=", 1, 1); if (value == "%threads") value = QString::number(QThread::idealThreadCount()); tmp2 = qstrdup(value.toUtf8().constData()); - m_mltConsumer->set(tmp, tmp2); + renderProps->set(tmp, tmp2); delete[] tmp; delete[] tmp2; } + mlt_properties consumerProperties = m_mltConsumer->get_properties(); + mlt_properties_set_data(consumerProperties, "0", renderProps->get_properties(), 0, (mlt_destructor) mlt_properties_close, NULL); - if (m_mltConsumer == NULL || !m_mltConsumer->is_valid()) { - if (m_mltConsumer) { - delete m_mltConsumer; - m_mltConsumer = NULL; + if (m_livePreview) + { + // user wants live preview + Mlt::Properties *previewProps = new Mlt::Properties; + QString videoDriver = KdenliveSettings::videodrivername(); + if (!videoDriver.isEmpty()) { + if (videoDriver == "x11_noaccel") { + setenv("SDL_VIDEO_YUV_HWACCEL", "0", 1); + videoDriver = "x11"; + } else { + unsetenv("SDL_VIDEO_YUV_HWACCEL"); + } } - return false; + setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 1); + + if (m_winid == 0) { + // OpenGL monitor + previewProps->set("mlt_service", "sdl_audio"); + previewProps->set("preview_off", 1); + previewProps->set("preview_format", mlt_image_rgb24); + previewProps->set("terminate_on_pause", 0); + m_showFrameEvent = m_mltConsumer->listen("consumer-frame-show", this, (mlt_listener) consumer_gl_frame_show); + } else { + previewProps->set("mlt_service", "sdl_preview"); + previewProps->set("window_id", m_winid); + previewProps->set("terminate_on_pause", 0); + //m_showFrameEvent = m_mltConsumer->listen("consumer-frame-show", this, (mlt_listener) rec_consumer_frame_preview); + } + //m_mltConsumer->set("resize", 1); + previewProps->set("window_background", KdenliveSettings::window_background().name().toUtf8().constData()); + QString audioDevice = KdenliveSettings::audiodevicename(); + if (!audioDevice.isEmpty()) + previewProps->set("audio_device", audioDevice.toUtf8().constData()); + + if (!videoDriver.isEmpty()) + previewProps->set("video_driver", videoDriver.toUtf8().constData()); + + QString audioDriver = KdenliveSettings::audiodrivername(); + + if (!audioDriver.isEmpty()) + previewProps->set("audio_driver", audioDriver.toUtf8().constData()); + + previewProps->set("real_time", "0"); + previewProps->set("mlt_profile", m_activeProfile.toUtf8().constData()); + mlt_properties_set_data(consumerProperties, "1", previewProps->get_properties(), 0, (mlt_destructor) mlt_properties_close, NULL); + //m_showFrameEvent = m_mltConsumer->listen("consumer-frame-render", this, (mlt_listener) rec_consumer_frame_show); + } + else { + } - if (m_livePreview < 2) m_showFrameEvent = m_mltConsumer->listen("consumer-frame-render", this, (mlt_listener) rec_consumer_frame_show); tmp = qstrdup(playlist.toUtf8().constData()); if (xmlPlaylist) { // create an xml producer @@ -446,7 +526,7 @@ bool MltDeviceCapture::slotStartCapture(const QString ¶ms, const QString &pa m_mltConsumer = NULL; return 0; } - m_captureDisplayWidget->start(); + m_droppedFramesTimer.start(); return 1; } diff --git a/src/mltdevicecapture.h b/src/mltdevicecapture.h index 77d285c4..69ad361e 100644 --- a/src/mltdevicecapture.h +++ b/src/mltdevicecapture.h @@ -74,7 +74,7 @@ Q_OBJECT public: /** @brief Starts the MLT Video4Linux process. * @param surface The widget onto which the frame should be painted */ - bool slotStartCapture(const QString ¶ms, const QString &path, const QString &playlist, int livePreview, bool xmlPlaylist = true); + bool slotStartCapture(const QString ¶ms, const QString &path, const QString &playlist, bool livePreview, bool xmlPlaylist = true); bool slotStartPreview(const QString &producer, bool xmlFormat = false); /** @brief A frame arrived from the MLT Video4Linux process. */ void gotCapturedFrame(Mlt::Frame& frame); @@ -104,7 +104,7 @@ private: QString m_activeProfile; int m_droppedFrames; /** @brief When true, images will be displayed on monitor while capturing. */ - int m_livePreview; + bool m_livePreview; /** @brief Count captured frames, used to display only one in ten images while capturing. */ int m_frameCount; @@ -117,6 +117,8 @@ private: void uyvy2rgb(unsigned char *yuv_buffer, int width, int height); QString m_capturePath; + + QTimer m_droppedFramesTimer; /** @brief Build the MLT Consumer object with initial settings. * @param profileName The MLT profile to use for the consumer */ @@ -126,6 +128,8 @@ private: private slots: void slotPreparePreview(); void slotAllowPreview(); + /** @brief When capturing, check every second for dropped frames. */ + void slotCheckDroppedFrames(); signals: /** @brief A frame's image has to be shown. diff --git a/src/projectitem.cpp b/src/projectitem.cpp index 6c084236..4caecf73 100644 --- a/src/projectitem.cpp +++ b/src/projectitem.cpp @@ -107,15 +107,6 @@ int ProjectItem::clipMaxDuration() const return m_clip->getProperty("duration").toInt(); } -QStringList ProjectItem::names() const -{ - QStringList result; - result.append(text(0)); - result.append(text(1)); - result.append(text(2)); - return result; -} - QDomElement ProjectItem::toXml() const { return m_clip->toXML(); diff --git a/src/projectitem.h b/src/projectitem.h index 6b29fb76..c6fd3b4a 100644 --- a/src/projectitem.h +++ b/src/projectitem.h @@ -53,7 +53,6 @@ public: * * The clipId is used both to identify clips and folders (groups) */ const QString &clipId() const; - QStringList names() const; const KUrl clipUrl() const; int clipMaxDuration() const; CLIPTYPE clipType() const; diff --git a/src/projectlist.cpp b/src/projectlist.cpp index ed21467e..fd462810 100644 --- a/src/projectlist.cpp +++ b/src/projectlist.cpp @@ -1108,7 +1108,7 @@ void ProjectList::slotRemoveClip() } else { ProjectItem *item = static_cast (selected.at(i)); ids << item->clipId(); - if (item->numReferences() > 0 && KMessageBox::questionYesNo(kapp->activeWindow(), i18np("Delete clip %2?
This will also remove the clip in timeline", "Delete clip %2?
This will also remove its %1 clips in timeline", item->numReferences(), item->names().at(1)), i18n("Delete Clip"), KStandardGuiItem::yes(), KStandardGuiItem::no(), "DeleteAll") == KMessageBox::No) { + if (item->numReferences() > 0 && KMessageBox::questionYesNo(kapp->activeWindow(), i18np("Delete clip %2?
This will also remove the clip in timeline", "Delete clip %2?
This will also remove its %1 clips in timeline", item->numReferences(), item->text(1)), i18n("Delete Clip"), KStandardGuiItem::yes(), KStandardGuiItem::no(), "DeleteAll") == KMessageBox::No) { KMessageBox::enableMessage("DeleteAll"); return; } diff --git a/src/recmonitor.cpp b/src/recmonitor.cpp index 42e1f3a8..8988df99 100644 --- a/src/recmonitor.cpp +++ b/src/recmonitor.cpp @@ -104,10 +104,10 @@ RecMonitor::RecMonitor(QString name, MonitorManager *manager, QWidget *parent) : rec_audio->setChecked(KdenliveSettings::v4l_captureaudio()); rec_video->setChecked(KdenliveSettings::v4l_capturevideo()); - m_previewSettings = new KSelectAction(i18n("Preview Settings"), this); - m_previewSettings->addAction(i18n("Quick preview")); - m_previewSettings->addAction(i18n("Full preview")); - m_previewSettings->addAction(i18n("No preview")); + m_previewSettings = new QAction(i18n("Recording Preview"), this); + m_previewSettings->setCheckable(true); + + rec_options->setMenu(menu); menu->addAction(m_previewSettings); @@ -169,8 +169,8 @@ RecMonitor::RecMonitor(QString name, MonitorManager *manager, QWidget *parent) : kDebug() << "/////// BUILDING MONITOR, ID: " << video_frame->winId(); slotVideoDeviceChanged(device_selector->currentIndex()); - m_previewSettings->setCurrentItem(KdenliveSettings::recording_preview()); - connect(m_previewSettings, SIGNAL(triggered(int)), this, SLOT(slotChangeRecordingPreview(int))); + m_previewSettings->setChecked(KdenliveSettings::enable_recording_preview()); + connect(m_previewSettings, SIGNAL(triggered(bool)), this, SLOT(slotChangeRecordingPreview(bool))); } RecMonitor::~RecMonitor() @@ -510,7 +510,6 @@ void RecMonitor::slotStartPreview(bool play) path = KdenliveSettings::current_profile(); m_manager->activateMonitor("record"); buildMltDevice(path); - profile = ProfilesDialog::getVideoProfile(path); producer = QString("decklink:%1").arg(KdenliveSettings::decklink_capturedevice()); if (!m_captureDevice->slotStartPreview(producer)) { // v4l capture failed to start @@ -584,6 +583,7 @@ void RecMonitor::slotRecord() switch (device_selector->currentIndex()) { case VIDEO4LINUX: + m_manager->activateMonitor("record"); path = KStandardDirs::locateLocal("appdata", "profiles/video4linux"); profile = ProfilesDialog::getVideoProfile(path); m_videoBox->setRatio((double) profile.display_aspect_num / profile.display_aspect_den); @@ -624,8 +624,8 @@ void RecMonitor::slotRecord() } } - showPreview = m_previewSettings->currentItem(); - if (!rec_video->isChecked()) showPreview = 2; + showPreview = m_previewSettings->isChecked(); + if (!rec_video->isChecked()) showPreview = false; if (m_captureDevice->slotStartCapture(v4lparameters, m_captureFile.path(), playlist, showPreview)) { m_videoBox->setHidden(false); @@ -642,6 +642,7 @@ void RecMonitor::slotRecord() break; case BLACKMAGIC: + m_manager->activateMonitor("record"); path = KdenliveSettings::current_profile(); profile = ProfilesDialog::getVideoProfile(path); m_videoBox->setRatio((double) profile.display_aspect_num / profile.display_aspect_den); @@ -649,7 +650,7 @@ void RecMonitor::slotRecord() playlist = QString("producer100000pause%1decklink").arg(KdenliveSettings::decklink_capturedevice()); - if (m_captureDevice->slotStartCapture(KdenliveSettings::decklink_parameters(), m_captureFile.path(), QString("decklink:%1").arg(KdenliveSettings::decklink_capturedevice()), m_previewSettings->currentItem(), false)) { + if (m_captureDevice->slotStartCapture(KdenliveSettings::decklink_parameters(), m_captureFile.path(), QString("decklink:%1").arg(KdenliveSettings::decklink_capturedevice()), m_previewSettings->isChecked(), false)) { m_videoBox->setHidden(false); m_isCapturing = true; slotSetInfoMessage(i18n("Capturing to %1", m_captureFile.fileName())); @@ -942,9 +943,9 @@ void RecMonitor::buildMltDevice(const QString &path) } } -void RecMonitor::slotChangeRecordingPreview(int ix) +void RecMonitor::slotChangeRecordingPreview(bool enable) { - KdenliveSettings::setRecording_preview(ix); + KdenliveSettings::setEnable_recording_preview(enable); } #include "recmonitor.moc" diff --git a/src/recmonitor.h b/src/recmonitor.h index 52106462..3324fb89 100644 --- a/src/recmonitor.h +++ b/src/recmonitor.h @@ -37,7 +37,6 @@ #include #include -#include #include #include #include @@ -101,7 +100,7 @@ private: MltDeviceCapture *m_captureDevice; VideoPreviewContainer *m_videoBox; QAction *m_addCapturedClip; - KSelectAction *m_previewSettings; + QAction *m_previewSettings; bool m_analyse; void checkDeviceAvailability(); @@ -127,7 +126,7 @@ private slots: void slotSetInfoMessage(const QString &message); void slotDroppedFrames(int dropped); /** @brief Change setting for preview while recording. */ - void slotChangeRecordingPreview(int ix); + void slotChangeRecordingPreview(bool enable); public slots: void refreshRecMonitor(bool visible); diff --git a/src/renderer.cpp b/src/renderer.cpp index f9013313..2f6c0637 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -29,7 +29,10 @@ #include "definitions.h" #include "slideshowclip.h" #include "profilesdialog.h" + +#ifdef USE_BLACKMAGIC #include "blackmagic/devices.h" +#endif #include @@ -201,6 +204,7 @@ void Render::buildConsumer(const QString &profileName) m_blackClip->set("mlt_type", "producer"); if (KdenliveSettings::external_display() && m_name != "clip") { +#ifdef USE_BLACKMAGIC // Use blackmagic card for video output QMap< QString, QString > profileProperties = ProfilesDialog::getSettingsFromFile(profileName); int device = KdenliveSettings::blackmagic_output_device(); @@ -221,6 +225,7 @@ void Render::buildConsumer(const QString &profileName) if (m_mltConsumer && m_mltConsumer->is_valid()) return; } else KMessageBox::informationList(qApp->activeWindow(), i18n("Your project's profile %1 is not compatible with the blackmagic output card. Please see supported profiles below. Switching to normal video display.", m_mltProfile->description()), BMInterface::supportedModes(KdenliveSettings::blackmagic_output_device())); } +#endif } m_externalConsumer = false; QString videoDriver = KdenliveSettings::videodrivername(); diff --git a/src/stopmotion/stopmotion.cpp b/src/stopmotion/stopmotion.cpp index f3251fa6..80e807d8 100644 --- a/src/stopmotion/stopmotion.cpp +++ b/src/stopmotion/stopmotion.cpp @@ -16,7 +16,9 @@ ***************************************************************************/ #include "stopmotion.h" +#ifdef USE_BLACKMAGIC #include "blackmagic/devices.h" +#endif #ifdef USE_V4L #include "v4l/v4lcapture.h" #endif @@ -251,10 +253,11 @@ StopmotionWidget::StopmotionWidget(MonitorManager *manager, KUrl projectFolder, m_videoBox->setLineWidth(4); layout->addWidget(m_videoBox); - +#ifdef USE_BLACKMAGIC if (BMInterface::getBlackMagicDeviceList(capture_device)) { // Found a BlackMagic device } +#endif if (QFile::exists(KdenliveSettings::video4vdevice())) { #ifdef USE_V4L // Video 4 Linux device detection -- 2.39.2