Commit 91fa6937 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Display max layer in stats.

parent fd76abb6
......@@ -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,
......
......@@ -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)
......
......@@ -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"`
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment