1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-22 16:45:58 +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, Id: down.id,
} }
for _, t := range down.tracks { for _, t := range down.tracks {
l, _, _ := t.getLayerInfo() l, _, ml := t.getLayerInfo()
layer := int(l)
rate, _ := t.rate.Estimate() rate, _ := t.rate.Estimate()
rtt := rtptime.ToDuration(t.getRTT(), rtt := rtptime.ToDuration(t.getRTT(),
rtptime.JiffiesPerSec) rtptime.JiffiesPerSec)
@ -58,7 +57,8 @@ func (c *webClient) GetStats() *stats.Client {
j := time.Duration(jitter) * time.Second / j := time.Duration(jitter) * time.Second /
time.Duration(t.track.Codec().ClockRate) time.Duration(t.track.Codec().ClockRate)
conns.Tracks = append(conns.Tracks, stats.Track{ conns.Tracks = append(conns.Tracks, stats.Track{
Layer: &layer, Layer: &l,
MaxLayer: &ml,
Bitrate: uint64(rate) * 8, Bitrate: uint64(rate) * 8,
MaxBitrate: t.maxBitrate.Get(jiffies), MaxBitrate: t.maxBitrate.Get(jiffies),
Loss: float64(loss) / 256.0, 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'));
tr.appendChild(document.createElement('td')); tr.appendChild(document.createElement('td'));
let td = 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); tr.appendChild(td);
let td2 = document.createElement('td'); let td2 = document.createElement('td');
if(track.maxBitrate) if(track.maxBitrate)

View file

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