medooze / media-server-node

WebRTC Media Server for Node.js
MIT License
802 stars 119 forks source link

Fix available layers stats when VLA is used with a single/default layer #231

Closed murillo128 closed 11 months ago

murillo128 commented 11 months ago

If VLA is used with a single layer stream with no layer info (for example an h264 stream), a new LayerSource was created for storing the target bitrate/width/heigh/fps, but it was not used for calculating the other stats

So when the stats where gathered, as there was already a single layer, the code to create a default layer for the source if no layer info was present, was not run, and therefore the bitrate field was not exposed correctly.

With the change on the media server, we are adding the target stats to the RTPIncomingSource as well and not creating a LayerSource.

This PR exposes the target stats at source level and so the getActiveLayers() provide the correct info.