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
#
include
<
QtFFmpegMediaPluginImpl
/
private
/
qavfcamera_p
.
h
>
6
7
#
include
<
QtCore
/
qloggingcategory
.
h
>
8
9
QT_BEGIN_NAMESPACE
10
11
Q_LOGGING_CATEGORY
(qAvfImageCaptureLc,
"qt.multimedia.avfimagecapture"
);
12
13
namespace
QFFmpeg
{
14
15
QAVFImageCapture
::
QAVFImageCapture
(
QImageCapture
*
parent
)
16
:
QFFmpegImageCapture
(
parent
)
17
{
18
}
19
20
int
QAVFImageCapture
::
doCapture
(
const
QString
&
fileName
)
21
{
22
int
ret
=
QFFmpegImageCapture
::
doCapture
(
fileName
);
23
if
(
ret
>= 0) {
24
if
(
QAVFCamera
*
avfCamera
=
qobject_cast
<
QAVFCamera
*>(
videoSource
())) {
25
q23
::
expected
<
void
,
QString
>
result
=
avfCamera
->
requestStillPhotoCapture
();
26
if
(!
result
) {
27
QFFmpegImageCapture
::
cancelPendingImage
(
28
QImageCapture
::
Error
::
ResourceError
,
29
result
.
error
());
30
}
31
}
32
}
33
34
return
ret
;
35
}
36
37
void
QAVFImageCapture
::
setupVideoSourceConnections
()
38
{
39
if
(
QAVFCamera
*
avfCamera
=
qobject_cast
<
QAVFCamera
*>(
videoSource
())) {
40
connect
(
41
avfCamera
,
42
&
QAVFCamera
::
stillPhotoSucceeded
,
43
this
,
44
&
QAVFImageCapture
::
newVideoFrame
);
45
46
connect
(
47
avfCamera
,
48
&
QAVFCamera
::
stillPhotoFailed
,
49
this
,
50
&
QFFmpegImageCapture
::
cancelPendingImage
);
51
}
52
else
{
53
QFFmpegImageCapture
::
setupVideoSourceConnections
();
54
}
55
}
56
57
}
// namespace QFFmpeg
58
59
QT_END_NAMESPACE
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.14.0