-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New VideoRoom request to combine subscribe and unsubscribe #2962
Conversation
|
No, this means that this PR is based on that other PR (which is based on master), so testing one you actually test both. But the plan is indeed to merge them together when they're ready, yes. |
we are testing it now thanks to changes by @stefanzvkvc. |
Thanks for the feedback @mirkobrankovic! I was planning to merge both PRs today, can you confirm you didn't encounter any issue we need to be aware of using it? |
Do you mean in |
@lminiero no issues so far, we have a case (when screensharing starts) when we send update with subscribe and unsubscribe streams and MIDs are correctly recycled great news. Yeah I was thinking a long the way of current update:
so to re-configure the substream layers, not sure what else could be possible, if it is it does sound interesting to be combined. Thanks |
Ah no that's not planned at the moment. I was talking of the existing |
aah ok, configure for multiple mids is also a good step forward, thanks for update :) |
Merging then. |
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [meetecho/janus-gateway](https://github.com/meetecho/janus-gateway) | patch | `v1.0.1` -> `v1.0.2` | --- ### Release Notes <details> <summary>meetecho/janus-gateway</summary> ### [`v1.0.2`](https://github.com/meetecho/janus-gateway/blob/HEAD/CHANGELOG.md#v102---2022-05-23) [Compare Source](meetecho/janus-gateway@v1.0.1...v1.0.2) - Abort DTLS handshake if DTLSv1\_handle_timeout returns an error - Fixed rtx not being offered on Janus originated PeerConnections - Added configurable property to put a cap to task threads \[[Issue-2964](meetecho/janus-gateway#2964)] - Fixed build issue with libressl >= 3.5.0 (thanks [@​ffontaine](https://github.com/ffontaine)!) \[[PR-2980](meetecho/janus-gateway#2980)] - Link to -lresolv explicitly when building websockets transport - Fixed RED parsing not returning blocks when only primary data is available - Fixed typo in stereo support in EchoTest plugin - Added support for dummy publishers in VideoRoom \[[PR-2958](meetecho/janus-gateway#2958)] - Added new VideoRoom request to combine subscribe and unsubscribe operations \[[PR-2962](meetecho/janus-gateway#2962)] - Fixed incorrect removal of owner/subscriptions mapping in VideoRoom plugin \[[Issue-2965](meetecho/janus-gateway#2965)] - Explicitly return list of IDs VideoRoom users are subscribed to for data \[[Issue-2967](meetecho/janus-gateway#2967)] - Fixed data port not being returned when creating Streaming mountpoints with the legacy API - Fix address size in Streaming plugin RTCP sendto call (thanks [@​sjkummer](https://github.com/sjkummer)!) \[[PR-2976](meetecho/janus-gateway#2976)] - Added custom headers for SIP SUBSCRIBE requests (thanks [@​oriol-c](https://github.com/oriol-c)!) \[[PR-2971](meetecho/janus-gateway#2971)] - Make SIP timer T1X64 configurable (thanks [@​oriol-c](https://github.com/oriol-c)!) \[[PR-2972](meetecho/janus-gateway#2972)] - Disable IPv6 in WebSockets transport if binding to IPv4 address explicitly \[[Issue-2969](meetecho/janus-gateway#2969)] - Other smaller fixes and improvements (thanks to all who contributed pull requests and reported issues!) </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://git.walbeck.it/walbeck-it/docker-janus-gateway/pulls/79 Co-authored-by: renovate-bot <bot@walbeck.it> Co-committed-by: renovate-bot <bot@walbeck.it>
If you're familiar with how the new multistream-based VideoRoom API works, once a subscription PeerConnection has been created at the moment there are only two requests available to change it:
subscribe
to subscribe to new streams (e.g., users joining);unsubscribe
to unsubscribe from streams you're currently receiving (e.g., users leaving).This means that, to update a subscription, you have to use one or the other: if you want to both add new streams AND remove existing ones, you're forced to call those requests in sequence, which can result in an increased number of SDP offer/answer exchanges, and a more awkward streams management.
As the title suggests, this PR tries to solve that by adding a new request for subscribers, called
update
, whose purpose is exactly to allow you to change an existing subscriptions to both add some new streams and remove existing ones at the same time. The syntax of this newupdate
request is quite simple, since it works like this:This means that the
subscribe
array works exactly like thestreams
array you'd send in a "subscribe" request, while theunsubscribe
array works exactly like thestreams
array you'd send in a "unsubscribe" request instead. Both arrays are optional, which means that sending anupdate
with just asubscribe
array is functionally exactly the same as sending a "subscribe" request, and same for "unsubscribe": considering the format of those arrays is exactly the same too, it means those requests do become interchangeable, especially considering that the response is the same no matter what request you send (i.e., an "updated" event with new SDP offer and new list of streams, or an empty "updating" event if the new offer will be sent later).Of course, the greatest added benefit is the ability to pass both arrays at the same time, which will allow you to update a subscription with much finer grain control. It's important to point out that, when processing an
update
request, the plugin will always handle theunsubscribe
list, and thesubscribe
one.This PR is based on #2958 as they're part of the same set of enhancements we've been working on, and so as a consequence this means that if you test this PR, you can test dummy publishers too at the same time. When they're ready, we'll merge them both at the same time.
From a few tests I made, this seems to be working correctly for all requests: considering this considerably changes how the pre-existing
subscribe
andunsubscribe
requests now work internally, you'll want to make sure there are no regressions caused by this patch before we merge. As such, I strongly encourage you all to test this and provide feedback, especially if you use the multistream-based VideoRoom a lot.