Skip to content

Bridge: RpcController#67

Merged
stephen-derosa merged 1 commit intolivekit:mainfrom
stephen-derosa:sderosa/bridge-rpc
Mar 19, 2026
Merged

Bridge: RpcController#67
stephen-derosa merged 1 commit intolivekit:mainfrom
stephen-derosa:sderosa/bridge-rpc

Conversation

@stephen-derosa
Copy link
Contributor

@stephen-derosa stephen-derosa commented Feb 27, 2026

Overview

RPC Controller for handling built in RPC calls and user registered RPC calls.

Built in RPC calls

  • mute/unmute tracks on remote participants

Examples

examples/bridge_mute_unmute/
examples/bridge_rpc/

Testing

  • RPC application level integration tests
  • RpcController unit tests
  • testing through examples

@stephen-derosa stephen-derosa self-assigned this Feb 27, 2026
@stephen-derosa stephen-derosa added the enhancement New feature or request label Feb 27, 2026
@stephen-derosa stephen-derosa force-pushed the sderosa/bridge-rpc branch 2 times, most recently from e38dd58 to 3237ad6 Compare March 5, 2026 16:51
@xianshijing-lk
Copy link
Collaborator

I think we are on the right track. some more questions

* @param handler Callback invoked on each incoming invocation.
* @return true if the RPC method was registered successfully.
*/
bool registerRpcMethod(const std::string &method_name,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RpcMethod is pretty low level, I wonder if we should make a remote controller, and we will setup a remoteControlInternal method as the communication channel for the remote control

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not sure i understand the need to break this into another layer. My intention here was to have a single object (currently RPCManager) which does all the interfacing with the local participant required to register/make/receive RPC calls. I wanted to keep the function of registerRpcMethod here the same as it is in the local participant for clarity.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

who is going to call this registerRpcMethod() ? like developers ? or it will be called by your RpcController / RpcManager ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a developer in their application would call: livekit_bridge->registerRpcMethod("my-awesome-rpc", awesome_rpc_handle) which simply wraps around the RpcController

@stephen-derosa stephen-derosa changed the title Bridge: RPCManager Bridge: RpcControlle Mar 10, 2026
@stephen-derosa stephen-derosa changed the title Bridge: RpcControlle Bridge: RpcController Mar 10, 2026
* @param handler Callback invoked on each incoming invocation.
* @return true if the RPC method was registered successfully.
*/
bool registerRpcMethod(const std::string &method_name,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

who is going to call this registerRpcMethod() ? like developers ? or it will be called by your RpcController / RpcManager ?

const std::shared_ptr<livekit::Track> &track,
VideoFrameCallback cb);

/// Execute a track action (mute/unmute/release) by track name.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just found that you are expecting the users to call release for the tracks explicitly ?

aren't tracks managed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

users have the option to release tracks in the case they want to release a track before disconnecting. But in the case a disconnect happens, the track will be release by the manager.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that being said, these RPC calls are to enable a remote participant to request mute/unmute of another remote participant.

* @param track_name Name of the track to mute.
* @return true if the track was muted successfully.
*/
bool requestRemoteTrackMute(const std::string &destination_identity,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These APIs are very concerning and can be very confusing.

What if the remote participant is not a livektiBridge (or SessionManager after the rename )?

How do you make sure these actions are backward compatitable ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These built in RPC calls only work from session manager to session manager, since the RpcController belongs to the session manager. Of course users can register their own remote track mute/unmute RPC methods!

Copy link
Collaborator

@xianshijing-lk xianshijing-lk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets keep the livekit_bridge naming then

RPCManager: bridge object for managing default and custom RPC calls

bridge_rpc examples

RPCManager tests

requestTrackMute/Unmute -> requestRemoteTrackMute/Unmute . Make the trackActionFn action input an Enum

add spdlog to docker and github actions
@stephen-derosa stephen-derosa merged commit 67a8a10 into livekit:main Mar 19, 2026
7 checks passed
@stephen-derosa stephen-derosa deleted the sderosa/bridge-rpc branch March 19, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants