Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .changeset/configutil-derive.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/configutil-static-observer.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/configutil-validator.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/egressobs-v2-audio-only.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/logger-config-marshal-yaml.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/psrpc-bus-split.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/simulation-repeats.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/sip-invite-time.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/utils-leaftest.md

This file was deleted.

24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# github.com/livekit/protocol

## 1.52.1

### Patch Changes

- Add `configutil.Derive` for narrowing an observable config onto a subtree - [#1795](https://github.com/livekit/protocol/pull/1795) ([@paulwe](https://github.com/paulwe))

- Add `configutil.NewStaticObserver`, which builds an `Observer` over an already-built config with no file to watch, for stubbing observable config in tests. `EmitConfigUpdate` now also stores the config it emits, so `Load` reflects an update pushed by hand. - [#1795](https://github.com/livekit/protocol/pull/1795) ([@paulwe](https://github.com/paulwe))

- Add `configutil.Validator`, an optional builder hook run on every config load after `InitDefaults`. A config that fails validation, or whose `InitDefaults` returns an error, now fails `NewObserver`; on reload the failure is logged and the previous config stays in effect. - [#1795](https://github.com/livekit/protocol/pull/1795) ([@paulwe](https://github.com/paulwe))

- `egressobs.GetAudioOnly` reports v2 `StartEgress` and replay export requests as audio-only when their Template or Web source sets `audio_only`. - [#1816](https://github.com/livekit/protocol/pull/1816) ([@milos-lk](https://github.com/milos-lk))

- Add FlexFEC stats to RTPStats - [#1818](https://github.com/livekit/protocol/pull/1818) ([@chenosaurus](https://github.com/chenosaurus))

- `logger.Config` implements `yaml.Marshaler`, so marshaling a `*Config` snapshots it under the same lock `Update` takes instead of reading fields alongside a concurrent update. - [#1813](https://github.com/livekit/protocol/pull/1813) ([@paulwe](https://github.com/paulwe))

- Update psrpc to v0.8.0 - [#1808](https://github.com/livekit/protocol/pull/1808) ([@paulwe](https://github.com/paulwe))

- agent_simulation: repeat scenarios within a run for pass@k / pass^k, and decide a scenario's verdict from a `Sampling.pass_rate` - [#1799](https://github.com/livekit/protocol/pull/1799) ([@u9g](https://github.com/u9g))

- Add `lk.sip.inviteTime` SIP participant attribute and agents `sip_invite_latency` reporter - [#1815](https://github.com/livekit/protocol/pull/1815) ([@paulwe](https://github.com/paulwe))

- Add `utils/leaftest`, which asserts that a package imports nothing beyond the standard library and an explicit allow list. `leaftest.Assert(t)` names the package from the working directory, so a guarded package's test carries no import path to keep in sync. Test-only imports are not counted. - [#1795](https://github.com/livekit/protocol/pull/1795) ([@paulwe](https://github.com/paulwe))

## 1.52.0

### Minor Changes
Expand Down
43 changes: 40 additions & 3 deletions livekit/livekit_models.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "github.com/livekit/protocol",
"private": true,
"version": "1.52.0",
"version": "1.52.1",
"scripts": {
"changeset": "changeset",
"ci:publish": "pnpm --filter @livekit/protocol run build && changeset publish"
Expand Down
22 changes: 22 additions & 0 deletions packages/javascript/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# @livekit/protocol

## 1.52.1

### Patch Changes

- Add `configutil.Derive` for narrowing an observable config onto a subtree - [#1795](https://github.com/livekit/protocol/pull/1795) ([@paulwe](https://github.com/paulwe))

- Add `configutil.NewStaticObserver`, which builds an `Observer` over an already-built config with no file to watch, for stubbing observable config in tests. `EmitConfigUpdate` now also stores the config it emits, so `Load` reflects an update pushed by hand. - [#1795](https://github.com/livekit/protocol/pull/1795) ([@paulwe](https://github.com/paulwe))

- Add `configutil.Validator`, an optional builder hook run on every config load after `InitDefaults`. A config that fails validation, or whose `InitDefaults` returns an error, now fails `NewObserver`; on reload the failure is logged and the previous config stays in effect. - [#1795](https://github.com/livekit/protocol/pull/1795) ([@paulwe](https://github.com/paulwe))

- Add FlexFEC stats to RTPStats - [#1818](https://github.com/livekit/protocol/pull/1818) ([@chenosaurus](https://github.com/chenosaurus))

- `logger.Config` implements `yaml.Marshaler`, so marshaling a `*Config` snapshots it under the same lock `Update` takes instead of reading fields alongside a concurrent update. - [#1813](https://github.com/livekit/protocol/pull/1813) ([@paulwe](https://github.com/paulwe))

- Update psrpc to v0.8.0 - [#1808](https://github.com/livekit/protocol/pull/1808) ([@paulwe](https://github.com/paulwe))

- agent_simulation: repeat scenarios within a run for pass@k / pass^k, and decide a scenario's verdict from a `Sampling.pass_rate` - [#1799](https://github.com/livekit/protocol/pull/1799) ([@u9g](https://github.com/u9g))

- Add `lk.sip.inviteTime` SIP participant attribute and agents `sip_invite_latency` reporter - [#1815](https://github.com/livekit/protocol/pull/1815) ([@paulwe](https://github.com/paulwe))

- Add `utils/leaftest`, which asserts that a package imports nothing beyond the standard library and an explicit allow list. `leaftest.Assert(t)` names the package from the working directory, so a guarded package's test carries no import path to keep in sync. Test-only imports are not counted. - [#1795](https://github.com/livekit/protocol/pull/1795) ([@paulwe](https://github.com/paulwe))

## 1.52.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/javascript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@livekit/protocol",
"version": "1.52.0",
"version": "1.52.1",
"description": "",
"type": "module",
"require": "dist/index.cjs",
Expand Down
7 changes: 6 additions & 1 deletion protobufs/livekit_models.proto
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,12 @@ message RTPStats {
RTPDrift ntp_report_drift = 45;
RTPDrift rebased_report_drift = 46;
RTPDrift received_report_drift = 47;
// NEXT_ID: 48

uint32 fec_packets = 48;
uint64 fec_bytes = 49;
uint32 fec_packets_discarded = 50;
uint32 fec_packets_recovered = 51;
// NEXT_ID: 52
}

message RTCPSenderReportState {
Expand Down
13 changes: 13 additions & 0 deletions utils/rtpstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ func AggregateRTPStats(statsList []*livekit.RTPStats, gapHistogramSize int) *liv
packetsPadding := uint32(0)
bytesPadding := uint64(0)
headerBytesPadding := uint64(0)
fecPackets := uint32(0)
fecBytes := uint64(0)
fecPacketsDiscarded := uint32(0)
fecPacketsRecovered := uint32(0)
packetsOutOfOrder := uint32(0)
frames := uint32(0)
keyFrames := uint32(0)
Expand Down Expand Up @@ -82,6 +86,11 @@ func AggregateRTPStats(statsList []*livekit.RTPStats, gapHistogramSize int) *liv
bytesPadding += stats.BytesPadding
headerBytesPadding += stats.HeaderBytesPadding

fecPackets += stats.FecPackets
fecBytes += stats.FecBytes
fecPacketsDiscarded += stats.FecPacketsDiscarded
fecPacketsRecovered += stats.FecPacketsRecovered

packetsOutOfOrder += stats.PacketsOutOfOrder

frames += stats.Frames
Expand Down Expand Up @@ -166,6 +175,10 @@ func AggregateRTPStats(statsList []*livekit.RTPStats, gapHistogramSize int) *liv
BytesPadding: bytesPadding,
HeaderBytesPadding: headerBytesPadding,
BitratePadding: bitratePadding,
FecPackets: fecPackets,
FecBytes: fecBytes,
FecPacketsDiscarded: fecPacketsDiscarded,
FecPacketsRecovered: fecPacketsRecovered,
PacketsOutOfOrder: packetsOutOfOrder,
Frames: frames,
FrameRate: frameRate,
Expand Down
53 changes: 53 additions & 0 deletions utils/rtpstats_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright 2026 LiveKit, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package utils

import (
"testing"
"time"

"github.com/stretchr/testify/require"
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/livekit/protocol/livekit"
)

func TestAggregateRTPStatsFEC(t *testing.T) {
start := time.Now()
end := start.Add(time.Second)
stats := AggregateRTPStats([]*livekit.RTPStats{
{
StartTime: timestamppb.New(start),
EndTime: timestamppb.New(end),
FecPackets: 3,
FecBytes: 900,
FecPacketsDiscarded: 1,
FecPacketsRecovered: 2,
},
{
StartTime: timestamppb.New(start),
EndTime: timestamppb.New(end),
FecPackets: 4,
FecBytes: 1200,
FecPacketsDiscarded: 2,
FecPacketsRecovered: 3,
},
}, 8)

require.EqualValues(t, 7, stats.FecPackets)
require.EqualValues(t, 2100, stats.FecBytes)
require.EqualValues(t, 3, stats.FecPacketsDiscarded)
require.EqualValues(t, 5, stats.FecPacketsRecovered)
}
Loading