moq-gst: Fix MoqSink CAPS handling and per-pad EOS aggregation#1402
Conversation
|
@sidsethupathi @kixelated. Let me know if you have any questions. I tested with:
My main concern was with a possible race conditions between add/remove pad and EOS. Some of the other items are just for gst state. |
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughMoqSink's sink-pad event handling was refactored to aggregate EOS signals per pad instead of using a global counter. The 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| return false; | ||
| } | ||
|
|
||
| true |
There was a problem hiding this comment.
Should gst::Pad::event_default be called for EOS as well?
There was a problem hiding this comment.
No. This is a terminal SINK. It will never forward on EOS downstream. The caps need to for internal state.
sidsethupathi
left a comment
There was a problem hiding this comment.
Confirmed that multiple pads still works as expected.
gst-launch-1.0 -v -e videotestsrc is-live=true num-buffers=120 ! video/x-raw,width=1280,height=720,framerate=60/1,format=I420 ! x264enc ! moqsink name=mux url="https://cdn.moq.dev/anon" broadcast="videotestsrc" audiotestsrc is-live=true num-buffers=100 samplesperbuffer=882 ! avenc_aac ! mux.
|
Hand tested a failure case pointed at /dev/null. I will look into this more for proper handling. For now I think this will prevent a few hard to find bugs with EOS. |
|
Yep this is closer to how I expected EOS handling to work. |
This fixes two correctness issues in sink/imp.rs: CAPS events are now passed to event_default() after configuring the background task, so pad state still updates normally, and EOS tracking is now per-pad instead of using a single counter. That avoids premature or missed element EOS when pads are dynamic, dropped, or emit EOS more than once.