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 <QtMultimedia/qvideoframe.h>
19#include <QtMultimedia/private/qvideooutputorientationhandler_p.h>
20#include <QtCore/qmutex.h>
21#include <QtCore/qobject.h>
22
23#include <avfvideosink_p.h>
24
25#include <CoreVideo/CVBase.h>
26#include <CoreVideo/CVPixelBuffer.h>
27#include <CoreVideo/CVImageBuffer.h>
28#ifdef Q_OS_IOS
29#include <CoreVideo/CVOpenGLESTexture.h>
30#include <CoreVideo/CVOpenGLESTextureCache.h>
31#endif
32
33#import <dispatch/dispatch.h>
34#import <AVFoundation/AVFoundation.h>
35
36@class AVFCaptureFramesDelegate;
37
38QT_BEGIN_NAMESPACE
39
40class AVFCameraSession;
43class AVFVideoSink;
44
46{
48public:
51
52 void reconfigure() override;
53 void setOutputSettings() override;
54
56 void syncHandleViewfinderFrame(const QVideoFrame &frame);
57
59
61 void resetCaptureDelegate() const;
62
63 void setPixelFormat(QVideoFrameFormat::PixelFormat pixelFormat,
64 QVideoFrameFormat::ColorRange colorRange);
65
68
69private Q_SLOTS:
71 void updateCaptureConnection();
72public Q_SLOTS:
73 void deviceOrientationChanged(int angle = -1);
74
75private:
76 AVFCaptureFramesDelegate *m_viewfinderFramesDelegate = nullptr;
77 AVFCameraSession *m_cameraSession = nullptr;
78 AVCaptureVideoDataOutput *m_videoDataOutput = nullptr;
79
80 bool m_needsHorizontalMirroring = false;
81
82 QVideoFrame m_lastViewfinderFrame;
83 QMutex m_vfMutex;
84 dispatch_queue_t m_delegateQueue;
85 QVideoOutputOrientationHandler m_orientationHandler;
86
87 friend class CVImageVideoBuffer;
88};
89
90QT_END_NAMESPACE
91
92#endif
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)
~AVFCamera() override
void onCameraDeviceChanged(const QCameraDevice &, const QCameraFormat &) override
Definition avfcamera.mm:30
void onActiveChanged(bool active) override
Definition avfcamera.mm:24
void setCaptureSession(QPlatformMediaCaptureSession *) override
Definition avfcamera.mm:58
bool tryApplyCameraFormat(const QCameraFormat &) override
Definition avfcamera.mm:49
The QCamera class provides interface for system camera devices.
Definition qcamera.h:25
Combined button and popup list for selecting options.