libmediasoupclient icon indicating copy to clipboard operation
libmediasoupclient copied to clipboard

Move SetRemoteDescription to Recommended API

Open GEverding opened this issue 3 years ago • 1 comments

HI,

In production we've observer that calls to SetRemoteDescription can block indefinitely. Based on comments from the WebRTC m94 branch this can happen.

  file: api/peer_connection_interface.h
  // Sets the remote session description.
  //
  // (Unlike "SDP munging" before SetLocalDescription(), modifying a remote
  // offer or answer is allowed by the spec.)
  //
  // The observer is invoked as soon as the operation completes, which could be
  // before or after the SetRemoteDescription() method has exited.
  virtual void SetRemoteDescription(
      std::unique_ptr<SessionDescriptionInterface> desc,
      rtc::scoped_refptr<SetRemoteDescriptionObserverInterface> observer) = 0;
  // Like SetRemoteDescription() above, but the observer is invoked with a delay
  // after the operation completes. This helps avoid recursive calls by the
  // observer but also makes it possible for states to change in-between the
  // operation completing and the observer getting called. This makes them racy
  // for synchronizing peer connection states to the application.
  // TODO(https://crbug.com/webrtc/11798): Delete this method in favor of the
  // ones taking SetRemoteDescriptionObserverInterface as argument.
  virtual void SetRemoteDescription(SetSessionDescriptionObserver* observer,
                                    SessionDescriptionInterface* desc) {}

I've implemented the api using the SetRemoteDescriptionObserverInterface. Looking for feedback to this change.

GEverding avatar Jan 28 '22 22:01 GEverding

please @GEverding, run gulp format

jmillan avatar Jun 14 '22 10:06 jmillan

This is already implemented in https://github.com/versatica/libmediasoupclient/pull/154

jmillan avatar May 23 '23 14:05 jmillan