Add Version to TrackInfo. (#2324)

* Add Version to TrackInfo.

Set when a track is published.

* update protocol
This commit is contained in:
Raja Subramanian
2023-12-19 11:50:48 +05:30
committed by GitHub
parent 5ee307952e
commit 37539fdf76
7 changed files with 160 additions and 18 deletions
+8
View File
@@ -28,6 +28,7 @@ import (
"github.com/livekit/protocol/livekit"
"github.com/livekit/protocol/logger"
"github.com/livekit/protocol/utils"
"github.com/livekit/livekit-server/pkg/config"
"github.com/livekit/livekit-server/pkg/rtc/types"
@@ -644,6 +645,13 @@ func (t *MediaTrackReceiver) TrackInfo(generateLayer bool) *livekit.TrackInfo {
return ti
}
func (t *MediaTrackReceiver) Version() utils.TimedVersion {
t.lock.RLock()
defer t.lock.RUnlock()
return utils.TimedVersionFromProto(t.trackInfo.Version)
}
func (t *MediaTrackReceiver) UpdateVideoLayers(layers []*livekit.VideoLayer) {
t.lock.Lock()
for _, layer := range layers {