Repository navigation
pjmedia: pass application data to the conference operation callback - #5320
Merged
Merged
Conversation
Add user_data to pjmedia_conf_param, passed back in the new pjmedia_conf_op_info::user_data at every invocation of the operation callback, in the serial and the parallel bridge. Also set pjmedia_conf_op_info::conf for the queued operations of the parallel bridge, which were reported with a NULL conf. Based on a patch by Christian Becker. Co-Authored-By Claude Code
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The callback context is consistently initialized across supported backends and covered by focused tests.
Review effort: Balanced
Findings: None
What changed in this PR
Adds application context to conference operation callbacks, enabling callers to identify the owning conference bridge.
Changes:
- Adds
user_datato conference creation parameters and callback information. - Propagates bridge and user data through serial and parallel callback paths.
- Adds callback coverage for queued, cancelled, synchronous, and destruction operations.
| File | Description |
|---|---|
pjmedia/include/pjmedia/conference.h |
Defines and documents callback user data. |
pjmedia/src/pjmedia/conference.c |
Propagates user data in the serial backend. |
pjmedia/src/pjmedia/conf_thread.c |
Propagates bridge and user data in the parallel backend. |
pjmedia/src/test/conf_test.c |
Tests callback context across operation paths. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
sauwming
approved these changes
Oct 7, 2026
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.
An application running several conference bridges, each wrapped in its own object, can't tell which object a
pjmedia_conf_set_op_cb()callback belongs to without keeping its own map from bridge to owner. #4699 added the bridge pointer topjmedia_conf_op_info; this adds application data.pjmedia_conf_param::user_data(defaultNULL) is set at creation withpjmedia_conf_create2(), and passed back in the newpjmedia_conf_op_info::user_data. No new API,pjmedia_conf_set_op_cb()is unchanged.conference.c) and the parallel (conf_thread.c) bridge: the queued operations, the cancelled operations and the synchronous removal inpjmedia_conf_remove_port(), and the removals inpjmedia_conf_destroy(). The switch board backend has no operation callback.pjmedia_conf_op_info::confset toNULL.conf_testgainsop_user_data_test(): it removes a port before its add-op has run, then lets the clock complete a queued add-op, then destroys the bridge, and checks every callback carries the bridge and the user data. Without the change it fails on both the serial and the parallel bridge.Based on a patch by Christian Becker.
Co-Authored-By Claude Code