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
qavfcamerarotationtracker_p.h
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
#
ifndef
QAVFCAMERAROTATIONTRACKER_P_H
5
#
define
QAVFCAMERAROTATIONTRACKER_P_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists purely as an
12
// implementation detail. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
19
#
include
<
QtCore
/
qtclasshelpermacros
.
h
>
20
#
include
<
QtCore
/
qtconfigmacros
.
h
>
21
#
include
<
QtCore
/
qdarwinhelpers
.
h
>
22
23
#
include
<
os
/
availability
.
h
>
24
25
#
include
<
AVFoundation
/
AVCaptureDevice
.
h
>
26
27
QT_BEGIN_NAMESPACE
28
29
namespace
QFFmpeg
{
30
31
// Gives us rotational information for an AVCaptureDevice
32
class
AvfCameraRotationTracker
33
{
34
public
:
35
AvfCameraRotationTracker
() =
default
;
36
explicit
AvfCameraRotationTracker
(AVCaptureDevice* avCaptureDevice);
37
AvfCameraRotationTracker
(
AvfCameraRotationTracker
&&)
noexcept
;
38
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP
(
AvfCameraRotationTracker
)
39
~
AvfCameraRotationTracker
();
40
41
void
swap
(
AvfCameraRotationTracker
&other);
42
43
// Guaranteed to return rotation in clockwise 90 degree increments.
44
[[
nodiscard
]]
int
rotationDegrees
()
const
;
45
46
[[
nodiscard
]]
AVCaptureDevice
*
avCaptureDevice
()
const
{
return
m_avCaptureDevice; }
47
48
private
:
49
void
clear();
50
51
AVCaptureDevice* m_avCaptureDevice =
nullptr
;
52
53
// If running iOS 17+ or macOS 14+, we use AVCaptureDeviceRotationCoordinator
54
// to get the camera rotation directly from the camera-device.
55
API_AVAILABLE(macos(14.0), ios(17.0))
56
AVCaptureDeviceRotationCoordinator
*
m_avRotationCoordinator
=
nullptr
;
57
58
#
ifdef
Q_OS_IOS
59
// If running iOS 16 or older, we use the UIDeviceOrientation
60
// and the AVCaptureCameraPosition to apply rotation metadata
61
// to the cameras frames.
62
//
63
// TODO: New bug reports implies this approach is not sufficient for iOS 16.
64
bool
m_receivingUiDeviceOrientationNotifications
=
false
;
65
#
endif
66
};
67
68
}
// namespace QFFmpeg
69
70
QT_END_NAMESPACE
71
72
#
endif
// QAVFCAMERAROTATIONTRACKER_P_H
QFFmpeg::AvfCameraRotationTracker
Definition
qavfcamerarotationtracker_p.h:33
QFFmpeg::AvfCameraRotationTracker::AvfCameraRotationTracker
AvfCameraRotationTracker()=default
QFFmpeg::AvfCameraRotationTracker::rotationDegrees
int rotationDegrees() const
Definition
qavfcamerarotationtracker.mm:112
QFFmpeg::AvfCameraRotationTracker::swap
void swap(AvfCameraRotationTracker &other)
Definition
qavfcamerarotationtracker.mm:77
QFFmpeg::AvfCameraRotationTracker::AvfCameraRotationTracker
AvfCameraRotationTracker(AvfCameraRotationTracker &&) noexcept
Definition
qavfcamerarotationtracker.mm:60
QFFmpeg::AvfCameraRotationTracker::AvfCameraRotationTracker
AvfCameraRotationTracker(AVCaptureDevice *avCaptureDevice)
Definition
qavfcamerarotationtracker.mm:39
QFFmpeg::AvfCameraRotationTracker::avCaptureDevice
AVCaptureDevice * avCaptureDevice() const
Definition
qavfcamerarotationtracker_p.h:46
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
darwin
qavfcamerarotationtracker_p.h
Generated on
for Qt by
1.14.0