security-union / videocall-rs

teleconference system written in rust
https://www.videocall.rs
MIT License
1.37k stars 118 forks source link

Optimization: if I am not watching a particular peer, do not send me their video #43

Open darioalessandro opened 1 year ago

darioalessandro commented 1 year ago

Is your feature request related to a problem? Please describe. In order to bump the max number of peers, do not send me video for peers that I can't see on my screen.

mkamonMdt commented 3 months ago

Hi with https://github.com/security-union/videocall-rs/issues/39 being underway it seems this issue can be tackled next by me. I got a little more into Actix capabilities and as far as I understand all messaging is done through the server that acts as a broker in that regard.

So the way I'm thinking about approaching the issue is that each user (Subscriber) will have to subscribe (there might be also some default setting here) on MediaType::VIDEO/SCREEN for users (Publisher) that video/screen transmission Subscriber would like to receive. The server keep track of all Subscribers per each Publisher and distribute the messaging accordingly. At first stage such subscription would be mandatory for all (20) Publishers that fit the screen (as per https://github.com/security-union/videocall-rs/issues/39 ) but then we could extend it to opting all out or selecting specific ones from PeerList.

@darioalessandro tell me what do you think, maybe you had some other approach in mind?

darioalessandro commented 3 months ago

@mkamonMdt that is correct, the UI will need to tell the actix server the list of peers that it wants to receive video for.

you can use protobuf messages here to signal the server:

You could define a new type within packet wrapper: https://github.com/security-union/videocall-rs/blob/d8eee8a2770dcd52d1f84d5dde71a5aaa03693c3/protobuf/types/packet_wrapper.proto#L4-L8

Then have the actix server read them.