1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-12-22 15:25:48 +01:00

Display max layer in stats.

This commit is contained in:
Juliusz Chroboczek 2021-05-17 13:51:29 +02:00
parent fd76abb61d
commit 91fa693709
3 changed files with 7 additions and 5 deletions

View file

@ -49,8 +49,7 @@ func (c *webClient) GetStats() *stats.Client {
Id: down.id,
}
for _, t := range down.tracks {
l, _, _ := t.getLayerInfo()
layer := int(l)
l, _, ml := t.getLayerInfo()
rate, _ := t.rate.Estimate()
rtt := rtptime.ToDuration(t.getRTT(),
rtptime.JiffiesPerSec)
@ -58,7 +57,8 @@ func (c *webClient) GetStats() *stats.Client {
j := time.Duration(jitter) * time.Second /
time.Duration(t.track.Codec().ClockRate)
conns.Tracks = append(conns.Tracks, stats.Track{
Layer: &layer,
Layer: &l,
MaxLayer: &ml,
Bitrate: uint64(rate) * 8,
MaxBitrate: t.maxBitrate.Get(jiffies),
Loss: float64(loss) / 256.0,

View file

@ -95,7 +95,8 @@ function formatTrack(table, track) {
tr.appendChild(document.createElement('td'));
tr.appendChild(document.createElement('td'));
let td = document.createElement('td');
td.textContent = track.layer;
if(track.layer && track.maxLayer)
td.textContent = `${track.layer}/${track.maxLayer}`;
tr.appendChild(td);
let td2 = document.createElement('td');
if(track.maxBitrate)

View file

@ -47,7 +47,8 @@ func (d *Duration) UnmarshalJSON(buf []byte) error {
}
type Track struct {
Layer *int `json:"layer,omitempty"`
Layer *uint8 `json:"layer,omitempty"`
MaxLayer *uint8 `json:"maxLayer,omitempty"`
Bitrate uint64 `json:"bitrate"`
MaxBitrate uint64 `json:"maxBitrate,omitempty"`
Loss float64 `json:"loss"`