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
qgstreamermediaencoder_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 QGSTREAMERENCODERCONTROL_H
6#define QGSTREAMERENCODERCONTROL_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
21
22#include <QtMultimedia/private/qplatformmediarecorder_p.h>
23#include <QtCore/qurl.h>
24#include <QtCore/qdir.h>
25#include <QtCore/qelapsedtimer.h>
26#include <QtCore/qtimer.h>
27
29
30class QMediaMetaData;
32
34{
35public:
38
39 bool isLocationWritable(const QUrl &sink) const override;
40
41 qint64 duration() const override;
42
44 void pause() override;
45 void resume() override;
46 void stop() override;
47
48 void setMetaData(const QMediaMetaData &) override;
49 QMediaMetaData metaData() const override;
50
52
53 QGstElement getEncoder() { return gstEncoder; }
54private:
55 bool processBusMessage(const QGstreamerMessage& message) override;
56
57private:
58 struct PauseControl {
59 explicit PauseControl(QPlatformMediaRecorder &encoder) : encoder(encoder) { }
60
61 GstPadProbeReturn processBuffer(QGstPad pad, GstPadProbeInfo *info);
62 void installOn(QGstPad pad);
63 void reset();
64
66 GstClockTime pauseOffsetPts = 0;
67 std::optional<GstClockTime> pauseStartPts;
68 std::optional<GstClockTime> firstBufferPts;
69 qint64 duration = 0;
70 };
71
72 PauseControl audioPauseControl;
73 PauseControl videoPauseControl;
74
75 void handleSessionError(QMediaRecorder::Error code, const QString &description);
76 void finalize();
77
78 QGstreamerMediaCapture *m_session = nullptr;
79 QMediaMetaData m_metaData;
80 QTimer signalDurationChangedTimer;
81
82 QGstPipeline capturePipeline;
83 QGstBin gstEncoder;
84 QGstElement gstFileSink;
85
86 bool m_finalizing = false;
87};
88
90
91#endif // QGSTREAMERENCODERCONTROL_H
void setCaptureSession(QPlatformMediaCaptureSession *session)
QGstreamerMediaEncoder(QMediaRecorder *parent)
qint64 duration() const override
void record(QMediaEncoderSettings &settings) override
QMediaMetaData metaData() const override
bool isLocationWritable(const QUrl &sink) const override
void setMetaData(const QMediaMetaData &) override
bool processBusMessage(const QGstreamerMessage &message) override
\inmodule QtMultimedia
\inmodule QtMultimedia
Error
\qmlproperty enumeration QtMultimedia::MediaRecorder::error
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qtimer.h:20
\inmodule QtCore
Definition qurl.h:94
Combined button and popup list for selecting options.
GLuint GLsizei const GLchar * message
GLboolean reset
GLsizei GLenum GLboolean sink
long long qint64
Definition qtypes.h:60
QSettings settings("MySoft", "Star Runner")
[0]
QHostInfo info
[0]