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;
22}
23
24void EncoderThread::setAutoStop(bool autoStop)
25{
26 auto guard = lockLoopData();
27 m_autoStop = autoStop;
28}
29
31{
32 {
33 auto guard = lockLoopData();
35 }
36
37 emit endOfSourceStream();
38}
39
41{
42 {
43 // Guard to allow checkIfCanPushFrame to check init status
44 auto guard = lockLoopData();
45 m_initialized = true;
46 }
47
49
50 // Following will wait until recording engine confirms all encoders are resolved
51 m_encodingStarted = m_recordingEngine.waitForEncodingStart();
52
53 return true;
54}
55
56void EncoderThread::markResolved(bool succeeded)
57{
58 m_resolvedPromise.addResult(succeeded);
59 m_resolvedPromise.finish();
60}
61
62} // namespace QFFmpeg
63
64QT_END_NAMESPACE
65
66#include "moc_qffmpegencoderthread_p.cpp"
void markResolved(bool succeeded)
virtual void handlePausedChanged(bool)
void setAutoStop(bool autoStop)
bool init() override
Called on this thread when thread starts.
RecordingEngine & m_recordingEngine
Combined button and popup list for selecting options.