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#include "qmetaobject.h"
5
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
27{
28 {
29 auto guard = lockLoopData();
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
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"
void setAutoStop(bool autoStop)
void startEncoding(bool noError)
bool init() override
Called on this thread when thread starts.
RecordingEngine & m_recordingEngine
std::conditional_t< QT_FFMPEG_AVIO_WRITE_CONST, const uint8_t *, uint8_t * > AvioWriteBufferType