Skip to content

Add publish track messages. #1134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Add publish track messages. #1134

wants to merge 4 commits into from

Conversation

boks1971
Copy link
Contributor

No description provided.

@boks1971 boks1971 marked this pull request as draft July 18, 2025 15:49
Copy link

changeset-bot bot commented Jul 18, 2025

⚠️ No Changeset found

Latest commit: 4082f30

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "github.com/livekit/protocol" specified in the `fixed` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

@@ -50,6 +50,8 @@ message Signalv2ClientMessage {

oneof message {
ConnectRequest connect_request = 2;
RPC_AddAudioTrackRequest rpc_add_audio_track_request = 3;
RPC_AddVideoTrackRequest rpc_add_video_track_request = 4;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

RPC prefix is just syntactic sugar to identify RPC style messages.

@@ -77,6 +104,20 @@ message ConnectRequest {
// will overwrite if the same key is in the token
// will not delete keys from token if there is a key collision and this sets that key to empty value
map<string, string> participant_attributes = 4;

repeated AudioTrack audio_tracks = 5;
repeated VideoTrack video_tracks = 6;
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 tracks are added as part of ConnectRequest. Ideally, these should always be added and never queued. But, this differs from sending AddTrackRequest later. How should we think about it?

}

message RPC_AddAudioTrackResponse {
RPC_AddAudioTrackRequest rpc_add_audio_track_request = 1; // request reflected back
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reflecting the entire request for convenience on sender side. They have full context in the reply.

repeated SimulcastCodec simulcast_codecs = 3;
BackupCodecPolicy backup_codec_policy = 4;
string sid = 5; // used when publishing a new codec to an existing track
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Splitting audio/video into separate messages in an attempt to make things cleaner, i. e. to have only relevant fields.

message RPC_AddVideoTrackResponse {
RPC_AddVideoTrackRequest rpc_add_video_track_request = 1; // request reflected back
AddTrackState add_track_state = 2;
TrackInfo track_info = 3;
Copy link
Contributor Author

@boks1971 boks1971 Jul 18, 2025

Choose a reason for hiding this comment

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

Although on the request side, splitting message definition by track type, keeping TrackInfo in the updates. But, an option is to make AudioTrackInfo and VideoTrackInfo, but that will be a massive change on server side if we were to keep two different types as a lot of code relies on TrackInfo.

However to ease the implementation effort, can keep TrackInfo internally and convert to AudioTrackInfo and VideoTrackInfo when sending updates. If having separate types would really help, can dig into it more.

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.

1 participant