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
qavfimagecapture.mm
Go to the documentation of this file.
1
// Copyright (C) 2025 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
4
#
include
<
QtFFmpegMediaPluginImpl
/
private
/
qavfimagecapture_p
.
h
>
5
6
#
include
<
QtFFmpegMediaPluginImpl
/
private
/
qavfcamera_p
.
h
>
7
#
include
<
QtFFmpegMediaPluginImpl
/
private
/
qffmpegdarwinintegrationfactory_p
.
h
>
8
9
#
include
<
QtCore
/
qloggingcategory
.
h
>
10
11
QT_BEGIN_NAMESPACE
12
13
Q_LOGGING_CATEGORY
(qAvfImageCaptureLc,
"qt.multimedia.avfimagecapture"
);
14
15
namespace
QFFmpeg
{
16
17
QAVFImageCapture
::
QAVFImageCapture
(
QImageCapture
&
parent
)
18
:
QFFmpegImageCapture
(&
parent
)
19
{
20
}
21
22
int
QAVFImageCapture
::
doCapture
(
const
QString
&
fileName
)
23
{
24
int
ret
=
QFFmpegImageCapture
::
doCapture
(
fileName
);
25
if
(
ret
>= 0) {
26
if
(
QAVFCamera
*
avfCamera
=
qobject_cast
<
QAVFCamera
*>(
videoSource
())) {
27
q23
::
expected
<
void
,
QString
>
result
=
avfCamera
->
requestStillPhotoCapture
();
28
if
(!
result
) {
29
QFFmpegImageCapture
::
cancelPendingImage
(
30
QImageCapture
::
Error
::
ResourceError
,
31
result
.
error
());
32
}
33
}
34
}
35
36
return
ret
;
37
}
38
39
void
QAVFImageCapture
::
setupVideoSourceConnections
()
40
{
41
if
(
QAVFCamera
*
avfCamera
=
qobject_cast
<
QAVFCamera
*>(
videoSource
())) {
42
connect
(
43
avfCamera
,
44
&
QAVFCamera
::
stillPhotoSucceeded
,
45
this
,
46
&
QAVFImageCapture
::
newVideoFrame
);
47
48
connect
(
49
avfCamera
,
50
&
QAVFCamera
::
stillPhotoFailed
,
51
this
,
52
&
QFFmpegImageCapture
::
cancelPendingImage
);
53
}
54
else
{
55
QFFmpegImageCapture
::
setupVideoSourceConnections
();
56
}
57
}
58
59
std
::
unique_ptr
<
QPlatformImageCapture
>
makeQAvfImageCapture
(QImageCapture &parent)
60
{
61
return
std::make_unique<QAVFImageCapture>(parent);
62
}
63
64
}
// namespace QFFmpeg
65
66
QT_END_NAMESPACE
QFFmpeg::makeQAvfImageCapture
std::unique_ptr< QPlatformImageCapture > makeQAvfImageCapture(QImageCapture &parent)
Definition
qavfimagecapture.mm:59
QFFmpeg::AvioWriteBufferType
std::conditional_t< QT_FFMPEG_AVIO_WRITE_CONST, const uint8_t *, uint8_t * > AvioWriteBufferType
Definition
qffmpegioutils_p.h:29
Q_LOGGING_CATEGORY
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")
qtmultimedia
src
plugins
multimedia
ffmpeg
darwin
qavfimagecapture.mm
Generated on
for Qt by
1.16.1