Repository navigation
Rebase Pexip patches onto latest upstream GStreamer main (8d08c320ce) + upstreaming plan - #79
Draft
havardgraff with Copilot wants to merge 3242 commits into
Draft
havardgraff with Copilot wants to merge 3242 commits into
havardgraff with Copilot wants to merge 3242 commits into
Conversation
https://bugzilla.gnome.org/show_bug.cgi?id=755481 (cherry picked from commit 2939197)
Don't send a segment event if we haven't produced data and set the output caps yet. Doing so causes a g_warning about sticky event misordering. https://bugzilla.gnome.org/show_bug.cgi?id=773510 (cherry picked from commit fd1d9ed)
(cherry picked from commit e22c118)
This is a Pexip specific change since we are only interested in using gstflvdemux live. (cherry picked from commit 337a635)
This happens all the time for us, so no point warning about it. (cherry picked from commit 4150aec)
(cherry picked from commit f989652)
(cherry picked from commit c08372b)
(cherry picked from commit d13ab10)
Multiple SIMD-ified vpx plugins will be built if available. These plugins will be put in a separate plugin directory which can be linked to if configuring with --enable-simd-symlink=avx etc. (cherry picked from commit dea5dd3)
Hard code limit to 1500 ms between each generated key frame. This should ideally be a property and set to a value derived from RTT. This avoids generating bursts of keyframes when receiving many PLIs/NACKs in close succession. 1500ms is quite large, but with 500ms and lots of packetloss, the frequent keyframe generation will more then double the bitrate from the libvpx encoder (configured at 1mbps, producing over 2mbps), potentially making an already bad situation much worse. By adding another second we only see about 1,4mbps, which is more acceptable. (cherry picked from commit 00bcaf7)
(cherry picked from commit f14b436)
(cherry picked from commit 0fd3ed3)
Adds property that can be used to disable direct rendering. (cherry picked from commit a6fb741)
When buffer is pushed downstream, we should not hold the buffer mapped with write access. Doing so would often lead to unneccesary memcpy later. For instance, gst_buffer_make_writable() in gst_video_decoder_finish_frame() will cause a memcpy because of _memory_get_exclusive_reference(). (cherry picked from commit 34e53cb)
(cherry picked from commit 643bf55)
Can't have a mix of GstValueArray and GValueArray here. (cherry picked from commit e9c8812)
(cherry picked from commit d400d79)
...it crashes our libvpx... (cherry picked from commit f2d0b2c)
These made one of our vpx test fail. GST_DEBUG=*vp*:LOG GST_CHECKS=vpx_enc_rate_limit_key_frames python3 /pexip/external/meson/meson.py test vpx -vv Look into why and how more closely! (cherry picked from commit c0aa078)
(cherry picked from commit 7f4f029)
(cherry picked from commit 9da0218)
(cherry picked from commit c58172b)
(cherry picked from commit 133002b)
(cherry picked from commit 21c3443)
Controls weather or not we would want to parse the bitstream in order to extract partition information, which is currently only used if no custom meta is present. (cherry picked from commit fedfc3a)
(cherry picked from commit a9f7331)
(cherry picked from commit 51b4b57)
(cherry picked from commit 61b8ff4)
(cherry picked from commit ad0559b)
This is both nicer in code, but also avoids locking to safly access last_flowret. Found using thread sanatizer. (cherry picked from commit 81802e1)
The task variable could dissappear while in set_task_state, so by taking a lock and then a ref this problem goes away. (cherry picked from commit b74e3d7)
By letting go of the lock, the entry could poentially be invalidated while we were checking the status. Grabbing the status before releasing the lock fixes this problem. (cherry picked from commit 30e3945)
(cherry picked from commit c994829)
(cherry picked from commit 7ac7644)
(cherry picked from commit be61a3a)
Prevents possible data-races. (cherry picked from commit 64f984d)
(cherry picked from commit 22e8602)
TWCC has applied this duplicate length conversion since its original implementation in 1df7064. The caller already supplies bytes. The overstated length can let malformed feedback read beyond its RTCP packet, potentially beyond allocated memory, risking crashes or incorrect feedback and stats. This does not establish the cause of the observed contention on an issue on our end (pexip/mcu#51159) Pass the byte count unchanged, check delta sizes before reading, and correct test helpers with session-boundary regressions. (cherry picked from commit 725a467)
estimate_latency fed the raw 32-bit rtptime into the clock difference, so two kinds of step were indistinguishable from jitter: * The 32-bit rollover, which produces a clock_diff jump of 2^32 divided by the clock rate -- thirteen hours at 90 kHz. Extend the timestamp to 64 bits with gst_rtp_buffer_ext_timestamp. * A sender that restarts and picks a new random rtptime base. The step goes into max_jitter_estimation, which decays slowly, so the estimate stays pinned at the size of the step long after the event. Reset the estimation instead, on the same delta the skew calculation already treats as a restarted sender. Also log the inputs of the estimation. The sum on its own does not say whether it came from a single outlier or from a shifted mean. Tests live in pexip/media: test_latency_estimation_across_rtptime_wrap and test_latency_estimation_reset_on_rtptime_step. (cherry picked from commit eea932d)
(cherry picked from commit dca1613)
rtp_twcc_stats_set_sock_ts() wrote SentPacket::socket_ts from the sink thread after _find_sentpacket() had already dropped sent_packets_lock, while the stats code read it without any synchronization. The slot could also be evicted and reused between lookup and write. Do the lookup and write under sent_packets_lock, and publish socket_ts once through an atomic flag so the stats calculation can read it without taking the lock. Add a regression test for TSAN. (cherry picked from commit 34adb59)
…anges * flvdemux: upstream added a guint64 "no-more-pads-threshold" property (f16074c) that replaces the fork's gint64 one. The fork's default of -1 ("never signal no-more-pads", Pexip only uses flvdemux live) is out of range for the new property, so use the property's maximum instead. * sctp (dcsctp import): upstream pad tasks now require a strong reference as user data (1179387); hold one in the srcpad activate_mode of sctpdec and sctpenc.
First parent: the Pexip patch series replayed on upstream/main (404 of the 422 fork-only commits; 18 dropped because upstream already contains them or they became obsolete). Second parent: previous fork main (34adb59), kept only so this branch fast-forwards the existing history. The tree is exactly that of the first parent.
Co-authored-by: havardgraff <1926313+havardgraff@users.noreply.github.com>
Co-authored-by: havardgraff <1926313+havardgraff@users.noreply.github.com>
Co-authored-by: havardgraff <1926313+havardgraff@users.noreply.github.com>
Co-authored-by: havardgraff <1926313+havardgraff@users.noreply.github.com>
Co-authored-by: havardgraff <1926313+havardgraff@users.noreply.github.com>
Co-authored-by: havardgraff <1926313+havardgraff@users.noreply.github.com>
Co-authored-by: havardgraff <1926313+havardgraff@users.noreply.github.com>
Co-authored-by: havardgraff <1926313+havardgraff@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
The 422 fork-only commits (linear, on top of upstream
3cd20010e0, 2025-11-01) replayed in their original order, one by one onto upstreammain=8d08c320ce(2026-10-06, 1.29.2.1, 2,828 commits ahead). Every replayed commit carries a(cherry picked from commit <old-sha>)trailer, so the old→new mapping is recoverable.Branch shape: first parent of the tip commit
854f49ea39is the clean linear series (499491c948, upstreammain+ patches). The second parent is the old forkmain(34adb59d78) and exists only so this branch fast-forwards the current history and can be pushed without force. Recommendation: instead of merging this PR, force-push499491c948as the newmainand archive the old tip asrebase/34adb59d78(fork convention). To review only our patches:git range-diff 3cd20010e0..34adb59d78 8d08c320ce..499491c948.Verification done
git merge-tree upstream/main fork/mainvs. this tree: only 41 files differ, all in conflicted files or deliberate adaptations (checked every non-conflict hunk, listed below).Dropped patches (already upstream / obsolete)
#55, #56 (vtdec iOS errors = 3e26f3b), #59, #171 (flvdemux
no-more-pads-threshold= f16074c), #225, #244, #261, #285 (avfdeviceprovider monitoring/screens), #288/#289 (avfvideosrcunique-id= 7c28143), #391-#393, #399, #401, #402 (h264parse/qtdemux hardening), #400 (pcapparse = 3833dd7), #407 (amcvideodec crop init = 941362b), and the vpcC byte-writer leak (code rewritten upstream), jni codec impl (removed upstream, 575317c).Notable conflict resolutions / adaptations
rtx-ssrc-mapproperty; kept upstream'srtx-percentage,max-csrcs,max-sources,is_rtx; fork'stimedout_ssrcslogic moved into upstream's newremove_source()helper; test helpergenerate_test_buffer_fullmerges both signatures.VK_SDK_PATHlogic; only extra frameworks kept.gst_caps_unref) ported.G_MAXUINT64 - 1("never signal", Pexip is live-only) since-1is out of range and would break class_init.gst_pad_start_tasknow gets a strong ref (upstream MR 11489).max-audio-samplesmerged with upstreammax-atom-size(single get/set pair); alsa double free, gstamc log-level downgrades re-applied on the new duplicated sites.Known issues / follow-ups (not done)
elements_rtpsession:test_twcc_stats_rtx_recover_not_lost_stufffails (bitrate-recv285182 vs 1129244). Not yet checked whether it fails on the old fork tip; suspects: upstream RTX throttling/is_rtxor TWCC stats merge.vpx-avx/-neon, pexhack) hard-codevpx_argswithout-DHAVE_VPX_1_8, sogstvpxdec.cfails with libvpx >= 1.8 (also on the old fork tip).timedout_ssrcs(#123) can now grow unbounded via upstream's LRU eviction: add a bound.twcc_statsmember that only #331 removes (intermediate commits Move base-class hash table teardown from dispose() to finalize() #62..#330 do not compile in rtpmanager; final tree is fine).cocoa_dep.found()guards iokit_dep;required: get_option('vulkan')should bevulkan_opt);ext/sctp/meson.buildusessctp_sourcesbefore definition (picks up gst-libs one, docs only).-1); avfvideosrc propertydevice-unique-id→unique-id;rtx-ssrc-mapremoved from RTPSession by the fork;device-indexdeprecation.Upstreaming plan (summary)
Rules: GitLab MRs to gstreamer/gstreamer
main; <= ~10 commits per MR, each building and tested; squashfixup!/FIXUP and add+revert pairs (#335, #349); keep[pexhack]/PEXHACK/PEXIP_MODIFICATION patches downstream; bumpSince:to 1.30, regenerate docs cache, run gst-indent/gitlint.rtptwccstats) + config (base-seqnum, feedback interval, packet event), (5) FEC recovery pct +GstRTPRepairMeta(new public API, own MR with docs), (6) testslast_flowretatomic, flowcombiner, testclock/harness races), then basetransform buffer lists; pad-revert hack stays downstreampexip_modificationdownstreamsctp-internal-dcsctpreplacing usrsctp, upstream lastSuggested order: (0) already-upstream drops, (1) small fixes, (2) core buffer-list + rtp repair meta, (3) rtpmanager features, (4) codecs/platform, (5) dcsctp.