Serves a synthetic (videotestsrc) live video stream for MockLink so the GStreamer receive pipeline can be exercised end-to-end without real hardware. More...
#include <MockVideoStreamServer.h>
Public Types | |
| enum class | StreamType { RtpUdpH264 , RtpUdpH265 , RtspH264 , RtspH265 , MpegTsUdp , MpegTsTcp } |
Public Member Functions | |
| MockVideoStreamServer ()=default | |
| ~MockVideoStreamServer () | |
| MockVideoStreamServer (const MockVideoStreamServer &)=delete | |
| MockVideoStreamServer & | operator= (const MockVideoStreamServer &)=delete |
| bool | start (StreamType type, const QString &host, quint16 port) |
| void | stop () |
| Stop the stream and release all resources. Safe to call when not running. | |
| QString | servedUri () const |
Static Public Member Functions | |
| static bool | isStreamTypeAvailable (StreamType type) |
Serves a synthetic (videotestsrc) live video stream for MockLink so the GStreamer receive pipeline can be exercised end-to-end without real hardware.
One instance serves exactly one stream. The served URI (available via servedUri() after a successful start()) is what MockLink advertises via VIDEO_STREAM_INFORMATION, so QGC auto-configures its receiver to the matching transport/codec.
Definition at line 24 of file MockVideoStreamServer.h.
|
strong |
Transport + codec of the served stream. Kept independent of MockConfiguration so the GStreamer layer carries no dependency on the Comms/MockLink module.
Definition at line 29 of file MockVideoStreamServer.h.
|
default |
References MockVideoStreamServer().
Referenced by MockVideoStreamServer(), MockVideoStreamServer(), and operator=().
|
default |
Definition at line 71 of file MockVideoStreamServer.cc.
References stop().
|
delete |
References MockVideoStreamServer().
|
static |
True when the encoder/muxer elements required for type are present in the local GStreamer install (e.g. false for RtpUdpH265 and RtspH265 when x265enc is missing, or the RTSP types when gst-rtsp-server was not built in).
Definition at line 76 of file MockVideoStreamServer.cc.
References GStreamer::hasElementFactory(), MpegTsTcp, MpegTsUdp, RtpUdpH264, RtpUdpH265, RtspH264, and RtspH265.
Referenced by start().
|
delete |
References MockVideoStreamServer(), start(), and stop().
|
inline |
Definition at line 53 of file MockVideoStreamServer.h.
| bool MockVideoStreamServer::start | ( | StreamType | type, |
| const QString & | host, | ||
| quint16 | port ) |
Start serving a test pattern of the given type on host:port. A server (RTSP, MPEG-TS over TCP) given port 0 listens on a free port, which servedUri() names.
Definition at line 104 of file MockVideoStreamServer.cc.
References isStreamTypeAvailable(), MpegTsTcp, MpegTsUdp, RtpUdpH264, RtpUdpH265, RtspH264, RtspH265, and stop().
Referenced by operator=().
| void MockVideoStreamServer::stop | ( | ) |
Stop the stream and release all resources. Safe to call when not running.
Definition at line 197 of file MockVideoStreamServer.cc.
Referenced by operator=(), start(), and ~MockVideoStreamServer().