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
3
#
include
"qffmpegencoderthread_p.h"
4
5
#
include
<
QtCore
/
qmetaobject
.
h
>
6
#
include
<
QtFFmpegMediaPluginImpl
/
private
/
qffmpegrecordingengine_p
.
h
>
7
8
QT_BEGIN_NAMESPACE
9
10
namespace
QFFmpeg
{
11
12
EncoderThread
::EncoderThread(
RecordingEngine
&recordingEngine) :
m_recordingEngine
(recordingEngine)
13
{
14
m_resolvedPromise.start();
15
}
16
17
void
EncoderThread
::
setPaused
(
bool
paused)
18
{
19
auto
guard = lockLoopData();
20
m_paused
= paused;
21
handlePausedChanged
(
paused
)
;
22
}
23
24
void
EncoderThread
::
setAutoStop
(
bool
autoStop)
25
{
26
auto
guard = lockLoopData();
27
m_autoStop
= autoStop;
28
}
29
30
void
EncoderThread
::
setEndOfSourceStream
()
31
{
32
{
33
auto
guard = lockLoopData();
34
m_endOfSourceStream.store(
true
, std::memory_order_release);
35
}
36
37
Q_EMIT endOfSourceStream();
38
}
39
40
bool
EncoderThread
::
init
()
41
{
42
{
43
// Guard to allow checkIfCanPushFrame to check init status
44
auto
guard = lockLoopData();
45
m_initialized
=
true
;
46
}
47
48
markResolved
(
true
)
;
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
56
void
EncoderThread
::
markResolved
(
bool
succeeded)
57
{
58
m_resolvedPromise.addResult(succeeded);
59
m_resolvedPromise.finish();
60
}
61
62
}
// namespace QFFmpeg
63
64
QT_END_NAMESPACE
65
66
#
include
"moc_qffmpegencoderthread_p.cpp"
QFFmpeg::EncoderThread
Definition
qffmpegencoderthread_p.h:33
QFFmpeg::EncoderThread::setEndOfSourceStream
void setEndOfSourceStream()
Definition
qffmpegencoderthread.cpp:30
QFFmpeg::EncoderThread::m_initialized
bool m_initialized
Definition
qffmpegencoderthread_p.h:88
QFFmpeg::EncoderThread::markResolved
void markResolved(bool succeeded)
Definition
qffmpegencoderthread.cpp:56
QFFmpeg::EncoderThread::m_encodingStarted
bool m_encodingStarted
Definition
qffmpegencoderthread_p.h:89
QFFmpeg::EncoderThread::m_paused
bool m_paused
Definition
qffmpegencoderthread_p.h:85
QFFmpeg::EncoderThread::setPaused
void setPaused(bool paused)
Definition
qffmpegencoderthread.cpp:17
QFFmpeg::EncoderThread::handlePausedChanged
virtual void handlePausedChanged(bool)
Definition
qffmpegencoderthread_p.h:78
QFFmpeg::EncoderThread::setAutoStop
void setAutoStop(bool autoStop)
Definition
qffmpegencoderthread.cpp:24
QFFmpeg::EncoderThread::init
bool init() override
Called on this thread when thread starts.
Definition
qffmpegencoderthread.cpp:40
QFFmpeg::EncoderThread::m_recordingEngine
RecordingEngine & m_recordingEngine
Definition
qffmpegencoderthread_p.h:91
QFFmpeg::EncoderThread::m_autoStop
bool m_autoStop
Definition
qffmpegencoderthread_p.h:87
QFFmpeg::RecordingEngine
Definition
qffmpegrecordingengine_p.h:46
QFFmpeg
Definition
qandroidcacertificates.cpp:26
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtmultimedia
src
plugins
multimedia
ffmpeg
recordingengine
qffmpegencoderthread.cpp
Generated on
for Qt by
1.16.1