PSA: C++ - Changing signature of RemoveTrack function

100 views
Skip to first unread message

Harald Alvestrand

unread,
Jan 5, 2022, 4:37:31 AMJan 5
to discuss...@googlegroups.com
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).

Harald

Harald Alvestrand

unread,
Feb 1, 2022, 4:39:22 AMFeb 1
to discuss...@googlegroups.com
The old function has now been removed.

Reply all
Reply to author
Forward
0 new messages