]> git.sesse.net Git - kdenlive/commitdiff
Fix rec monitor: http://kdenlive.org/mantis/view.php?id=1870
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 6 Nov 2010 00:22:25 +0000 (00:22 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 6 Nov 2010 00:22:25 +0000 (00:22 +0000)
svn path=/trunk/kdenlive/; revision=5075

src/kdenlivesettings.kcfg
src/kdenlivesettingsdialog.cpp
src/recmonitor.cpp
src/widgets/recmonitor_ui.ui

index c7a5bc15bb04e1a075fc7f2a40852ca4b140d6e3..aa4056fbc66cd6ae4a224b49ceb4264682ca3707 100644 (file)
 
     <entry name="video4vcodec" type="String">
       <label>Default video4linux video codec.</label>
-      <default>mpeg4</default>
+      <default>mjpeg</default>
     </entry>
 
     <entry name="video4acodec" type="String">
 
     <entry name="video4container" type="String">
       <label>Default video4linux format.</label>
-      <default>mpegts</default>
+      <default>avi</default>
     </entry>
 
     <entry name="video4extension" type="String">
       <label>Default video4linux file extension.</label>
-      <default>mp4</default>
+      <default>avi</default>
     </entry>
 
     <entry name="video4aformat" type="String">
index 035408a3319f380fefe8e6e61e3f940a12acac08..6ff9989edeb1abd92873fad020d6cc647e2368a1 100644 (file)
@@ -649,6 +649,7 @@ void KdenliveSettingsDialog::slotUpdatev4lDevice()
     if (!device.isEmpty()) m_configCapture.kcfg_video4vdevice->setText(device);
     QString size = m_configCapture.kcfg_detectedv4ldevices->itemData(m_configCapture.kcfg_detectedv4ldevices->currentIndex(), Qt::UserRole + 1).toString();
     if (!size.isEmpty()) m_configCapture.kcfg_video4size->setText(size);
+    rebuildVideo4Commands();
 }
 
 
index fda324f66d1dfb0b8015a8d5fddcfa4483f3aabc..cfddee22ad68a3b4d42c12c30552b67af0fe35c0 100644 (file)
@@ -185,6 +185,8 @@ void RecMonitor::slotVideoDeviceChanged(int ix)
 {
     QString capturefile;
     QString capturename;
+    video_capture->setHidden(true);
+    video_frame->setHidden(false);
     m_fwdAction->setVisible(ix != BLACKMAGIC);
     m_discAction->setVisible(ix != BLACKMAGIC);
     m_rewAction->setVisible(ix != BLACKMAGIC);
@@ -215,20 +217,18 @@ void RecMonitor::slotVideoDeviceChanged(int ix)
         checkDeviceAvailability();
         break;
     case BLACKMAGIC:
-       createBlackmagicDevice();
+        createBlackmagicDevice();
         m_recAction->setEnabled(false);
         m_stopAction->setEnabled(false);
         m_playAction->setEnabled(true);
-       video_capture->setHidden(true);
-       video_frame->setHidden(false);
 
-       capturefile = m_capturePath;
+        capturefile = m_capturePath;
         if (!capturefile.endsWith("/")) capturefile.append("/");
-       capturename = KdenliveSettings::hdmifilename();
-       capturename.append("xxx.raw");
-        capturefile.append(capturename);           
-       video_frame->setPixmap(mergeSideBySide(KIcon("camera-photo").pixmap(QSize(50, 50)), i18n("Plug your camcorder and\npress play button\nto start preview.\nFiles will be saved in:\n%1", capturefile)));
-       break;
+        capturename = KdenliveSettings::hdmifilename();
+        capturename.append("xxx.raw");
+        capturefile.append(capturename);
+        video_frame->setPixmap(mergeSideBySide(KIcon("camera-photo").pixmap(QSize(50, 50)), i18n("Plug your camcorder and\npress play button\nto start preview.\nFiles will be saved in:\n%1", capturefile)));
+        break;
     default: // FIREWIRE
         m_discAction->setEnabled(true);
         m_recAction->setEnabled(false);
@@ -271,14 +271,14 @@ void RecMonitor::slotVideoDeviceChanged(int ix)
 
 void RecMonitor::createBlackmagicDevice()
 {
-       //video_capture->setVisible(true);
-       if (m_bmCapture == NULL) {
-           QVBoxLayout *lay = new QVBoxLayout;
-           m_bmCapture = new BmdCaptureHandler(lay);
-           connect(m_bmCapture, SIGNAL(gotTimeCode(ulong)), this, SLOT(slotGotBlackMagicFrameNumber(ulong)));
-           connect(m_bmCapture, SIGNAL(gotMessage(const QString &)), this, SLOT(slotGotBlackmagicMessage(const QString &)));
-           video_capture->setLayout(lay);
-       }
+    //video_capture->setVisible(true);
+    if (m_bmCapture == NULL) {
+        QVBoxLayout *lay = new QVBoxLayout;
+        m_bmCapture = new BmdCaptureHandler(lay);
+        connect(m_bmCapture, SIGNAL(gotTimeCode(ulong)), this, SLOT(slotGotBlackMagicFrameNumber(ulong)));
+        connect(m_bmCapture, SIGNAL(gotMessage(const QString &)), this, SLOT(slotGotBlackmagicMessage(const QString &)));
+        video_capture->setLayout(lay);
+    }
 }
 
 void RecMonitor::slotGotBlackmagicFrameNumber(ulong ix)
@@ -356,6 +356,8 @@ void RecMonitor::slotForward()
 void RecMonitor::slotStopCapture()
 {
     // stop capture
+    video_capture->setHidden(true);
+    video_frame->setHidden(false);
     switch (device_selector->currentIndex()) {
     case FIREWIRE:
         m_captureProcess->write("\e", 2);
@@ -368,13 +370,11 @@ void RecMonitor::slotStopCapture()
         QTimer::singleShot(1000, m_captureProcess, SLOT(kill()));
         break;
     case BLACKMAGIC:
-       video_capture->setHidden(true);
-       video_frame->setHidden(false);
-       m_bmCapture->stopPreview();
-       m_playAction->setEnabled(true);
-       m_stopAction->setEnabled(false);
-       m_recAction->setEnabled(false);
-       break;
+        m_bmCapture->stopPreview();
+        m_playAction->setEnabled(true);
+        m_stopAction->setEnabled(false);
+        m_recAction->setEnabled(false);
+        break;
     default:
         break;
     }
@@ -402,6 +402,8 @@ void RecMonitor::slotStartCapture(bool play)
     m_isPlaying = false;
     QString capturename = KdenliveSettings::dvgrabfilename();
     QStringList dvargs = KdenliveSettings::dvgrabextra().simplified().split(" ", QString::SkipEmptyParts);
+    video_capture->setVisible(device_selector->currentIndex() == BLACKMAGIC);
+    video_frame->setHidden(device_selector->currentIndex() == BLACKMAGIC);
 
     switch (device_selector->currentIndex()) {
     case FIREWIRE:
@@ -454,13 +456,11 @@ void RecMonitor::slotStartCapture(bool play)
         m_captureProcess->start("ffmpeg", m_captureArgs);
         break;
     case BLACKMAGIC:
-       video_capture->setVisible(true);
-       video_frame->setHidden(true);
-       m_bmCapture->startPreview(KdenliveSettings::hdmi_capturedevice(), KdenliveSettings::hdmi_capturemode());
-       m_playAction->setEnabled(false);
-       m_stopAction->setEnabled(true);
-       m_recAction->setEnabled(true);
-       break;
+        m_bmCapture->startPreview(KdenliveSettings::hdmi_capturedevice(), KdenliveSettings::hdmi_capturemode());
+        m_playAction->setEnabled(false);
+        m_stopAction->setEnabled(true);
+        m_recAction->setEnabled(true);
+        break;
     default:
         break;
     }
@@ -477,22 +477,21 @@ void RecMonitor::slotStartCapture(bool play)
 void RecMonitor::slotRecord()
 {
     if (device_selector->currentIndex() == BLACKMAGIC) {
-       if (m_blackmagicCapturing) {
-           // We are capturing, stop it
-           m_bmCapture->stopCapture();
-           m_blackmagicCapturing = false;
-       }
-       else {
-           // Start capture, get capture filename first
-           QString path = m_capturePath;
-           if (!path.endsWith("/")) path.append("/");
-           path.append(KdenliveSettings::hdmifilename());
-           m_bmCapture->startCapture(path);
-           m_blackmagicCapturing = true;
-       }
-       return;
+        if (m_blackmagicCapturing) {
+            // We are capturing, stop it
+            m_bmCapture->stopCapture();
+            m_blackmagicCapturing = false;
+        } else {
+            // Start capture, get capture filename first
+            QString path = m_capturePath;
+            if (!path.endsWith("/")) path.append("/");
+            path.append(KdenliveSettings::hdmifilename());
+            m_bmCapture->startCapture(path);
+            m_blackmagicCapturing = true;
+        }
+        return;
     }
-  
+
     if (m_captureProcess->state() == QProcess::NotRunning && device_selector->currentIndex() == FIREWIRE) {
         slotStartCapture();
     }
index 3de6baac953a07d154d4f7126ebd94bab051e6aa..7a2a4c31b2de5be697d0201920e27a4ea0d3c6d2 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>293</width>
-    <height>250</height>
+    <width>210</width>
+    <height>152</height>
    </rect>
   </property>
   <layout class="QGridLayout" name="gridLayout">
    </property>
    <item row="0" column="0" colspan="3">
     <widget class="QFrame" name="video_capture">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
      <property name="frameShape">
       <enum>QFrame::NoFrame</enum>
      </property>
      </property>
     </widget>
    </item>
-   <item row="1" column="1">
+   <item row="1" column="0" colspan="3">
     <widget class="QLabel" name="video_frame">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
      <property name="text">
       <string>Not connected</string>
      </property>