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
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>
24#include "avfcamerasession_p.h"
25
27
29{
31public:
34 QSharedPointer<QSemaphore> previewReady;
35 };
36
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;
46 int captureToBuffer() override;
47
48 QImageEncoderSettings imageSettings() const override;
50 bool applySettings();
51
53
54private Q_SLOTS:
55 void updateCaptureConnection();
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
80
81#endif
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
\inmodule QtMultimedia
\inmodule QtCore
Definition qmutex.h:281
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QVideoFrame class represents a frame of video data.
Definition qvideoframe.h:27
Combined button and popup list for selecting options.
#define Q_OBJECT
#define Q_SLOTS
@ Q_PRIMITIVE_TYPE
Definition qtypeinfo.h:157
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:180
QSettings settings("MySoft", "Star Runner")
[0]
QFrame frame
[0]
QNetworkRequest request(url)
QSharedPointer< QSemaphore > previewReady