Skip to content

use generated name if no sink pad name provided#1294

Merged
kixelated merged 1 commit intomoq-dev:mainfrom
sidsethupathi:gst-generated-pad-name
Apr 12, 2026
Merged

use generated name if no sink pad name provided#1294
kixelated merged 1 commit intomoq-dev:mainfrom
sidsethupathi:gst-generated-pad-name

Conversation

@sidsethupathi
Copy link
Copy Markdown
Contributor

@sidsethupathi sidsethupathi commented Apr 12, 2026

This lets you construct pipelines without specifying the pad name on moqsink(eg. mux.sink_0 in the demo/pub Justfile).

eg.

gst-launch-1.0 -v -e videotestsrc ! video/x-raw,width=1280,height=720,framerate=60/1,format=I420 ! x264enc ! moqsink name=mux url="https://cdn.moq.dev/anon" broadcast="videotestsrc"

Without this, the above pipeline will panic.

thread '<unnamed>' panicked at rs/moq-gst/src/sink/imp.rs:237:25:
Attempt to build a Pad from a wildcard-name template or with a target Pad with an incompatible name. Make sure to define a specific name using PadBuilder or opt-in to keep the automatically generated name.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 12, 2026

Walkthrough

The pull request modifies the dynamic pad construction logic in ElementImpl for MoqSink within the sink implementation module. When request_new_pad is invoked without an explicit pad name parameter, the code now generates a pad name using pad_builder.generated_name().build() instead of pad_builder.build(). This ensures that unnamed pad requests receive automatically generated names. The subsequent pad addition and return operations remain unmodified.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: using a generated pad name when no sink pad name is provided, which matches the code modification in the changeset.
Description check ✅ Passed The pull request description clearly explains the purpose of the change: enabling pipelines to be constructed without specifying pad names on moqsink, includes a concrete example command and demonstrates the error that occurs without the fix.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kixelated kixelated merged commit f892593 into moq-dev:main Apr 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants