QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GstQgcFrameDelivery.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4
5#include <QtCore/QMutex>
6
7class QVideoFrame;
8class QVideoSink;
9
10namespace GstQgc {
11
17{
18public:
19 struct Result
20 {
21 bool delivered = false;
22 bool superseded = false;
23 };
24
27
28 FrameDelivery(const FrameDelivery&) = delete;
30
32 QVideoSink* sink() const;
36 void setSink(QVideoSink* sink);
37
39 Result deliver(QVideoFrame&& frame);
41 void dropPending();
42
43private:
44 struct Slot;
45
46 mutable QMutex _mutex;
47 QVideoSink* _sink = nullptr;
50 std::shared_ptr<Slot> _slot;
51};
52
53} // namespace GstQgc
FrameDelivery & operator=(const FrameDelivery &)=delete
void setSink(QVideoSink *sink)
FrameDelivery(const FrameDelivery &)=delete
QVideoSink * sink() const
The QVideoSink the frames go to: caller-owned, never dereferenced here but to queue the hand-off.
Result deliver(QVideoFrame &&frame)
Hands frame over as the newest.
void dropPending()
Drops an undelivered frame, releasing the decoder buffer it pins.
GstVideoSink that pushes decoded frames into a Qt QVideoSink; sole sink in qgcvideosinkbin....
bool superseded
It replaced a frame the QVideoSink hadn't taken yet.
bool delivered
False when no QVideoSink is bound.