m_didCapture(false),
m_isPlaying(false),
m_bmCapture(NULL),
- m_hdmiCapturing(false)
+ m_blackmagicCapturing(false)
{
setupUi(this);
{
QString capturefile;
QString capturename;
- m_fwdAction->setVisible(ix != HDMI);
- m_discAction->setVisible(ix != HDMI);
- m_rewAction->setVisible(ix != HDMI);
- m_logger.setVisible(ix == HDMI);
+ video_capture->setHidden(true);
+ video_frame->setHidden(false);
+ m_fwdAction->setVisible(ix != BLACKMAGIC);
+ m_discAction->setVisible(ix != BLACKMAGIC);
+ m_rewAction->setVisible(ix != BLACKMAGIC);
+ m_logger.setVisible(ix == BLACKMAGIC);
switch (ix) {
case SCREENGRAB:
m_discAction->setEnabled(false);
m_playAction->setEnabled(true);
checkDeviceAvailability();
break;
- case HDMI:
- createHDMIDevice();
+ case BLACKMAGIC:
+ 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);
}
}
-void RecMonitor::createHDMIDevice()
+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(slotGotHDMIFrameNumber(ulong)));
- connect(m_bmCapture, SIGNAL(gotMessage(const QString &)), this, SLOT(slotGotHDMIMessage(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::slotGotHDMIFrameNumber(ulong ix)
+void RecMonitor::slotGotBlackmagicFrameNumber(ulong ix)
{
m_dvinfo.setText(QString::number(ix));
}
-void RecMonitor::slotGotHDMIMessage(const QString &message)
+void RecMonitor::slotGotBlackmagicMessage(const QString &message)
{
m_logger.insertItem(0, message);
}
void RecMonitor::slotStopCapture()
{
// stop capture
+ video_capture->setHidden(true);
+ video_frame->setHidden(false);
switch (device_selector->currentIndex()) {
case FIREWIRE:
m_captureProcess->write("\e", 2);
m_captureProcess->write("q\n", 3);
QTimer::singleShot(1000, m_captureProcess, SLOT(kill()));
break;
- case HDMI:
- video_capture->setHidden(true);
- video_frame->setHidden(false);
- m_bmCapture->stopPreview();
- m_playAction->setEnabled(true);
- m_stopAction->setEnabled(false);
- m_recAction->setEnabled(false);
- break;
+ case BLACKMAGIC:
+ m_bmCapture->stopPreview();
+ m_playAction->setEnabled(true);
+ m_stopAction->setEnabled(false);
+ m_recAction->setEnabled(false);
+ break;
default:
break;
}
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:
case 3:
// HDV CAPTURE
m_captureArgs << "--format" << "hdv";
- m_displayArgs << "-f" << KdenliveSettings::video4container();
+ m_displayArgs << "-f" << "mpegts";
break;
}
if (KdenliveSettings::firewireautosplit()) m_captureArgs << "--autosplit";
kDebug() << "Capture: Running ffmpeg " << m_captureArgs.join(" ");
m_captureProcess->start("ffmpeg", m_captureArgs);
break;
- case HDMI:
- video_capture->setVisible(true);
- video_frame->setHidden(true);
- m_bmCapture->startPreview(KdenliveSettings::hdmicapturedevice(), KdenliveSettings::hdmicapturemode());
- m_playAction->setEnabled(false);
- m_stopAction->setEnabled(true);
- m_recAction->setEnabled(true);
- break;
+ case BLACKMAGIC:
+ m_bmCapture->startPreview(KdenliveSettings::hdmi_capturedevice(), KdenliveSettings::hdmi_capturemode());
+ m_playAction->setEnabled(false);
+ m_stopAction->setEnabled(true);
+ m_recAction->setEnabled(true);
+ break;
default:
break;
}
void RecMonitor::slotRecord()
{
- if (device_selector->currentIndex() == HDMI) {
- if (m_hdmiCapturing) {
- // We are capturing, stop it
- m_bmCapture->stopCapture();
- m_hdmiCapturing = 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_hdmiCapturing = true;
- }
- return;
+ 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_captureProcess->state() == QProcess::NotRunning && device_selector->currentIndex() == FIREWIRE) {
slotStartCapture();
}