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
94
95
96QVideoFrameInput::QVideoFrameInput(QObject *parent) : QVideoFrameInput({}, parent) { }
99
100
101
102
103
104
105
106
107
108
109
110
111QVideoFrameInput::QVideoFrameInput(
const QVideoFrameFormat &format, QObject *parent)
112 : QObject(*
new QVideoFrameInputPrivate(
this), parent)
114 Q_D(QVideoFrameInput);
115 d->initialize(format);
119
120
121QVideoFrameInput::~QVideoFrameInput()
123 Q_D(QVideoFrameInput);
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144bool QVideoFrameInput::sendVideoFrame(
const QVideoFrame &frame)
146 Q_D(QVideoFrameInput);
147 return d->sendVideoFrame(frame);
151
152
153
154QVideoFrameFormat QVideoFrameInput::format()
const
156 Q_D(
const QVideoFrameInput);
157 return d->platfromVideoFrameInput()->frameFormat();
161
162
163
164
165
166
167QMediaCaptureSession *QVideoFrameInput::captureSession()
const
169 Q_D(
const QVideoFrameInput);
170 return d->captureSession();
173void QVideoFrameInput::setCaptureSession(QMediaCaptureSession *captureSession)
175 Q_D(QVideoFrameInput);
176 d->setCaptureSession(captureSession);
179QPlatformVideoFrameInput *QVideoFrameInput::platformVideoFrameInput()
const
181 Q_D(
const QVideoFrameInput);
182 return d->platfromVideoFrameInput();
186
187
188
189
190
191
192
193
Combined button and popup list for selecting options.