Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
64
67
68private Q_SLOTS:
69 void handleViewfinderFrame();
70 void updateCaptureConnection();
71public Q_SLOTS:
72 void deviceOrientationChanged(int angle = -1);
73
74private:
75 AVFCaptureFramesDelegate *m_viewfinderFramesDelegate = nullptr;
76 AVFCameraSession *m_cameraSession = nullptr;
77 AVCaptureVideoDataOutput *m_videoDataOutput = nullptr;
78
79 bool m_needsHorizontalMirroring = false;
80
81#ifdef Q_OS_IOS
82 CVOpenGLESTextureCacheRef m_textureCache = nullptr;
83#endif
84
85 QVideoFrame m_lastViewfinderFrame;
86 QMutex m_vfMutex;
87 dispatch_queue_t m_delegateQueue;
88 QVideoOutputOrientationHandler m_orientationHandler;
89
90 friend class CVImageVideoBuffer;
91};
92
94
95#endif
void reconfigure() override
void syncHandleViewfinderFrame(const QVideoFrame &frame)
AVFCameraRenderer(QObject *parent=nullptr)
void newViewfinderFrame(const QVideoFrame &frame)
AVCaptureVideoDataOutput * videoDataOutput() const
void setOutputSettings() override
AVFCaptureFramesDelegate * captureDelegate() const
void configureAVCaptureSession(AVFCameraSession *cameraSession)
void setPixelFormat(QVideoFrameFormat::PixelFormat pixelFormat, QVideoFrameFormat::ColorRange colorRange)
void deviceOrientationChanged(int angle=-1)
void resetCaptureDelegate() const
\inmodule QtCore
Definition qmutex.h:281
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
PixelFormat
Enumerates video data types.
ColorRange
Describes the color range used by the video data.
The QVideoFrame class represents a frame of video data.
Definition qvideoframe.h:27
Combined button and popup list for selecting options.
#define Q_FORWARD_DECLARE_OBJC_CLASS(classname)
GLfloat angle
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
QFrame frame
[0]