PSA: C++ - Changing signature of RemoveTrack function

Skip to first unread message

Harald Alvestrand

Jan 5, 2022, 4:37:31 AMJan 5
If you don't use WebRTC from C++, or don't remove tracks, you can stop reading now.

The signature of the RemoveTrack function was:

virtual bool RemoveTrack(RtpSenderInterface* sender)

This failed to return an error stating what the problem was, and did not require the caller to hold a reference to the sender being disconnected.
The new signature we want people to use is

virtual RTCError RemoveTrackOrError(
      rtc::scoped_refptr<RtpSenderInterface> sender) 

The addition of "OrError" is required because C++ doesn't permit overloading on return value.

The old function is now marked Deprecated, and will eventually be removed (no earlier than Jan 19, 2022).


Reply all
Reply to author
0 new messages