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
#
include
<
QtCore
/
qtclasshelpermacros
.
h
>
19
#
include
<
QtCore
/
qtconfigmacros
.
h
>
20
#
include
<
QtCore
/
qdarwinhelpers
.
h
>
21
22
#
include
<
QtMultimedia
/
private
/
qavfcamerautility_p
.
h
>
23
24
#
include
<
os
/
availability
.
h
>
25
26
#
include
<
AVFoundation
/
AVCaptureDevice
.
h
>
27
28
QT_BEGIN_NAMESPACE
29
30
namespace
QFFmpeg
{
31
32
// Gives us rotational information for an AVCaptureDevice
33
class
AvfCameraRotationTracker
34
{
35
public
:
36
AvfCameraRotationTracker
() =
default
;
37
explicit
AvfCameraRotationTracker
(AVCaptureDevice* avCaptureDevice);
38
AvfCameraRotationTracker
(
AvfCameraRotationTracker
&&)
noexcept
;
39
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP
(
AvfCameraRotationTracker
)
40
~
AvfCameraRotationTracker
();
41
42
void
swap
(
AvfCameraRotationTracker
&other);
43
44
// Guaranteed to return rotation in clockwise 90 degree increments.
45
[[nodiscard]]
int
rotationDegrees
()
const
;
46
47
[[nodiscard]]
AVCaptureDevice
*
avCaptureDevice
()
const
{
return
m_avCaptureDevice.data(); }
48
49
private
:
50
void
clear();
51
52
AVFScopedPointer<AVCaptureDevice> m_avCaptureDevice;
53
54
// If running iOS or macOS 14+, we use AVCaptureDeviceRotationCoordinator
55
// to get the camera rotation directly from the camera-device.
56
API_AVAILABLE(macos(14.0))
57
AVFScopedPointer
<
AVCaptureDeviceRotationCoordinator
>
m_avRotationCoordinator
;
58
};
59
60
}
// namespace QFFmpeg
61
62
QT_END_NAMESPACE
63
64
#
endif
// QAVFCAMERAROTATIONTRACKER_P_H
QFFmpeg::AvfCameraRotationTracker
Definition
qavfcamerarotationtracker_p.h:34
QFFmpeg::AvfCameraRotationTracker::AvfCameraRotationTracker
AvfCameraRotationTracker()=default
QFFmpeg::AvfCameraRotationTracker::rotationDegrees
int rotationDegrees() const
Definition
qavfcamerarotationtracker.mm:63
QFFmpeg::AvfCameraRotationTracker::swap
void swap(AvfCameraRotationTracker &other)
Definition
qavfcamerarotationtracker.mm:43
QFFmpeg::AvfCameraRotationTracker::AvfCameraRotationTracker
AvfCameraRotationTracker(AvfCameraRotationTracker &&) noexcept
Definition
qavfcamerarotationtracker.mm:30
QFFmpeg::AvfCameraRotationTracker::AvfCameraRotationTracker
AvfCameraRotationTracker(AVCaptureDevice *avCaptureDevice)
Definition
qavfcamerarotationtracker.mm:16
QFFmpeg::AvfCameraRotationTracker::avCaptureDevice
AVCaptureDevice * avCaptureDevice() const
Definition
qavfcamerarotationtracker_p.h:47
QFFmpeg
Definition
qandroidcacertificates.cpp:26
qtmultimedia
src
plugins
multimedia
ffmpeg
darwin
qavfcamerarotationtracker_p.h
Generated on
for Qt by
1.16.1