]> git.sesse.net Git - kdenlive/commitdiff
* Update MLT capture to use the new multi consumer for preview
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 14 Jan 2012 18:16:53 +0000 (19:16 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 14 Jan 2012 18:16:53 +0000 (19:16 +0100)
* Add cmake option to disable Blackmagic support
* Compile warning fixes

17 files changed:
src/CMakeLists.txt
src/abstractmonitor.cpp
src/blackmagic/include/DeckLinkAPIVersion.h
src/blackmagic/include/LinuxCOM.h
src/clipproperties.cpp
src/customtrackview.cpp
src/kdenlivesettings.kcfg
src/kdenlivesettingsdialog.cpp
src/mltdevicecapture.cpp
src/mltdevicecapture.h
src/projectitem.cpp
src/projectitem.h
src/projectlist.cpp
src/recmonitor.cpp
src/recmonitor.h
src/renderer.cpp
src/stopmotion/stopmotion.cpp

index 915c1c4b7ef3e62430d1398492e70a31d81f4eee..6b3197b83d038f5d0fed003b56274688bb9f77f8 100644 (file)
@@ -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)
index 270bd4f6151b8ab274885dae5f15e463f8436784..8ba3527bdcdd2807a37b00dc5d8b076fc8816e98 100644 (file)
@@ -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);
index de9b497a2059872d28f7db80e75c7e9b318749e8..2681ed0a0aa1bc926d72c46653a03ad0a7e42840 100644 (file)
@@ -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__
 
index 85231be2036ca5b22a861c8a6a46ff9ed229995d..2b13697d2b08547c5ec718669a2bf779e6f539b6 100644 (file)
@@ -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
 
index 59dfe0c203db8302abb58b8b6fc0fa023391e4a7..b448d45375124dfc2af5fa097131cbf4567d46d9 100644 (file)
@@ -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<QGridLayout *>(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")) {
index 4624e28f034e6c3d3db9e1caff33fc91cc7ed5ca..cc75b20f515da8153416e123f9eac89b9ccfe2e0 100644 (file)
@@ -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) {
index f58b8233ac413c0e26a088834e2910ef77bc1c38..c3ceaf16e77dcafde56a2c38a7b66a3cd9e7602f 100644 (file)
       <default>true</default>
     </entry>
     
-    <entry name="recording_preview" type="UInt">
+    <entry name="enable_recording_preview" type="Bool">
       <label>Should we display video frames while capturing.</label>
-      <default>0</default>
+      <default>true</default>
     </entry>
     
     <entry name="add_clip_cut" type="Bool">
index 7af5147c2edb4e7b09f7ad7263621ab0a18b53a9..5f29130f2703e9246586f88905381ed4cdb33e22 100644 (file)
@@ -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<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();
@@ -276,6 +279,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& 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()) {
index 8414b074d4476f54e6c4aa70c671ab48a815f0a8..aebcf41c549e9c3abfbfb8f4db494a19fb776921 100644 (file)
@@ -19,9 +19,6 @@
 #include "mltdevicecapture.h"
 #include "kdenlivesettings.h"
 #include "definitions.h"
-//#include "recmonitor.h"
-//#include "renderer.h"
-#include "blackmagic/devices.h"
 
 #include <mlt++/Mlt.h>
 
@@ -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 &params, const QString &path, const QString &playlist, int livePreview, bool xmlPlaylist)
+bool MltDeviceCapture::slotStartCapture(const QString &params, const QString &path, const QString &playlist, bool livePreview, bool xmlPlaylist)
 {
     stop();
     m_livePreview = livePreview;
@@ -394,12 +408,34 @@ bool MltDeviceCapture::slotStartCapture(const QString &params, 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: "<<params<<", PATH: "<<path;
+    //m_mltProfile->get_profile()->is_explicit = 1;
+    
+    
+    /*kDebug()<<"-- CREATING CAP: "<<params<<", PATH: "<<path;
     tmp = qstrdup(QString("avformat:" + path).toUtf8().constData());
     m_mltConsumer = new Mlt::Consumer(*m_mltProfile, tmp);
     m_mltConsumer->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 &params, 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 &params, const QString &pa
         m_mltConsumer = NULL;
         return 0;
     }
-    m_captureDisplayWidget->start();
+    m_droppedFramesTimer.start();
     return 1;
 }
 
index 77d285c4e805fc177c0ecaf04381c37883e98482..69ad361e696c55451ad60d552b7e82e569b6aa2c 100644 (file)
@@ -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 &params, const QString &path, const QString &playlist, int livePreview, bool xmlPlaylist = true);
+    bool slotStartCapture(const QString &params, 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.
index 6c08423650288d032d96007c1b8befa96cfc23d6..4caecf7341976cf7cf1887c0ff15cdc0241d2958 100644 (file)
@@ -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();
index 6b29fb76b4509f3475fbc19c5c8bc7f03d7b1346..c6fd3b4af01394e758b6a598d7535234627c60fc 100644 (file)
@@ -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;
index ed21467eb443dd248364d48adffd1d5ea9d3c020..fd462810c549e6515a73c29b9782aea11e749dd0 100644 (file)
@@ -1108,7 +1108,7 @@ void ProjectList::slotRemoveClip()
         } else {
             ProjectItem *item = static_cast <ProjectItem *>(selected.at(i));
             ids << item->clipId();
-            if (item->numReferences() > 0 && KMessageBox::questionYesNo(kapp->activeWindow(), i18np("Delete clip <b>%2</b>?<br />This will also remove the clip in timeline", "Delete clip <b>%2</b>?<br />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 <b>%2</b>?<br />This will also remove the clip in timeline", "Delete clip <b>%2</b>?<br />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;
             }
index 42e1f3a8269f3e2f5d73b8ed3f7cef38c08cad6d..8988df994501fa58ee04cde38725c5d5840244b5 100644 (file)
@@ -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("<producer id=\"producer0\" in=\"0\" out=\"99999\"><property name=\"mlt_type\">producer</property><property name=\"length\">100000</property><property name=\"eof\">pause</property><property name=\"resource\">%1</property><property name=\"mlt_service\">decklink</property></producer>").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"
index 521064621edeac0d94d014e62baec332eba0402b..3324fb8938d38c2f9637d93b985869c0d128440a 100644 (file)
@@ -37,7 +37,6 @@
 
 #include <KIcon>
 #include <KAction>
-#include <KSelectAction>
 #include <KRestrictedLine>
 #include <KDateTime>
 #include <kdeversion.h>
@@ -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);
index f9013313eed535852d4d1d5ff6e7269131bb4866..2f6c0637726bbd9c8ff07d955340e82f97d604b1 100644 (file)
 #include "definitions.h"
 #include "slideshowclip.h"
 #include "profilesdialog.h"
+
+#ifdef USE_BLACKMAGIC
 #include "blackmagic/devices.h"
+#endif
 
 #include <mlt++/Mlt.h>
 
@@ -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();
index f3251fa68306078c26fa9a8a132928e4fa956507..80e807d8684cb3fb85e38b80152ee4f7aaf17eed 100644 (file)
@@ -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