Skip to content

Comments

Handle sending and receiving RTP capabilities separately#359

Closed
6uliver wants to merge 1 commit intoversatica:v3from
6uliver:v3
Closed

Handle sending and receiving RTP capabilities separately#359
6uliver wants to merge 1 commit intoversatica:v3from
6uliver:v3

Conversation

@6uliver
Copy link

@6uliver 6uliver commented Feb 17, 2026

@ibc as you mentioned in this ticket (#141):

"The device can later create send transports and recv transports. There is where we should run different code to get capabilities from a local SDP offer. But unfortunately we don't do that (yet)."

As the library has separate transports we don't need to set the direction in the Device constructor anymore but we can have a direction parameter in the getNativeRtpCapabilities. This will solve the problem mentioned in #141 that our team has as well: if the device can not encode (send) something the library won't detect the capability for decoding (receiving). By setting the direction for the transceivers in the getNativeRtpCapabilities we will get the correct capabilities for sending and receiving which are possibly different.

I tried to keep the public interface backward compatible (rtpCapabilities is doing the same as before but with the fix so it's really the capabilities for receiving media) and extend it with new functionalities: rtpReceiveCapabilities, rtpSendCapabilities.
The getRecvRtpCapabilities is working as before, I've just refactored it to a helper function and added the new getSendRtpCapabilities.

I hope you like it and can merge as soon as possible. In case you have any requests feel free to ask, I'm more than happy to fix anything related to this problem.

@ibc
Copy link
Member

ibc commented Feb 17, 2026

Thanks @6uliver. It looks good but honestly this change is too sensitive and I need to redo it on my own to be sure of what these changes do. Probably I'll end copy&pasting 99% of your PR but I need to do it. Let me please check these changes and work on this these days.

ibc added a commit that referenced this pull request Feb 17, 2026
# Details

- Fixes #141
- This PR replaces PR #359 but it's basically a copy&paste of it with some minimal cosmetic changes. So absolutely all credits to @6uliver.
- Now we generate different RTP capabilities for sending and receiving and the only change in the public API is that `device.rtpCapabilities` getter is now deprecated and instead the app should use `device.recvRtpCapabilities` and `device.sendRtpCapabilities`.

# TODO

* [ ] In the documentation website, document that `device.rtpCapabilities` getter is now deprecated and instead the app should use `device.recvRtpCapabilities` and `device.sendRtpCapabilities`.
@ibc
Copy link
Member

ibc commented Feb 17, 2026

Hi @6uliver, as said above I basically forked your PR, did minor cosmetic changes and I tested it locally with all browsers. Let me replace this PR.

#360

@ibc ibc closed this Feb 17, 2026
@6uliver
Copy link
Author

6uliver commented Feb 17, 2026

Great, thanks for your quick response!

ibc added a commit that referenced this pull request Feb 17, 2026
- Fixes #141
- This PR replaces PR #359 but it's basically a copy&paste of it with some minimal cosmetic changes. So absolutely all credits to @6uliver.
- Now we generate different RTP capabilities for sending and receiving and the only change in the public API is that `device.rtpCapabilities` getter is now deprecated and instead the app should use `device.recvRtpCapabilities` and `device.sendRtpCapabilities`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect reporting for the RTP capabilities if the 'Device' is used only for consuming streams

2 participants