Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
avfcamerarenderer_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 AVFCAMERARENDERER_H
5#define AVFCAMERARENDERER_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/qobject.h>
19#include <QtMultimedia/qvideoframe.h>
20#include <QtCore/qmutex.h>
21#include <avfvideosink_p.h>
22#include <private/qvideooutputorientationhandler_p.h>
23
24#include <CoreVideo/CVBase.h>
25#include <CoreVideo/CVPixelBuffer.h>
26#include <CoreVideo/CVImageBuffer.h>
27#ifdef Q_OS_IOS
28#include <CoreVideo/CVOpenGLESTexture.h>
29#include <CoreVideo/CVOpenGLESTextureCache.h>
30#endif
31
32#include <dispatch/dispatch.h>
33
35Q_FORWARD_DECLARE_OBJC_CLASS(AVCaptureVideoDataOutput);
36
38
42class AVFVideoSink;
43
45{
47public:
50
51 void reconfigure() override;
52 void setOutputSettings() override;
53
56
57 AVCaptureVideoDataOutput *videoDataOutput() const;
58
60 void resetCaptureDelegate() const;
61
63
66
67private Q_SLOTS:
68 void handleViewfinderFrame();
69 void updateCaptureConnection();
70public Q_SLOTS:
71 void deviceOrientationChanged(int angle = -1);
72
73private:
74 AVFCaptureFramesDelegate *m_viewfinderFramesDelegate = nullptr;
75 AVFCameraSession *m_cameraSession = nullptr;
76 AVCaptureVideoDataOutput *m_videoDataOutput = nullptr;
77
78 bool m_needsHorizontalMirroring = false;
79
80#ifdef Q_OS_IOS
81 CVOpenGLESTextureCacheRef m_textureCache = nullptr;
82#endif
83
84 QVideoFrame m_lastViewfinderFrame;
85 QMutex m_vfMutex;
86 dispatch_queue_t m_delegateQueue;
87 QVideoOutputOrientationHandler m_orientationHandler;
88
89 friend class CVImageVideoBuffer;
90};
91
93
94#endif
void reconfigure() override
void syncHandleViewfinderFrame(const QVideoFrame &frame)
friend class CVImageVideoBuffer
void newViewfinderFrame(const QVideoFrame &frame)
AVCaptureVideoDataOutput * videoDataOutput() const
void setOutputSettings() override
void setPixelFormat(const QVideoFrameFormat::PixelFormat format)
AVFCaptureFramesDelegate * captureDelegate() const
void configureAVCaptureSession(AVFCameraSession *cameraSession)
void deviceOrientationChanged(int angle=-1)
void resetCaptureDelegate() const
\inmodule QtCore
Definition qmutex.h:285
\inmodule QtCore
Definition qobject.h:90
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:311
PixelFormat
Enumerates video data types.
The QVideoFrame class represents a frame of video data.
Definition qvideoframe.h:26
Combined button and popup list for selecting options.
#define Q_FORWARD_DECLARE_OBJC_CLASS(classname)
GLfloat angle
GLint GLsizei GLsizei GLenum format
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
QFrame frame
[0]