Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qgstreamerimagecapture_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 QGSTREAMERIMAGECAPTURECONTROL_H
5#define QGSTREAMERIMAGECAPTURECONTROL_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 <private/qplatformimagecapture_p.h>
19#include <private/qmultimediautils_p.h>
22
23#include <qqueue.h>
24
25#include <qgst_p.h>
26#include <gst/video/video.h>
27
29
31
32{
34public:
37
38 bool isReadyForCapture() const override;
39 int capture(const QString &fileName) override;
40 int captureToBuffer() override;
41
42 QImageEncoderSettings imageSettings() const override;
44
45 bool probeBuffer(GstBuffer *buffer) override;
46
48
49 QGstElement gstElement() const { return bin.element(); }
50
51public Q_SLOTS:
52 void cameraActiveChanged(bool active);
53 void onCameraChanged();
54
55private:
56 QGstreamerImageCapture(QGstElement videoconvert, QGstElement jpegenc, QGstElement jifmux,
58
59 void setResolution(const QSize &resolution);
60 int doCapture(const QString &fileName);
61 static gboolean saveImageFilter(GstElement *element, GstBuffer *buffer, GstPad *pad, void *appdata);
62
63 QGstreamerMediaCapture *m_session = nullptr;
64 int m_lastId = 0;
65 QImageEncoderSettings m_settings;
66
67 struct PendingImage {
68 int id;
69 QString filename;
70 QMediaMetaData metaData;
71 };
72
73 QQueue<PendingImage> pendingImages;
74
75 QGstBin bin;
76 QGstElement queue;
78 QGstElement videoConvert;
79 QGstElement encoder;
80 QGstElement muxer;
82 QGstPad videoSrcPad;
83
84 bool passImage = false;
85 bool cameraActive = false;
86};
87
89
90#endif // QGSTREAMERCAPTURECORNTROL_H
GstElement * element() const
Definition qgst_p.h:526
int capture(const QString &fileName) override
bool isReadyForCapture() const override
bool probeBuffer(GstBuffer *buffer) override
static QMaybe< QPlatformImageCapture * > create(QImageCapture *parent)
QImageEncoderSettings imageSettings() const override
void setImageSettings(const QImageEncoderSettings &settings) override
void setCaptureSession(QPlatformMediaCaptureSession *session)
\inmodule QtMultimedia
\inmodule QtMultimedia
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:311
\inmodule QtCore
Definition qqueue.h:14
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
Combined button and popup list for selecting options.
GLenum GLuint id
[7]
GLenum GLuint buffer
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLsizei GLenum GLboolean sink
#define Q_OBJECT
#define Q_SLOTS
QSettings settings("MySoft", "Star Runner")
[0]