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
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
36
37QT_BEGIN_NAMESPACE
38
39class AVFCameraSession;
42class AVFVideoSink;
43
45{
47public:
50
51 void reconfigure() override;
52 void setOutputSettings() override;
53
55 void syncHandleViewfinderFrame(const QVideoFrame &frame);
56
58
60 void resetCaptureDelegate() const;
61
62 void setPixelFormat(QVideoFrameFormat::PixelFormat pixelFormat,
63 QVideoFrameFormat::ColorRange colorRange);
64
67
68private Q_SLOTS:
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
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
93QT_END_NAMESPACE
94
95#endif
Q_FORWARD_DECLARE_OBJC_CLASS(AVCaptureVideoDataOutput)
Q_FORWARD_DECLARE_OBJC_CLASS(AVFCaptureFramesDelegate)
void reconfigure() override
void syncHandleViewfinderFrame(const QVideoFrame &frame)
AVCaptureVideoDataOutput * videoDataOutput() const
void setOutputSettings() override
~AVFCameraRenderer() override
AVFCaptureFramesDelegate * captureDelegate() const
void configureAVCaptureSession(AVFCameraSession *cameraSession)
void setPixelFormat(QVideoFrameFormat::PixelFormat pixelFormat, QVideoFrameFormat::ColorRange colorRange)
void resetCaptureDelegate() const
AVFMediaEncoder * recorderControl() const
QPlatformAudioOutput * audioOutput()
void setAudioInput(QPlatformAudioInput *) override
AVFCamera * avfCameraControl() const
AVFCameraSession * session() const
void setImageCapture(QPlatformImageCapture *imageCapture) override
void setAudioOutputMuted(bool muted)
QPlatformMediaRecorder * mediaRecorder() override
void setAudioOutput(QPlatformAudioOutput *) override
void setVideoPreview(QVideoSink *sink) override
void setCamera(QPlatformCamera *camera) override
AVFImageCapture * avfImageCaptureControl() const
void setMediaRecorder(QPlatformMediaRecorder *recorder) override
void setAudioInputMuted(bool muted)
~AVFCameraService() override
void setAudioOutputVolume(float volume)
QPlatformImageCapture * imageCapture() override
QPlatformCamera * camera() override
QPlatformAudioInput * audioInput()
void setAudioInputVolume(float volume)
void onCameraDeviceChanged(const QCameraDevice &device) override
Definition avfcamera.mm:28
~AVFCamera() override
void onActiveChanged(bool active) override
Definition avfcamera.mm:22
void setCaptureSession(QPlatformMediaCaptureSession *) override
Definition avfcamera.mm:46
bool tryApplyCameraFormat(const QCameraFormat &) override
Definition avfcamera.mm:37
The QCamera class provides interface for system camera devices.
Definition qcamera.h:25
Q_FORWARD_DECLARE_OBJC_CLASS(NSObject)