52 QVideoFrame superseded;
53 const QMutexLocker locker(&_mutex);
54 QVideoSink*
const sink = _sink;
58 const std::shared_ptr<Slot> slot = _slot;
59 bool needPost =
false;
61 QMutexLocker slotLocker(&slot->mutex);
62 superseded = std::exchange(slot->frame, std::move(frame));
63 needPost = !std::exchange(slot->posted,
true);
66 QMetaObject::invokeMethod(
71 QMutexLocker slotLocker(&slot->mutex);
72 latest = std::exchange(slot->frame, QVideoFrame());
75 if (latest.isValid()) {
76 sink->setVideoFrame(latest);
79 Qt::QueuedConnection);
81 return {.delivered =
true, .superseded = superseded.isValid()};