MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / run

Method run

Src/RecordVideo.cpp:28–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28void CRecordVideoThread::run()
29{
30 bool check = false;
31 qDebug(logThread) << "Record video thread start ...";
32 CRecordVideo record;
33 int nRet = record.Start(m_szFile);
34 if(nRet) {
35 qCritical(logThread) << "Start record fail:" << nRet;
36 emit sigStatusChanged(CFrmViewer::RecordVideoStatus::Error);
37 return;
38 }
39 check = connect(&record, SIGNAL(sigStatusChanged(CFrmViewer::RecordVideoStatus)),
40 this, SIGNAL(sigStatusChanged(CFrmViewer::RecordVideoStatus)));
41 Q_ASSERT(check);
42 check = connect(this, SIGNAL(sigUpdate(QImage)),
43 &record, SLOT(slotUpdate(QImage)));
44 Q_ASSERT(check);
45 check = connect(&record, SIGNAL(sigError(int,QString)),
46 this, SIGNAL(sigError(int,QString)));
47 Q_ASSERT(check);
48 emit sigStatusChanged(CFrmViewer::RecordVideoStatus::Recording);
49
50 exec();
51
52 nRet = record.Stop();
53 if(nRet) {
54 qCritical(logThread) << "Stop record fail:" << nRet;
55 emit sigStatusChanged(CFrmViewer::RecordVideoStatus::Error);
56 }
57 else
58 emit sigStatusChanged(CFrmViewer::RecordVideoStatus::Stop);
59 qDebug(logThread) << "Record video thread end";
60}
61
62CRecordVideo::CRecordVideo(QObject *parent)
63 : QObject{parent}

Callers

nothing calls this directly

Calls 2

StartMethod · 0.45
StopMethod · 0.45

Tested by

no test coverage detected