Directories | |
| HwBuffers | |
| Pipeline | |
| Runtime | |
| SelfTest | |
| Sink | |
| Source | |
Files | |
| GStreamerVideoBackend.cc | |
| GStreamerVideoBackend.h | |
QGroundControl uses GStreamer for UDP RTP and RTSP video streaming in the Main Flight Display.
This guide covers the GStreamer receiver architecture, platform setup, and diagnostics. See the video module's README for a map of the folders of src/VideoManager and the path of a frame and of a recording through them, CODING_STYLE.md for repository-wide source conventions, test/README.md for the test framework, and tools/README.md for general build and tooling commands.
The backend is split into focused components, by folder:
The backend-neutral VideoReceiver, VideoBackend and VideoStreamStats are in ../Receiver/. ../QtMultimedia/ holds the other VideoReceiver, QtMultimediaVideoReceiver, which plays streams through QMediaPlayer (FFmpeg): in builds without GStreamer, where VideoSettings::videoBackend picks it, and when GStreamer failed to initialize.
Each receiver plays for one video source, a VideoStreamController (../Streams/), and VideoManager (..) is the QML facade of the sources: the primary stream, the thermal stream, the USB camera (../UVC/), and one for each other stream shown in a tile beside the main picture (VideoTiles.qml and VideoTile.qml in ../Qml/). Those are the other streams the active vehicle's cameras advertise, up to VideoSettings::maxVideoTiles, or to the tiles the row has room for where those are fewer (VideoManager::tileRoom), less the tile of the USB camera that VideoSettings::uvcTileCamera names. A stream at an address (its URI, or the UDP port it is listened for on) that a stream on display already has gets no source: a camera sends such streams one at a time.
The components, in the order of their folders: Pipeline/, Source/, Sink/, Runtime/, SelfTest/, and GStreamerVideoBackend.
| Component | Role |
|---|---|
| GstVideoReceiver | The VideoReceiver the app uses. Callers state what they want (config, active, video output, recording), which it hands to its GstReceiverWorker as one GstReceiverRequest after each change. It owns the display sink, built from its VideoReceiver::DisplayConfig when an output is set and rebuilt by restart(), which it also calls when its worker reports the stream's graphics device lost. Every 10 s it checks that its worker runs the tasks it posts to it: its requests and, once the worker is through with those, a heartbeat. A worker that has run none for six checks in a row, 60 to 70 s after its last one, is stuck (see Threading): the receiver tells the user once, through errorOccurred, to restart the application, and from then on reports the stream as the worker did last while frames still reach the output, without statistics, and as stopped while none do, so that no frozen picture passes for the live one. It follows the worker again when that runs a task after all. |
| GstReceiverWorker | Runs on the receiver's worker thread and keeps one PipelineSession in line with what the receiver was asked for, reconnecting after a stream failure as its StreamSupervisor (src/VideoManager/Receiver, shared with the Qt Multimedia receiver) paces it, and giving up (State::Stopped plus errorOccurred) when reconnecting is off or can't help (unsupported URI, missing plugin, credentials an RTSP server refuses). A recording continues across reconnects, from hour to hour, and when its RecordingBranch asks for another file, in the parts its RecordingPlan (src/VideoManager/Receiver) names. Acts on what differs from the previous request, and reports back through queued signals: its whole GstReceiverStatus (state, decoding, decoder, recording, stats) after each change, and the recording and error events. Each task the receiver posts to it, a request or its heartbeat, ends with taskDone, which tells the receiver that the worker still gets to them. |
| PipelineSession | One pipeline (source → tee → the branches below) and everything about it: elements, bus, probes. Lives on the worker; replaces a decoder that posts an error by itself (a stalled one when the worker's watchdog asks) and reports failures of the stream to the worker. |
| PipelineStatsProbe | What the session measures for the stream statistics apart from its branches: the bytes and keyframe timestamps the tee's probe notes, and, when sampled, the RTP counters of the source's jitter buffers with the packets their drop-msg messages tell they dropped (those of its GstRtpPacketProbe when it has none), and the latency and codec the pipeline reports. |
| GstBusPump | The session's bus: a sync handler on the posting thread for what can't wait, the other messages popped on the worker when the bus's poll fd wakes it, a timed pump for a recording's teardown, and a detach that waits out in-flight sync calls so nothing reaches the session afterwards. |
| DecodingBranch | Display branch behind the tee: inserts decodebin3 once the source streams, asks upstream for a keyframe, and reports decoding, the decoder name, and a decoder that keeps failing or can't be inserted, which the worker treats as a failure of the stream. A hardware decoder whose replacement brought no frame either is taken out of autoplug (GStreamer::demoteFailedDecoder()), so the restart that follows plugs the decoder ranked after it, unless the graphics device was reported removed, when no decoder is at fault. A hardware decoder plugged before the pipeline got the graphics device Qt renders with is replaced once it has (see GstContextBridgeBase below), since it would keep decoding on a device of its own. Behind a source that isn't live (tcp://) it sets the decoder's low-latency properties (libav's thread-type, nvcodec's max-display-delay, the stateless H.264 decoders' compliance), which a decoder otherwise picks only for a live source. Its 2-buffer queue drops the oldest frame rather than hold up the tee, once the decoder has fallen behind by more than decodebin3 buffers ahead of it: decodebin3's multiqueue holds the stream by time, with no limit on buffers, up to its min-interleave-time (250 ms by default, the decoder's latency plus 100 ms once the decoder reports one, and no less than the pipeline's latency in GStreamer 1.24 and the later 1.22 releases). After a drop it also drops delta frames until the next keyframe, so the picture freezes briefly instead of smearing. It waits 2 s at most for that keyframe, which it requests upstream, and logs when none came: not every source passes the request on to the sender. |
| RecordingBranch | Recording branch behind the tee: a parser ! muxer ! filesink bin for each file the session is asked to record, started at a keyframe (requested upstream) and, for MP4/MOV, muxed so a crash leaves a playable file; an MKV is synced to the disk every 5 s, as qtmux has its header updates synced, since storage that caches writes (an Android SD card, a network share) reports a full disk only to a sync. A file is synced once more after its muxer's last write, before it is reported closed, so that its end survives a power cut and a disk that was full for it is reported: qtmux asks for that sync with the last thing it writes, and an MKV gets it from a buffer ahead of the EOS that holds an empty memory, since filesink writes out what it holds back, and then syncs, only for a buffer that has a memory. The sync runs on the thread that brings the recorder its EOS, within the 3 s a file has to finalize. The stream's first keyframe lets it into the recorder, and the first one the recorder's parser passes on, which comes with its parameter sets, starts the file at time zero; the recording fails when none does within 5 s. After a reconnect, after each hour, when an MP4/MOV part has less than a minute of the header space it reserved left (the muxer's reserved-duration-remaining, read every second), and when the stream's caps change (a new resolution or profile: matroskamux refuses other caps in a file it has begun, and qtmux takes only some, so each file holds one format), the recording goes on in <base>_part<N>.<ext>; a part that takes over from a running one asks upstream for a keyframe and starts with the one the running part ends before, or with the new caps, which are held at the valve until then, so no frame is lost between them. Its queue holds 64 MB of backlog for slow storage, then ends the recording rather than stall the display. A recorder's error ends the recording too, reported with GStreamer's text for it, or as a full storage when filesink reports one: by the error's code for a failed write, and by errno's text in the detail for a failed fsync. |
| TeeBranchHead | The tee ! queue ! valve head both branches start with: built closed and marked as its branch, opened from a keyframe requested upstream, closed before the branch takes out what follows it. absorbFlowErrors() has the part that follows it (decodebin3, the recorder bin) post a push that fails as its own ERROR and report success, so an element that fails without posting one (a muxer or decoder refusing a format change) fails its branch, not the tee. |
| BranchContext | What PipelineSession lends its branches: the pipeline, the tee, the watchdog, the dot dumper and a way to queue work on the worker. Also the branch marks (GStreamer::markBranch(), GStreamer::branchOf()) that blame a bus message on the branch it came from. |
| StreamWatchdog | Notices stalled source or decoder output on a monotonic clock. Before the first frame it allows rtspsrc its UDP→TCP fallback, and a UDP source any time at all: it keeps listening until a stream arrives. What the worker does about a stall, a new decoder or a reconnect, doesn't end a streaming thread that never returns: the worker waits for it, which the receiver's check of its worker reports. |
| PipelineDotDumper | Writes the pipeline's .dot graphs; see Pipeline Observability. |
| GstSourceFactory | Constructs the source element from the stream URI, for the transport its scheme selects (VideoStreamUri in src/VideoManager/Receiver: rtsp*, udp, udp265, mpegts, tcp), and applies RTP jitter-buffer policy for application/x-rtp sources. RTP over UDP gets its codec's depayloader and parser, and, without a jitter buffer (low-latency mode), a GstRtpPacketProbe on udpsrc to count its packets; an RTSP stream of H.264 or H.265 gets the same depayloader and parser, in place of parsebin, once the SDP has told its encoding, so that a frame leaves the bin when its last packet arrives rather than when the next frame starts; other RTSP streams and MPEG-TS are left to parsebin. An RTSP stream that goes on under another SSRC or payload type, as when a camera starts its encoder over, is followed onto the pad rtspsrc adds for it. |
| GstRtpPacketProbe | GStreamer::countRtpPackets(): a probe that counts the RTP packets a pad pushes, for a source that has no jitter buffer to count them. On the streaming thread it reads the fixed 12-byte header of each packet, in buffers and buffer lists, into an RtpPacketCounter, and hands the totals over in atomics for GStreamer::rtpPacketCounts(). |
| RtpPacketCounter | The packets received and lost in one RTP stream, from their sequence numbers as RFC 3550 counts them (wraparound, late and duplicate packets, a sender that starts over), and its interarrival jitter. No GStreamer types. |
| GstRtspSource | The rtspsrc the source factory builds: the RTSP URI check, transports, timeouts, latency, the UDP receive buffer that udp:// streams get too, retransmission timing, video-only stream selection, an SDP that lets keyframe requests through (a=rtcp-fb: nack pli), and a stop that sends TEARDOWN, with a second to be answered, and no PAUSE ahead of it. |
| GstH26xParameterSetGate | H.264/H.265 setup for the depayloaders and parsers the source factory builds or parsebin plugs: parameter sets repeated at every IDR, keyframe requests after loss, and output held until a full parameter set arrives. |
| QGCQVideoSinkController | GUI-thread companion of the display sink; see `gstqgc`. |
| GStreamer | The facade QGC calls, through VideoBackend where it must also build without GStreamer: initialization (initialize(), with completeInit() checking the plugin features) and the display sink (createVideoSink() configured from the receiver's VideoReceiver::DisplayConfig, bound to a QVideoSink by setupQVideoSinkElement()). |
| GStreamerEnvironment | Process-wide environment setup (plugin/scanner/helper/GIO paths, private registry, mobile CA file) run before gst_init(), with each desktop install's layout (bundleLayout(): macOS framework or flat SDK, Windows, Linux) a function of the app directory that tests check on any host. See Runtime Environment Setup. |
| GStreamerDecoderRanks | Video decoder classification (hardware or software, and the forceVideoDecoder family) and DecoderRankApplier, which applies the setting's rank plan to the registry from the decoders' original ranks (ScopedDecoderOption applies one for a scope), applies it again once the scene graph publishes the device Qt renders with, as the plan depends on that device's API, its adapter and what it opens (reapply()), and takes a hardware decoder that keeps failing out of autoplug until the setting is applied again (demoteFailedDecoder()); also the decoder families offered and the rank dump logged under Video.GStreamer.DecoderRanks. |
| GStreamerDecoderRankPlan | planRanks(): the rank changes a forceVideoDecoder option makes to the installed decoders, with the platform rules (zero-copy va/v4l2sl over vaapi on Linux, on Windows the D3D decoders Qt's renderer samples zero-copy on the adapter it renders on: d3d12 under Direct3D 12, and under Direct3D 11 where its device opens their frames, else d3d11) as RankTraits, without the registry. The software and hardware options only take the other class out of autoplug: a decoder keeps the rank GStreamer gives it, so one it ranks NONE is plugged only when its family is forced. The Linux rule likewise raises the va decoders GStreamer autoplugs and leaves those it ranks NONE (vajpegdec, vah266dec), except where it ranks them all NONE, as it did before 1.24. Where the user asked for software rendering (--swrast, the GPU Safe Mode shortcut), the default option ranks every hardware decoder below the software decoders, so video keeps off the GPU as well; an option chosen in the video settings stays as it is. |
| GStreamerHelpers | Small utilities: keyframe requests, events sent without blocking, holding a new pad's data until it is linked, and taking a child element out of a running bin. |
| GStreamerLibavWorkaround | Has avdec_h265 decode on one thread with FFmpeg 7.1.0 (libavcodec 61.19.100, which GStreamer 1.28 packages for Android, iOS, macOS and Windows), whose slice threads deadlock on an HEVC picture with more wavefront rows than threads and take the streaming thread with them; DecodingBranch applies it to each decoder decodebin3 plugs. The libavcodec version comes from its pkg-config file at configure time, and on iOS, whose SDK has none, from its version headers. |
| GStreamerLogging | Routes GStreamer's log output through QGC's logging, unless GStreamer's own output was requested, and applies the persisted debug level. See GStreamer Logging. |
| GStreamerUdpSrcWorkaround | Serializes udpsrc's unlock()/unlock_stop() on gst-plugins-good before 1.24.10, whose race corrupts the heap when a UDP stream stops right after it starts; completeInit() applies it. |
| GstScoped | RAII owners for transfer-full GStreamer returns so refs can't leak on early return, makeElement() (never floating), PadProbe and ScopedSignal. |
| GStreamerSelfTest | GStreamer::SelfTest::run(), which the boot test runs to prove the packaged runtime decodes and records. See Boot self-test. |
| GStreamerSelfTestMedia | The self-test's media pipelines: decoding the embedded samples and recording and reading back MP4 and MKV. |
| GStreamerVideoBackend | The VideoBackend implementation: the only way the app reaches GStreamer's process lifecycle, which it keeps as states (unprepared, prepared, initialized, failed): the environment first, initialization once (a failed or repeated one isn't retried, as gst_init() can't be undone), the self-test only once initialized. Also GStreamer's tuning (decoder priorities, debug level, Android JNI state). Settings reach the backend as values: VideoReceiver::Config, VideoReceiver::DisplayConfig and the persisted debug level. Once GStreamer has failed to initialize, its receivers are QtMultimediaVideoReceivers, and VideoManager shows its initFailureMessage(). |
MockLink's MockVideoStreamServer (src/Comms/MockLink, Debug builds only) serves a synthetic videotestsrc stream (RTP H.264 or H.265 over UDP, RTSP, MPEG-TS over UDP or TCP) that MockLink advertises, so the receiver runs without a vehicle; builds without GStreamer compile a null server instead.
A QGC-owned plugin (gstqgc/) bridging the pipeline into Qt:
Sink caps — qgcqvideosink answers caps queries itself (GstQgc::buildSinkCaps), with the formats Qt renders (kVideoFormatTable):
The renderer is the backend of the scene graph's QRhi (QGCRhiCapture), or, until the scene graph runs, the graphics API Qt Quick was asked for. When it changes mid-stream, or the DMABuf import starts or stops working, the sink asks upstream to renegotiate.
qgcvideosinkbin — converter ! qgcqvideosink, with glupload ! glcolorconvert in between for the glupload variant and d3d12upload ! d3d12convert for the d3d12convert variant. The converter is the conversion-element override, else imxvideoconvert_g2d or nvvidconv when present, else videoconvertscale (videoconvert ! videoscale before GStreamer 1.22). It scales non-square pixels to square ones, converts formats the sink doesn't take (such as a software decoder's Y444), and passes GPU memory through. When Qt renders with Direct3D 11, an override that names a filter of GStreamer's d3d11 plugin other than d3d11upload and d3d11download (such as d3d11convert or d3d11deinterlace) is ignored: a pipeline's d3d11 elements share the device Qt renders with, and such a filter draws on its immediate context, whose state Qt caches. Decoders and the two elements named only copy there.
The bin doesn't deinterlace: an interlaced stream (576i or 1080i, as analogue-to-IP encoders send) is shown woven, both fields in each frame, so motion combs. Upstream's playsink plugs gst-plugins-good's deinterlace for that. Here it would reach only software-decoded frames, the bundles don't ship its plugin (the gstreamer.plugins lists of .github/build-config.json), and on an interlaced stream it holds back a field or more (20 ms at 50 fields a second with its default method) and doubles the frame rate. A stream in interlace-mode=alternate doesn't negotiate at all, as the sink doesn't offer the format:Interlaced caps feature; decoders that can send both send interleaved frames.
Per-platform import of decoded GPU frames without a copy. Most paths wrap their native textures in GstHwFrameTexturesBase : QVideoFrameTextures; the DMABuf path hands its planes to Qt Multimedia's DMABuf importer (dmabuf/GstQtDmaBufImport, the only code using that private Qt API), or, when Qt Quick renders with Vulkan, imports them as VkImages itself (dmabuf/GstDmaBufVulkanImport):
VideoReceiver::stats (VideoStreamStats, a QML value type that VideoStreamController forwards) tells how healthy a stream is. The Fly View toolbar's video indicator shows those of VideoManager::measuredSource, and turns orange while VideoManager::degraded tells that a source falls short (VideoStreamStats::degraded()). While the stream is Streaming, GstReceiverWorker samples its PipelineSession on each watchdog tick (once a second) through VideoStreamStatsSampler (../Receiver/VideoStreamStatsSampler.h, shared with the Qt Multimedia receiver): its VideoStreamStatsMeter, a pure class with an injectable clock, turns the cumulative counters into rates, and it adds the session's fields below. The first sample is the rates' baseline, so stats are valid from the second one on. The worker hands them to the receiver like its other reports, so statsChanged is emitted on the GUI thread, and sends invalid stats when its session stops: on a stop, a reconnect or a failure. The streaming threads only add to atomic counters, with no lock and no allocation per frame or packet; everything else is read on the worker.
| Field | Measured from |
|---|---|
| fps | Frames the display sink delivered to the QVideoSink (its frame-stats counts per path) less those it superseded, per second over the last VideoStreamStatsMeter::kRateWindowIntervals samples. |
| bitrateKbps | The compressed elementary stream reaching the tee, after the depayloader or demuxer and the parser, counted by the tee's buffer probe, over the same window as fps. |
| framesDropped, droppedFps | Since the stream started, and per second over the last interval: buffers the display queue leaked (its overruns, counted once the buffer after them comes out marked DISCONT, which tells that the queue did leak), delta frames its keyframe gate dropped, frames the display sink dropped because they arrived too late for their time (dropped in its base sink's stats; none in low-latency mode, whose sink doesn't sync), and superseded frames. |
| packetsLost, lossPercent, jitterMs | The stats of every rtpjitterbuffer in the source bin, rtspsrc's internal ones included: num-lost since the stream started, num-lost against num-pushed over the last second, and avg-jitter. Lost are also the packets a jitter buffer drops on arrival to stay within its latency (drop-on-latency), as after a burst: they are in none of its stats, so the source factory has it post a drop-msg element message for each (post-drop-messages), whose num-drop-on-latency PipelineStatsProbe adds up from the bus. UDP RTP in low-latency mode has no jitter buffer: the source bin's GstRtpPacketProbe counts the packets udpsrc receives instead (below). -1 for MPEG-TS, which carries no RTP. |
| latencyMs | The minimum latency of a latency query on the pipeline, as logged when it reaches PLAYING. 0 in low-latency mode, whose display sink doesn't sync. |
| decoder, hardwareDecoder | The decoder factory decodebin3 plugged last, and GStreamer::isHardwareDecoderFactory(). Empty and false while no decoder is inserted: without a video output, and while a decoder is being replaced. |
| gpuPath | The delivery path most frames took since the previous sample, as GstHw::toString() names it: CPU, DMABuf, GL, D3D11, D3D12, IOSurface, AHWBuf or Vulkan. Empty for a display sink other than qgcvideosinkbin. |
| codec | The caps on the tee: H.264, H.265, AV1, VP8, VP9, MJPEG, MPEG-2, ... |
| packetsLate, packetsDuplicate, rtxRequested, rtxRecovered | The same jitter buffers' num-late, num-duplicates, rtx-count and rtx-success-count, since the stream started. -1 without a jitter buffer, which alone tells them: MPEG-TS, and UDP RTP in low-latency mode. |
| keyframeIntervalMs | The tee's buffer probe (PipelineStatsProbe): the average time between the timestamps (PTS, else DTS) of the last five buffers without DELTA_UNIT, so the arrival times a stream without a jitter buffer is stamped with don't swing it. -1 until two keyframes arrived, so a stream without keyframes, such as one with intra refresh, never has one. |
| gpuFallbacks | The display sink's gpu-fallbacks count since the stream started, the sinks a decoder restart replaced included. |
| decoderRestarts | Decoders DecodingBranch::restartDecoder() replaced since the stream started. |
| uptimeMs, reconnects | The worker's StreamSupervisor: the time since the session reported its first frame, and the sessions that streamed since the stream was started or restarted, less one. |
| recordingMs, recordingBytes | The worker's RecordingPlan, while recording: the time since the first part got its first frame, and the sizes of the parts' files. -1 otherwise. |
Without a jitter buffer, RtpPacketCounter counts as RFC 3550 (appendix A.1) has a receiver do. Lost packets are the sequence numbers missing between the first packet and the highest one, across the 16-bit wraparounds, so a loss shows with the next packet that arrives, where a jitter buffer first waits out its latency. A packet that arrives late, fewer than 1024 packets behind, is no longer lost, and a duplicate counts once. PipelineStatsProbe gives the meter a lost count that only grows, since the meter takes a counter that shrank for one that restarted: a late packet that a sample counted as lost stays in the total until the next loss makes up for it. A sender that starts over begins a new sequence: with another SSRC, or with sequence numbers 1024 or more behind the highest one or too far ahead of it to be loss, and either way once a second packet goes on from the first, so one stray packet changes nothing. Too far ahead is what the sender sends in ten seconds at the packet rate measured from the RTP timestamps, as rtpbin scales its max-dropout-time, and 3000 packets before a second of the stream has measured it. The totals go on, without the packets lost in between. The jitter is the interarrival jitter of appendix A.8 from the RTP timestamps (90 kHz) and the arrival times udpsrc stamps its buffers with, which is how rtpjitterbuffer measures its avg-jitter.
VideoStreamStatsMeterTest covers the rate math on a fake clock and the sampler's session fields, GstVideoReceiverComponentsTest the packet counter and its probe, GstVideoReceiverStatsTest the stats of real streams.
The video code works around three defects and one missing option in Qt Multimedia, as found in Qt 6.12.0. Qt locations are relative to qtmultimedia/src/, QGC locations to this directory. The comment at each workaround names the defect.
| Qt problem | Qt location | QGC workaround | Remove when |
|---|---|---|---|
| A VideoOutput never emits windowChanged and its Window.window goes stale, because QQuickVideoOutput::itemChange() never calls QQuickItem::itemChange(). | multimediaquick/qquickvideooutput.cpp | ../Qml/VideoStreamOutput.qml follows its parent's window and registers again after it moved to another one. QGCQVideoSinkController::followWindowVisibility() (Sink/QGCQVideoSinkController.cc) takes the output's window at each registration. | The minimum Qt's VideoOutput emits windowChanged. The controller then connects to it, and the QML needs no second registration. |
| The V4L2 camera reads the focus range into its exposure compensation range and never sets its focus range, so QCamera::setFocusDistance() and setExposureCompensation() set wrong values. | QV4L2Camera::initV4L2Controls() in plugins/multimedia/ffmpeg/qv4l2camera.cpp | kExposureAndFocusControls in ../UVC/UVCCameraController.cc turns the exposure and focus controls off on Linux. | The minimum Qt has qtmultimedia commit b7f6f39957 ("v4l2: QV4L2Camera fixes"). It is on the 6.12 branch after 6.12.0, so Qt 6.12.1 should have it. |
| The DMABuf fourcc table names Format_BGRA8888, Format_BGRA8888_Premultiplied and Format_BGRX8888 as ABGR8888, which is the bytes R,G,B,A. Qt renders these formats without swapping channels, so red and blue are exchanged. Their bytes B,G,R,A are ARGB8888. | dmaBufFourccFromPixelFormat() in multimedia/video/qmultimedia_drm_support_p.h | GstQtDmaBufImport::planeFourccs() (HwBuffers/dmabuf/GstQtDmaBufImport.cc) names these three formats itself. | The minimum Qt's table gives them ARGB8888. planeFourccs() then only copies that table. |
| A QMediaPlayer's RTSP transport can only be chosen with the QT_FFMPEG_RTSP_TRANSPORT environment variable, which is process-wide and read on a worker thread while the source loads. QPlaybackOptions has no transport. | loadMedia() in plugins/multimedia/ffmpeg/playbackengine/qffmpegmediadataholder.cpp | setRtspTransport() in ../QtMultimedia/QtMultimediaVideoReceiver.cc sets the variable before an open that needs another transport than it names, so receivers that open at the same time can get each other's transport. | QPlaybackOptions carries the transport. The receiver then sets it there. |
This project has reported none of these to Qt. As of November 2026:
QGC configures GStreamer runtime paths before gst_init():
Use python3 -m tools.setup.install_dependencies, or manually:
Debug builds also use libgstrtspserver-1.0-dev, when present, for MockLink's RTSP test stream and the RTSP receiver tests.
Configure finds GStreamer with pkg-config (PKG_CONFIG_PATH, or the toolchain's sysroot setup in cross builds) and takes its layout from gstreamer-1.0.pc: the plugin directory from pluginsdir, the plugin scanner's from pluginscannerdir, and the GIO modules' from gio-2.0.pc's giomoduledir.
Unless QGC_GST_BUNDLE_PLUGINS is OFF, installs and AppImages bundle the system's allowlisted plugins, the plugin scanner and only the GIO modules for TLS and proxies (libgiognutls, libgiolibproxy, libdconfsettings). libproxy reads GNOME's and KDE's proxy settings itself; glib-networking's GNOME resolver (libgiognomeproxy) stays out because it aborts QGC wherever the org.gnome.system.proxy GSettings schema isn't installed. The VFS modules stay out: the AppImage, and a bundle on GLib 2.76+, run GIO with GIO_USE_VFS=local.
udpsrc before gst-plugins-good 1.24.10 (Ubuntu 24.04 ships 1.24.2) corrupts the heap when a UDP stream stops right after it starts: its unlock() cancels a GCancellable that unlock_stop() frees on the streaming thread. GStreamer::completeInit() serializes the two for those versions, as the upstream fix (gstreamer!7897) does.
With gpu-zerocopy, qgcvideosinkbin picks one of four variants when it is built:
glupload hands GLMemory to Qt through the GL share group, so it needs Qt Quick on OpenGL, over EGL or GLX. That holds for any OpenGL on Linux and Android, so the bin doesn't wait to learn which: it may be built before the scene graph runs, and Android can't tell EGL until then. dmabuf hands EGLImages to Qt's EGL display, so it needs OpenGL over EGL. Under any other renderer, such as Vulkan, the bin falls back to passthrough, which on Linux means DMA_DRM frames under Vulkan (see DMABuf under Vulkan) and system memory otherwise: gst-gl's GLMemory would otherwise be downloaded and uploaded again for every frame.
When both are compiled, QGC_GST_GPU_BIN (glupload or dmabuf, case-insensitive, read once per process) picks between them, and an explicit value is used even under a renderer the variant doesn't suit, with a warning. An unknown value logs a warning and keeps the default. Builds with only one variant ignore the variable: Android always uses glupload, Linux without gst-gl always imports DMABuf directly. The choice is logged once under Video.GStreamer.GstQgcGpuBin; the qgc GStreamer debug category logs each bin's variant.
Qt's xcb platform, which the AppImage uses even in Wayland sessions, picks GLX before EGL. Linux builds with the GL or DMABuf path therefore set QT_XCB_GL_INTEGRATION=xcb_egl at startup unless it is already set (HwBuffers::configureQtGraphics(), which the platform startup code calls through VideoBackend before Qt starts); Qt still falls back to GLX when EGL fails to initialize. Set QT_XCB_GL_INTEGRATION=xcb_glx to keep GLX, e.g. for a driver whose EGL misbehaves; video then reaches Qt as GLMemory that glupload uploads, without DMABuf import.
The direct DMABuf path hands each plane to Qt Multimedia's DMABuf importer as its own EGLImage, with the DMA_DRM modifier when the caps carry one. QGC adds what Qt's importer lacks: it waits for the decoder's writes first (on the GPU through the dma-buf's exported fence, else with a bounded poll()), and it keeps the buffer alive as long as the textures, and then until the GPU has finished drawing with them where EGL exports its fences (EGL_ANDROID_native_fence_sync): a V4L2 decoder doesn't wait for a buffer's readers before it decodes into it again.
GstHwBuffersGlReadbackTest reads imported DMABuf planes back from a GL QRhi. CTest runs it on xcb with xcb_egl and skips it without an X display; a plain memfd stands in for a dma-buf under Mesa's software rasterizer, and a VA-API decoder's tiled output is compared with its system-memory output on real hardware.
Linux builds pin Qt Quick to OpenGL (HwBuffers::configureQtGraphics()); QSG_RHI_BACKEND=vulkan selects Vulkan instead. The DMABuf path then imports each plane of a frame as a single-plane VkImage on Qt's device, bound to the dma-buf through VK_EXT_external_memory_dma_buf with the frame's modifier (VK_EXT_image_drm_format_modifier), in the format Qt samples that plane as (R8, RG8, R16, RG16, RGBA8 or BGRA8). That is what Qt's EGL importer does with one EGLImage per plane, so NV12, P010 and I420 need no multi-planar image and no YCbCr sampler. Built with QGC_GST_ENABLE_DMABUF_VULKAN (on by default where Qt has Vulkan support and found the Vulkan headers); it needs neither gst-vulkan nor a link to the Vulkan loader.
GstHwBuffersVulkanReadbackTest imports VA-API frames (a decoder's NV12, and I420, P010, RGBA and BGRA from the postprocessor, in whichever of the offered layouts the driver picks) into a Vulkan QRhi and compares QVideoFrame::toImage() with the system-memory frame; it also plays a VA stream into qgcvideosinkbin under a Vulkan render target. CTest runs it on xcb; it skips without a Vulkan device that imports dma-bufs, as Mesa's lavapipe doesn't. Verified on Intel (Mesa ANV with the iHD VA driver, LINEAR and Tile4 layouts) only.
GStreamer SDKs are auto-downloaded during CMake configure. To use a local installation instead, set GStreamer_ROOT_DIR (on iOS, a GStreamer.xcframework or GStreamer.framework, or a directory containing one). Configure fails when that SDK is older than the requested version (gstreamer.version.<platform> or QGC_GST_VERSION) or, on Windows, incomplete; an SDK Windows finds through GSTREAMER_1_0_ROOT_* or a standard install location is replaced by a download instead.
On macOS, configure uses, in this order: GStreamer_ROOT_DIR; Homebrew's GStreamer when QGC_GST_USE_HOMEBREW is ON; the SDK an earlier configure downloaded; /Library/Frameworks/GStreamer.framework; a new download. Homebrew's GStreamer (brew install gstreamer pkgconf) is also used when GStreamer_ROOT_DIR is a Homebrew prefix ($(brew --prefix)) or one of its opt/gstreamer or Cellar/gstreamer/<version> directories. Its pkg-config modules, and GLib's, are read with Homebrew's own pkg-config, which also finds the macOS system libraries' modules; gstreamer.version.macos (or QGC_GST_VERSION) is its minimum version. Such a build only runs from the build tree: Homebrew's libraries and plugins load each other by absolute paths under its prefix, so cmake --install and packaging fail with an error instead of bundling them.
Windows and macOS installs bundle the allowlisted plugins, the GIO modules and the helpers, and only the SDK libraries that those and QGC itself load, which install(RUNTIME_DEPENDENCY_SET) resolves at install time (libproxy's backends, which are loaded with dlopen, are installed as files too). A macOS GStreamer.framework is copied whole, without its GPL libraries.
On iOS only the GStreamerMobile framework links the SDK's merged static archive; GStreamer::GStreamer carries just its headers, defines and system-framework links. The app takes every GStreamer function from the framework, which exports those its registered plugins use plus QGC_GST_APP_CORE_SYMBOLS (Mobile.cmake). A new core call that no plugin uses therefore fails the app's link with an undefined-symbol error naming it: add the symbol to that list. The framework exports GStreamer's and GLib's API only (an exported-symbols list of name patterns, platform/IOS.cmake): the merged archive also holds FFmpeg, libpng, libjpeg and zlib, and the app's Qt code must link to Qt's own, which for FFmpeg are the frameworks qt_add_ios_ffmpeg_libraries() adds (cmake/platform/Apple.cmake). A post-build check (SingleCoreCheck.cmake) fails if the app still ends up defining core symbols. The plugin descriptors the configure reads from the merged archive (over 1 GB per GStreamer.xcframework slice) with nm are cached in the build directory, keyed on the archive's path, size and modification time. From 1.28.8 on, the iOS download is a tarball holding a GStreamer.xcframework instead of a .pkg, and only the xcframework's iOS slices are extracted, skipping its ~2 GB of tvOS slices.
Auto-downloaded during CMake configure. No manual setup required. Each ABI build extracts only its own tree from the universal SDK tarball. Windows and macOS hosts query it with the pkg-config the SDK bundles for them (share/gst-android/ndk-build/tools/<host>/); Linux hosts use their own.
As on iOS, and as the SDK's own FindGStreamerMobile.cmake does, the app does not link the SDK's static archives: GStreamer::mobile is a shared libgstreamer_android.so (platform/Android.cmake) holding GStreamer, the allowlisted plugins, the OpenSSL GIO module and the generated gst_init_static_plugins(). It exports GStreamer's and GLib's API and hides the third-party libraries inside it (FFmpeg, OpenSSL, ...); QGC_GST_APP_CORE_SYMBOLS and the post-build SingleCoreCheck.cmake work as on iOS. The library links no Qt target, so on the 64-bit ABIs it sets the 16 KB segment alignment (-z max-page-size=16384) Qt gives Qt-linked targets for its android_16kb_pages feature: devices with 16 KB pages cannot load a library aligned for 4 KB, and Google Play rejects it. CI's android_apk_check.py checks every library in the APK for that alignment and for dependencies the APK or the NDK does not provide. Qt's deployment packages the library into the APK and loads it before the app. GStreamer's androidmedia plugin finds the Java VM and the app's class loader through gst_android_get_java_vm() and gst_android_get_application_class_loader() in that library, which return the JNI state src/Android/AndroidInit.cc hands it with qgc_gst_android_set_jni_state() at JNI_OnLoad and when the activity starts (Platform/gst_android_jni.c), so the SDK's GStreamer.java and GStreamer.init() are not used.
The plugins' Java sources and GStreamer's fonts and CA bundle are staged in the build directory (extra_java_sources/, extra_assets/), which android/build.gradle adds to the APK.
Windows users building for Android: Enable Developer Mode (Settings > System > For developers) to support symbolic links during the build.
Auto-downloaded SDK archives are cached to ${CPM_SOURCE_CACHE}/gstreamer-*. CPM_SOURCE_CACHE defaults to .cache/CPM in the source tree; set it to a location shared by your checkouts (e.g. ~/.cache/CPM) to download the archives only once (GStreamer 1.28.8: 0.3-1.2 GB per platform, e.g. ~1 GB for Android, 1.2 GB for iOS and 540 MB for Windows x64):
CI caches the extracted trees under a key covering the gstreamer section of .github/build-config.json and cmake/GStreamer/{Packages,Acquire}.cmake, so keep everything that decides an extracted tree in those two files. Cached archives are verified on every hit against the checksum pinned in .github/build-config.json, or the upstream .sha256sum sidecar for an unpinned version; an auto-downloaded SDK is fetched again when its gstreamer.version.<platform> changes, and cached GStreamer probe results are recomputed whenever the SDK changes. Each archive is extracted once into a directory beside it that is stamped with the archive hashes, and a tree stamped with the pinned checksums is used without downloading or even keeping its archives (CI caches only the trees); configures sharing the cache take a lock instead of downloading or extracting over each other. The Windows SDK installer runs in its portable mode, so it leaves no GSTREAMER_1_0_ROOT_* environment variable, registry key or uninstall entry behind.
GstSourceFactory accepts these URI schemes:
Both MPEG-TS sources store the parsed caps on the stream object that tsdemux sends with the stream. decodebin3 picks the decoder by that object's caps when the stream starts, and stores the parsed caps on it only then, on another thread; tsdemux gives it those of the unparsed stream, which no decoder takes, and parsebin leaves them. On a busy machine decodebin3 could read them first and end the stream for want of a decoder.
A test is in test/VideoManager at the path its source has in src/VideoManager: the tests of Pipeline/ are in test/VideoManager/GStreamer/Pipeline/, those of Sink/gstqgc/ in test/VideoManager/GStreamer/Sink/gstqgc/. Code in a common folder is tested from its parent's folder. Support that several folders share is in their nearest common parent: GStreamerTestBase and GStreamerTestHelpers in test/VideoManager/GStreamer/, VideoTestHelpers.h in test/VideoManager/. The cases of GstHwBuffersTest and GstHwBuffersPipelineTest are spread over part files that define no class of their own, the cases of one GPU path in that path's folder (HwBuffers/dmabuf/GStreamerDmaBufTest.cc).
| Test | Label | Covers |
|---|---|---|
| GStreamerEnvironmentTest | Unit | The environment prepareEnvironment() sets for a fake bundled desktop install (plugin path, scanner, which still forks and is reused, and the GIO modules of a bundle that has them; the same when prepared again) and for the running app, and the bundled runtime's private plugin registry: named per install, also across AppImage mounts and macOS translocation, pruned of registries unused for 30 days, and replaced by a user-set GST_REGISTRY or GST_REGISTRY_1_0; a system GStreamer keeps the default registry. The file write that refreshes Android's extracted CA bundle. |
| GStreamerInitTest | Unit | Init policy: how GLib's and GStreamer's logs reach Qt logging, from GStreamer's first line of initialization on, which missing elements disable video and which only a feature, and the decoder ranks the decoder setting applies, except those set with GST_PLUGIN_FEATURE_RANK; the boot self-test's verdict on a failing plugin scanner, on Windows also one that doesn't start, and on a bundle's blacklisted, foreign, stale or unloaded plugins. |
| GStreamerTest | Unit | The GStreamer facade: URI checks, decoder classification and the decoder rank warnings and log, init and the blacklisted plugins it names when an element is missing, the VideoBackend that forwards to it, the lifecycle states (GStreamer isn't initialized twice, or self-tested before it runs) and the Qt Multimedia receivers after a failed initialization, and the recording sink's accepted streams. |
| GstQgcSinkTest | Unit | qgcqvideosink and qgcvideosinkbin as elements: construction, caps, allocation, CPU zero-copy frames, and frames pushed straight into the sink (latest frame only, with the superseded ones counted consistently with the delivered ones, flushes, orientation tags, crop, buffers larger than their caps, the Android decoder's transformation meta, renegotiation), and the render target it reads. |
| GstQgcSinkControllerTest | Unit | QGCQVideoSinkController binding qgcqvideosink to a QVideoSink: inactive without a window, unbound when its owner or the QVideoSink goes away or the sink is released, and active again, when it was, once a QVideoSink is bound again. |
| GstQgcVideoFormatsTest | Unit | The sink's format tables: GStreamer formats, colorimetry and orientations mapped to Qt's, and the formats the sink advertises. |
| GstSourceFactoryTest | Unit | The source bin built for each URI, its jitter-buffer and retransmission policy, the RTP packet count of the bins without a jitter buffer, RTSP stream selection, credentials and keyframe requests (from RTSP depayloaders, and let through by the SDP), dynamic-pad linking, the depayloader and parser an RTSP stream's encoding selects and the frames they push without waiting for the next, an RTSP stream followed onto a new pad, and the parameter-set gate, without a stream. |
| GstHwBuffersTest | Unit | The HwBuffers paths without a GPU: path selection, import caches, frame-texture bundles on the Null QRhi, DMABuf modifier policy, CPU fallbacks, the frame geometry a buffer's metas give, and telemetry. |
| GstQgcSinkHarnessTest | Unit | qgcvideosinkbin under GstHarness, bound to a QVideoSink: resolution and format changes renegotiated through the converter, and orientation tags crossing it. |
| GstSourceFactoryHarnessTest | Unit | The parameter-set gate on a real H.264/H.265 depayloader under GstHarness, fed RTP payloaded from the test streams as a receiver joining mid-GOP sees it. |
| GstVideoReceiverComponentsTest | Unit | The receiver's components without a stream: stall detection, recording finalization by ancestry, pipeline and .dot file names, the size VideoReceiver::presentedSize() reports for a padded, cropped or rotated frame, and the RTP packet counter (loss, late and duplicate packets, wraparound, a sender that starts over, a stray packet of another one, the packet rate that tells a long loss from a sender starting over, jitter) with the probe that feeds it. |
| GstQgcSinkPipelineTest | Integration | videotestsrc pipelines played into qgcvideosinkbin bound to a QVideoSink: formats, timestamps, colorimetry, non-square pixels, software frames through the GPU bins that need no GPU for them, teardown under load. |
| GstSourceFactoryStreamTest | Integration | Source bins receiving real streams on loopback: RTP over UDP joining mid-GOP, a burst of packets the jitter buffer drops and the statistics count as lost, an RTSP session that sets up only the video stream, and one that ends with TEARDOWN alone; an MPEG-TS stream whose stream object leaves the bin with the parsed caps; a second listener refused on a UDP port in use; and their udpsrc stopped right after it starts, thousands of times. |
| GstRecordingSinkTest | Integration | The recording file sink fed by running pipelines: a mid-stream H.265 MP4 start, frames that carry only a DTS, the start time and comment each container is tagged with, the syncs an MKV asks of the disk while it records, and the one a file gets after its muxer's last write. |
| GStreamerHelpersTest | Integration | The pipeline helpers: adding to a bin, removing a child with or without a flush and while its bin changes state, tee branches, keyframe requests, events sent from GStreamer's thread pool, pads held until linked, and the plugin registry walk. |
| GstSelfTestPipelineTest | Integration | The boot self-test against the GStreamer the tests run on, and its software retry after a hardware decoder fails mid-stream, which restores the decoder ranks. |
| GstHwBuffersPipelineTest | Integration, GPU | Pipelines that upload into or decode to GPU memory (DMABuf, GLMemory, D3D11/D3D12, IOSurface) and the path each frame takes; D3D11/D3D12 and IOSurface frames are also converted with QVideoFrame::toImage() on a QRhi of that API, D3D12 frames on a Direct3D 11 QRhi too, and compared with the CPU frame; the D3D QRhi uses the WARP software adapter when QSG_RHI_PREFER_SOFTWARE_RENDERER is set or DXGI lists no hardware adapter, where the NV12 D3D12 frame on Direct3D 11 is skipped (WARP opens it without chroma). The D3D bridges drop a device GStreamer reports removed. Software frames through the glupload bin and the Windows D3D11 sink. Skips without the device. |
| GstHwBuffersGlReadbackTest | Integration, GPU | DMABuf planes and glupload's GLMemory frames imported into a GL QRhi that shares Qt's EGL context, read back pixel by pixel and converted with QVideoFrame::toImage() (xcb with xcb_egl), also when padded beyond their caps; the frame's own GL sync meta left alone; and a 10-bit planar CPU frame as Qt's shaders convert it. |
| GstHwBuffersVulkanReadbackTest | Integration, GPU | VA-API DMABuf frames imported into a Vulkan QRhi and converted with QVideoFrame::toImage(), and a VA stream into the sink under a Vulkan render target (xcb). With QGC_GST_ENABLE_VULKAN: the gst-vulkan bridge's device and a VulkanImage frame's refused import. |
| GstVideoReceiverPipelineTest | Integration | GstVideoReceiver end to end against the H.264 test stream it sends itself on loopback: states, display, restarts, config changes, a decoder that can't be inserted or is missing, a hardware decoder replaced when Qt's graphics device reaches its pipeline late, the stream restarted when that device is lost, a branch element that fails a push without an error message, a mid-stream resolution change, H.265, MockLink's streams, screenshots. Receivers and servers in every GstVideoReceiver*Test listen on port 0, so parallel runs never collide. |
| GstVideoReceiverReconnectTest | Integration | Permanent failures, reconnect backoff after a failed start, the restart policy on stream loss, an RTSP server that never answers, refuses the credentials, or offers no video stream, and the cause a failure message names. A worker that a decoder's streaming thread holds, reported once and again after it went on, with the picture kept only while its frames arrive, and a worker behind with a row of slow tasks, which isn't reported. |
| GstVideoReceiverRecordingTest | Integration | Recordings that stay playable: decoder-only recovery, across reconnects, from part to part (after the part's time, before its header space runs out, and when the stream changes its resolution) with the keyframe asked for, started at a keyframe that has its parameter sets or failed without one, slow and hung storage, recorder errors, a full disk named as such, also when only the sync at a file's end tells, stream end, deactivation and bounded teardown. |
| GstVideoReceiverStatsTest | Integration | The stream statistics of H.264 and H.265 RTP with and without a jitter buffer, and the loss counted without one when the sender drops packets. |
The classes derived from GStreamerTestBase fail in initTestCase() when GStreamer::completeInit() fails, as it does when an element video needs is missing, and their tests skip where GStreamer can't be initialized at all (as under AddressSanitizer). A test skips, rather than fails, when an optional element it uses is missing (GSTTEST_SKIP_UNLESS_FACTORIES in GStreamerTestHelpers.h). The two *HarnessTest classes use GstHarness from gst-check (gstreamer-check-1.0), which test builds request as an optional GStreamer component (Check); they compile only where the SDK or distribution ships it. No test needs a software encoder: the streams they send are the short 320x240 H.264 and H.265 files, and a 160x120 H.264 one a stream switches to mid-way, in SelfTest/Media/, which the app's self-test embeds too (its generate.sh regenerates them), split into access units and paced through appsrc. Only GstVideoReceiverPipelineTest::_testDecodesMockLinkStreams encodes in software, as MockLink's stream server does (openh264enc, falling back to x264enc; x265enc for H.265); the VA-API cases encode with the host's vah264enc. Each class runs in its own process, so a crash in a GPU path only fails its own class; -LE GPU leaves out the classes that use the host's GPU.
CI runs these classes in the Linux coverage and sanitizer jobs and the macOS Debug leg with the rest of the suite, and on Windows in windows.yml's gstreamer-tests job, a Debug build that runs only the GStreamer and video classes against the SDK's shipped plugins plus the sources and encoders the tests send streams with, with the D3D tests on WARP. The packages are checked beyond their boot test: every DLL the Windows install imports must ship or come with Windows (pe_dependency_audit.py), every library a Mach-O file in the macOS bundle loads must resolve inside the bundle or to macOS (macho_bundle_audit.py), and the AppImage must boot in clean Ubuntu 24.04 and Debian 13 containers without GStreamer or Qt (appimage_container_boot.py); see .github/ci-notes/platforms.md.
QGroundControl --simple-boot-test, which CI runs on every package (the installed Windows app, the macOS DMG, the Linux build tree and AppImage, the Android emulator and the iOS simulator), initializes video and then runs GStreamer::SelfTest::run() (GStreamerSelfTest.cc, through VideoBackend::selfTest()). The boot test fails when any of these checks fails, each logged as a critical message under Video.GStreamer.SelfTest that names the plugin, element or file:
The whole self-test takes well under a second on a working runtime, gives each pipeline at most 4 s and stops within 15 s. It is quiet on success but for one summary line at info level, shown with --logging:Video.GStreamer.SelfTest.
QGC supports the standard GStreamer observability env vars. Set them before launching QGC. GST_DEBUG, GST_DEBUG_FILE and GST_TRACERS switch to GStreamer's native log output (see GStreamer Logging), so tracer records keep the format the GStreamer tools expect. The tracers below (latency, dots, leaks) are in GStreamer's coretracers plugin, which the plugin allowlist includes, so an installed QGC has them too.
When GST_DEBUG_DUMP_DOT_DIR is set, QGC writes each receiver's pipeline graph there at key transitions as receiver-<stream>-<tag>.dot. <stream> is the receiver's name (videoContent, thermalVideo, or videoTile<N> for the N-th stream that got a tile, which keeps the name if the stream becomes the main picture), so the receivers don't overwrite each other's files, and <tag> names the transition (pipeline-initial, pipeline-started, pipeline-with-decoder, pipeline-with-videosink, pipeline-with-filesink, pipeline-error, pipeline-watchdog-timeout, pipeline-decoder-timeout, pipeline-recording-stopped, …). A transition's next dump overwrites its last one.
When the env var is unset, QGC instead writes a snapshot to <CacheLocation>/qgc-pipeline-dot/receiver-<stream>-<tag>-<UTC timestamp>.dot on a pipeline ERROR and on a source or decoder watchdog timeout, keeping the 10 newest, so field-bug-report bundles include the topology automatically.
Every dump shows topology, caps, media types and states, but leaves out element properties, which can hold stream credentials (such as rtspsrc's user-id and user-pw).
Per-element latency from source to sink:
Plot the resulting element-latency / latency log lines with any of the GStreamer community tools (e.g. gst-stats, GStreamerLatencyPlotter).
The viewer streams the live pipeline graph over WebSocket and exposes a snapshot button — no xdot viewer needed.
Logs every GstObject / GstMiniObject that wasn't released by exit. Useful when triaging pad-leak regressions in the source factory or sink bin. The leaks tracer reports when GStreamer is deinitialized: QGC_GST_DEINIT=1 makes QGC call gst_deinit() as it exits, after its receivers are gone. It is opt-in, like Qt's QT_GSTREAMER_DEINIT, because GStreamer can't be used again in the process afterwards.