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
3#include "qffmpegencoderthread_p.h"
4#include "qmetaobject.h"
5
6QT_BEGIN_NAMESPACE
7
8namespace QFFmpeg {
9
10EncoderThread::EncoderThread(RecordingEngine &recordingEngine) : m_recordingEngine(recordingEngine)
11{
12}
13
14void EncoderThread::setPaused(bool paused)
15{
16 auto guard = lockLoopData();
17 m_paused = paused;
18}
19
20void EncoderThread::setAutoStop(bool autoStop)
21{
22 auto guard = lockLoopData();
23 m_autoStop = autoStop;
24}
25
26void EncoderThread::setEndOfSourceStream()
27{
28 {
29 auto guard = lockLoopData();
30 m_endOfSourceStream = true;
31 }
32
33 emit endOfSourceStream();
34}
35
36void EncoderThread::startEncoding(bool noError)
37{
38 Q_ASSERT(!m_encodingStarted);
39
40 m_encodingStarted = noError;
41 m_encodingStartSemaphore.release();
42}
43
44bool EncoderThread::init()
45{
46 m_initialized = true;
47 emit initialized();
48 m_encodingStartSemaphore.acquire();
49 return true;
50}
51
52} // namespace QFFmpeg
53
54QT_END_NAMESPACE
55
56#include "moc_qffmpegencoderthread_p.cpp"
57

source code of qtmultimedia/src/plugins/multimedia/ffmpeg/recordingengine/qffmpegencoderthread.cpp