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
qffmpegimagecapture_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
5#ifndef QFFMPEGIMAGECAPTURE_H
6#define QFFMPEGIMAGECAPTURE_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtMultimedia/private/qplatformimagecapture_p.h>
20#include <QtFFmpegMediaPluginImpl/private/qffmpegmediacapturesession_p.h>
21
22#include <QtCore/qpointer.h>
23#include <qqueue.h>
24
26
28{
30public:
33
34 bool isReadyForCapture() const override;
35 int capture(const QString &fileName) override;
37
38 QImageEncoderSettings imageSettings() const override;
39 void setImageSettings(const QImageEncoderSettings &settings) override;
40
41 void setCaptureSession(QPlatformMediaCaptureSession *session);
42
43 void cancelPendingImage(QImageCapture::Error error, const QString &errorMsg);
44
45protected:
46 virtual int doCapture(const QString &fileName);
47 virtual void setupVideoSourceConnections();
50
51protected Q_SLOTS:
52 void newVideoFrame(const QVideoFrame &frame);
54
55private:
56 QFFmpegMediaCaptureSession *m_session = nullptr;
57 QPointer<QPlatformVideoSource> m_videoSource;
58 int m_lastId = 0;
59 QImageEncoderSettings m_settings;
60
61 struct PendingImage {
62 int id;
63 QString filename;
64 QMediaMetaData metaData;
65 };
66
67 QQueue<PendingImage> m_pendingImages;
68 bool m_isReadyForCapture = false;
69};
70
71QT_END_NAMESPACE
72
73#endif // QFFMPEGIMAGECAPTURE_H
void setImageSettings(const QImageEncoderSettings &settings) override
virtual int doCapture(const QString &fileName)
QPlatformVideoSource * videoSource() const
void cancelPendingImage(QImageCapture::Error error, const QString &errorMsg)
QImageEncoderSettings imageSettings() const override
void setCaptureSession(QPlatformMediaCaptureSession *session)
int capture(const QString &fileName) override
~QFFmpegImageCapture() override
virtual void setupVideoSourceConnections()
bool isReadyForCapture() const override
static constexpr int MaxPendingImagesCount
static const char * extensionForFormat(QImageCapture::FileFormat format)
#define qCDebug(category,...)
#define Q_STATIC_LOGGING_CATEGORY(name,...)