Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qffmpegencoderthread.cpp
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#include <QtCore/qmetaobject.h>
6#include <QtFFmpegMediaPluginImpl/private/qffmpegrecordingengine_p.h>
7
9
10namespace QFFmpeg {
11
12EncoderThread::EncoderThread(RecordingEngine &recordingEngine) : m_recordingEngine(recordingEngine)
13{
14 m_resolvedPromise.start();
15}
16
17void EncoderThread::setPaused(bool paused)
18{
19 auto guard = lockLoopData();
20 m_paused = paused;
21}
22
23void EncoderThread::setAutoStop(bool autoStop)
24{
25 auto guard = lockLoopData();
26 m_autoStop = autoStop;
27}
28
30{
31 {
32 auto guard = lockLoopData();
34 }
35
36 emit endOfSourceStream();
37}
38
40{
41 {
42 // Guard to allow checkIfCanPushFrame to check init status
43 auto guard = lockLoopData();
44 m_initialized = true;
45 }
46
48
49 // Following will wait until recording engine confirms all encoders are resolved
50 m_encodingStarted = m_recordingEngine.waitForEncodingStart();
51
52 return true;
53}
54
55void EncoderThread::markResolved(bool succeeded)
56{
57 m_resolvedPromise.addResult(succeeded);
58 m_resolvedPromise.finish();
59}
60
61} // namespace QFFmpeg
62
63QT_END_NAMESPACE
64
65#include "moc_qffmpegencoderthread_p.cpp"
void markResolved(bool succeeded)
void setAutoStop(bool autoStop)
bool init() override
Called on this thread when thread starts.
RecordingEngine & m_recordingEngine
QT_MANGLE_NAMESPACE(QMacScreenCaptureStreamDelegate) QMacScreenCaptureStreamDelegate
Combined button and popup list for selecting options.