Skip to content
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

Support for dummy publishers in VideoRoom #2958

Merged
merged 4 commits into from
May 20, 2022
Merged

Support for dummy publishers in VideoRoom #2958

merged 4 commits into from
May 20, 2022

Conversation

lminiero
Copy link
Member

In a VideoRoom, you can only subscribe to someone if they're actually in the room: as a consequence, if the room is empty, you can't create a subscription handle/PeerConnection, because there's not an ID to subscribe to. This patch tries to address that, and open some interesting opportunities.

Specifically, it adds the concept of "dummy publisher". When you create a new room, you can ask for a dummy publisher to be created: this publisher will have an ID like all other (real) participants, but will only exist for the purpose of allowing you to subscribe to something, without ever sending you any data. It also acts as an empty placeholder that you can switch to/from. Of course, this dummy publisher is clearly marked so that you can skip it if needed, or know how to use it. When creating a dummy publisher, by default a stream is added for each of the supported codecs in the room. You can limit the codecs to support in the dummy publisher, as well as specifying some fmtp attributes to advertise, when creating the room.

The syntax is relatively straightforward, as all you need to enable the feature (which is disabled by default) is add a

dummy_publisher: true

property when creating the room (statically or dynamically). As anticipated, this will create a publisher with a different stream for each supported codec, which means that if the room is created like this:

audiocodec: "opus",
videocodec: "vp8,vp9",
dummy_publisher: true

meaning Opus is the only supported codec for audio, but the room accepts both VP8 and VP9, then this dummy publisher will be created with three publisher streams, as if they were publishing an Opus audio stream, a VP8 video stream, and a VP9 video stream, thus allowing other participants in the room to subscribe to whatever they want. You can enforce a finer grain control on the streams to make available passing a dummy_stream array too when creating the room, where each object needs to reference an existing codec, e.g.:

dummy_publisher: true,
dummy_streams = [ { codec: "opus" }, { codec: "vp8" }, { codec: "vp9" } ]

If for instance you only want to have the dummy publisher to have Opus and VP8, but not VP9, you'd use something like this:

dummy_publisher: true,
dummy_streams = [ { codec: "opus" }, { codec: "vp8" } ]

If you want the dummy publisher to offer something specific in the SDP, you can add an fmtp property in the codec object, e.g.:

dummy_publisher: true,
dummy_streams = [ { codec:  "opus", fmtp: "stereo=1" }, { codec: "vp8" } ]

to advertise the Opus stream as stereo in its fmtp attribute.

As anticipated, dummy publishers are listed just as any other valid publisher in the room, which means you can use and reference them exactly as you already do: you can subscribe/unsubscribe to them, switch to them, etc. You can recognize a dummy publisher by the dummy: true property in the publishers list, which will make it easy to identify them quickly (this PR changes the demos too so that they're skipped by default).

From the few tests I've made this seems to be working as expected, but of course feedback in case it's not working as expected or it's breaking something that worked before is more than welcome.

@lminiero lminiero added the multistream Related to Janus 1.x label Apr 28, 2022
@lminiero
Copy link
Member Author

Merging.

@lminiero lminiero merged commit 2032e3a into master May 20, 2022
@lminiero lminiero deleted the dummy-publisher branch May 20, 2022 10:36
mwalbeck pushed a commit to mwalbeck/docker-janus-gateway that referenced this pull request May 25, 2022
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 [@&#8203;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 [@&#8203;sjkummer](https://github.com/sjkummer)!) \[[PR-2976](meetecho/janus-gateway#2976)]
-   Added custom headers for SIP SUBSCRIBE requests (thanks [@&#8203;oriol-c](https://github.com/oriol-c)!) \[[PR-2971](meetecho/janus-gateway#2971)]
-   Make SIP timer T1X64 configurable (thanks [@&#8203;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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multistream Related to Janus 1.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant