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
qandroidimagecapture.cpp
Go to the documentation of this file.
1
// Copyright (C) 2023 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
/
qandroidimagecapture_p
.
h
>
5
6
#
include
<
QtFFmpegMediaPluginImpl
/
private
/
qandroidcamera_p
.
h
>
7
8
QT_BEGIN_NAMESPACE
9
10
namespace
QFFmpeg
{
11
12
QAndroidImageCapture
::
QAndroidImageCapture
(
QImageCapture
*
parent
)
13
:
QFFmpegImageCapture
(
parent
)
14
{
15
connect
(
this
, &
QPlatformImageCapture
::
imageSaved
,
this
, &
QAndroidImageCapture
::
updateExif
);
16
}
17
18
QAndroidImageCapture
::~
QAndroidImageCapture
()
19
{
20
}
21
22
int
QAndroidImageCapture
::
doCapture
(
const
QString
&
fileName
)
23
{
24
auto
ret
=
QFFmpegImageCapture
::
doCapture
(
fileName
);
25
if
(
ret
>= 0) {
26
auto
androidCamera
=
qobject_cast
<
QAndroidCamera
*>(
videoSource
());
27
if
(
androidCamera
)
28
androidCamera
->
capture
();
29
}
30
31
return
ret
;
32
}
33
34
void
QAndroidImageCapture
::
setupVideoSourceConnections
()
35
{
36
auto
androidCamera
=
qobject_cast
<
QAndroidCamera
*>(
videoSource
());
37
if
(
androidCamera
) {
38
connect
(
39
androidCamera
,
40
&
QAndroidCamera
::
onStillPhotoCaptured
,
41
this
,
42
&
QAndroidImageCapture
::
newVideoFrame
);
43
44
// The backend might call onImageCaptureFailed before the call to
45
// QAndroidImageCapture::doCapture() is finished and returns the request id to the user.
46
// Therefore we want to use queued connection for this to make sure any errors are raised
47
// after that function ends.
48
connect
(
49
androidCamera
,
50
&
QAndroidCamera
::
onImageCaptureFailed
,
51
this
,
52
&
QFFmpegImageCapture
::
cancelPendingImage
,
53
Qt
::
QueuedConnection
);
54
}
55
else
56
QFFmpegImageCapture
::
setupVideoSourceConnections
();
57
}
58
59
void
QAndroidImageCapture
::
updateExif
(
int
id
,
const
QString
&
filename
)
60
{
61
Q_UNUSED
(
id
);
62
auto
androidCamera
=
qobject_cast
<
QAndroidCamera
*>(
videoSource
());
63
if
(
androidCamera
)
64
androidCamera
->
updateExif
(
filename
);
65
}
66
67
}
// namespace QFFmpeg
QFFmpeg::AvioWriteBufferType
std::conditional_t< QT_FFMPEG_AVIO_WRITE_CONST, const uint8_t *, uint8_t * > AvioWriteBufferType
Definition
qffmpegioutils_p.h:29
qtmultimedia
src
plugins
multimedia
ffmpeg
android
qandroidimagecapture.cpp
Generated on
for Qt by
1.14.0