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
28QT_BEGIN_NAMESPACE
29
30namespace QFFmpeg {
31
32// Gives us rotational information for an AVCaptureDevice
34{
35public:
37 explicit AvfCameraRotationTracker(AVCaptureDevice* avCaptureDevice);
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
49private:
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))
58};
59
60} // namespace QFFmpeg
61
62QT_END_NAMESPACE
63
64#endif // QAVFCAMERAROTATIONTRACKER_P_H
void swap(AvfCameraRotationTracker &other)
AvfCameraRotationTracker(AvfCameraRotationTracker &&) noexcept
AvfCameraRotationTracker(AVCaptureDevice *avCaptureDevice)
std::conditional_t< QT_FFMPEG_AVIO_WRITE_CONST, const uint8_t *, uint8_t * > AvioWriteBufferType