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
avfimagecapture_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 AVFCAMERAIMAGECAPTURE_H
5#define AVFCAMERAIMAGECAPTURE_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#import <AVFoundation/AVFoundation.h>
19
20#include <QtCore/qqueue.h>
21#include <QtCore/qsemaphore.h>
22#include <QtCore/qsharedpointer.h>
23#include <private/qplatformimagecapture_p.h>
25
27
29{
31public:
36
37 AVFImageCapture(QImageCapture *parent = nullptr);
39
40 bool isReadyForCapture() const override;
41
42 AVCaptureStillImageOutput *stillImageOutput() const {return m_stillImageOutput;}
43
44 int doCapture(const QString &fileName);
45 int capture(const QString &fileName) override;
47
48 QImageEncoderSettings imageSettings() const override;
49 void setImageSettings(const QImageEncoderSettings &settings) override;
50 bool applySettings();
51
52 void setCaptureSession(QPlatformMediaCaptureSession *session);
53
54private Q_SLOTS:
56 void updateReadyStatus();
57 void onNewViewfinderFrame(const QVideoFrame &frame);
58 void onCameraChanged();
59
60private:
61 void makeCapturePreview(CaptureRequest request, const QVideoFrame &frame, int rotation);
62 bool videoCaptureDeviceIsValid() const;
63
64 AVFCameraService *m_service = nullptr;
65 AVFCameraSession *m_session = nullptr;
66 AVFCamera *m_cameraControl = nullptr;
67 bool m_ready = false;
68 int m_lastCaptureId = 0;
69 AVCaptureStillImageOutput *m_stillImageOutput;
70 AVCaptureConnection *m_videoConnection = nullptr;
71
72 QMutex m_requestsMutex;
73 QQueue<CaptureRequest> m_captureRequests;
74 QImageEncoderSettings m_settings;
75};
76
78
79QT_END_NAMESPACE
80
81#endif
void setImageCapture(QPlatformImageCapture *imageCapture) override
void setAudioOutputMuted(bool muted)
QPlatformMediaRecorder * mediaRecorder() override
void setVideoPreview(QVideoSink *sink) override
void setCamera(QPlatformCamera *camera) override
void setMediaRecorder(QPlatformMediaRecorder *recorder) override
void setAudioInputMuted(bool muted)
void setAudioOutputVolume(float volume)
QPlatformImageCapture * imageCapture() override
QPlatformCamera * camera() override
void setAudioInputVolume(float volume)
void setAudioOutputMuted(bool muted)
void setAudioInputVolume(float volume)
void setVideoSink(QVideoSink *sink)
void setAudioOutputVolume(float volume)
void setAudioInputMuted(bool muted)
AVFImageCapture(QImageCapture *parent=nullptr)
int doCapture(const QString &fileName)
AVCaptureStillImageOutput * stillImageOutput() const
void setCaptureSession(QPlatformMediaCaptureSession *session)
int captureToBuffer() override
QImageEncoderSettings imageSettings() const override
int capture(const QString &fileName) override
bool isReadyForCapture() const override
void setImageSettings(const QImageEncoderSettings &settings) override
Combined button and popup list for selecting options.
Q_DECLARE_TYPEINFO(QObjectPrivate::ConnectionList, Q_RELOCATABLE_TYPE)