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

Method slotRecord

Plugins/Player/BackendPlayer.cpp:279–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277
278#if HAVE_QT6_RECORD
279void CBackendPlayer::slotRecord(bool bRecord)
280{
281 qDebug(log) << Q_FUNC_INFO << bRecord;
282
283 if(bRecord) {
284 if(QMediaRecorder::StoppedState != m_Recorder.recorderState()) {
285 return;
286 }
287
288 auto &record = m_pParameters->m_Record;
289 switch (m_pParameters->GetType()) {
290 case CParameterPlayer::TYPE::Camera: {
291 record >> m_Recorder;
292 m_CaptureSession.setRecorder(&m_Recorder);
293 m_Recorder.record();
294 break;
295 }
296 case CParameterPlayer::TYPE::Url: {
297 record >> m_Recorder;
298 if(record.GetEnableAudio()) {
299 m_CaptureSession.setAudioBufferInput(&m_AudioBufferInput);
300 } else
301 qDebug(log) << "Record: disable audio";
302 if(record.GetEnableVideo())
303 m_CaptureSession.setVideoFrameInput(&m_VideoFrameInput);
304 else
305 qDebug(log) << "Record: disable video";
306 m_CaptureSession.setRecorder(&m_Recorder);
307 m_Recorder.record();
308 break;
309 }
310 default:
311 break;
312 }
313#ifndef HAVE_QVideoWidget
314 emit sigRecordVideo(bRecord, m_pParameters->m_Record.GetVideoFrameRate());
315#endif
316 return;
317 }
318
319 if(QMediaRecorder::StoppedState != m_Recorder.recorderState()) {
320 m_Recorder.stop();
321 m_CaptureSession.setRecorder(nullptr);
322 m_CaptureSession.setVideoFrameInput(nullptr);
323 m_CaptureSession.setAudioBufferInput(nullptr);
324 }
325}
326#endif
327
328void CBackendPlayer::slotClipBoardChanged()

Callers

nothing calls this directly

Calls 5

GetEnableAudioMethod · 0.80
GetEnableVideoMethod · 0.80
GetVideoFrameRateMethod · 0.80
stopMethod · 0.80
GetTypeMethod · 0.45

Tested by

no test coverage detected