6#include <QtMultimedia/qaudiobuffer.h>
7#include <QtMultimedia/private/qmediaframeinput_p.h>
8#include <QtMultimedia/private/qmediainputencoderinterface_p.h>
9#include <QtMultimedia/private/qplatformvideoframeinput_p.h>
20 return sendMediaFrame([&]() { emit m_platfromVideoFrameInput->newVideoFrame(frame); });
25 m_platfromVideoFrameInput = std::make_unique<QPlatformVideoFrameInput>(std::move(format));
26 addUpdateSignal(m_platfromVideoFrameInput.get(), &QPlatformVideoFrameInput::encoderUpdated);
31 m_platfromVideoFrameInput.reset();
34 captureSession()->setVideoFrameInput(
nullptr);
39 return m_platfromVideoFrameInput.get();
47 removeUpdateSignal(prevSession, &QMediaCaptureSession::videoOutputChanged);
50 addUpdateSignal(newSession, &QMediaCaptureSession::videoOutputChanged);
55 if (
auto encoderInterface = m_platfromVideoFrameInput->encoderInterface())
56 return encoderInterface->canPushFrame();
58 return captureSession()->videoOutput() || captureSession()->videoSink();
64 QVideoFrameInput *q =
nullptr;
65 std::unique_ptr<QPlatformVideoFrameInput> m_platfromVideoFrameInput;
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
99
100
101QVideoFrameInput::QVideoFrameInput(QObject *parent) : QVideoFrameInput({}, parent) { }
104
105
106
107
108
109
110
111
112
113
114
115
116QVideoFrameInput::QVideoFrameInput(
const QVideoFrameFormat &format, QObject *parent)
117 : QObject(*
new QVideoFrameInputPrivate(
this), parent)
119 Q_D(QVideoFrameInput);
120 d->initialize(format);
124
125
126QVideoFrameInput::~QVideoFrameInput()
128 Q_D(QVideoFrameInput);
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149bool QVideoFrameInput::sendVideoFrame(
const QVideoFrame &frame)
151 Q_D(QVideoFrameInput);
152 return d->sendVideoFrame(frame);
156
157
158
159QVideoFrameFormat QVideoFrameInput::format()
const
161 Q_D(
const QVideoFrameInput);
162 return d->platfromVideoFrameInput()->frameFormat();
166
167
168
169
170
171
172QMediaCaptureSession *QVideoFrameInput::captureSession()
const
174 Q_D(
const QVideoFrameInput);
175 return d->captureSession();
178void QVideoFrameInput::setCaptureSession(QMediaCaptureSession *captureSession)
180 Q_D(QVideoFrameInput);
181 d->setCaptureSession(captureSession);
184QPlatformVideoFrameInput *QVideoFrameInput::platformVideoFrameInput()
const
186 Q_D(
const QVideoFrameInput);
187 return d->platfromVideoFrameInput();
191
192
193
194
195
196
197
198
Combined button and popup list for selecting options.