Browse Source

Added rtcSetLocalDescription() to C API

Paul-Louis Ageneau 4 years ago
parent
commit
d16f2b9e2f
2 changed files with 8 additions and 0 deletions
  1. 1 0
      include/rtc/rtc.h
  2. 7 0
      src/rtc.cpp

+ 1 - 0
include/rtc/rtc.h

@@ -110,6 +110,7 @@ RTC_EXPORT int rtcSetLocalCandidateCallback(int pc, rtcCandidateCallbackFunc cb)
 RTC_EXPORT int rtcSetStateChangeCallback(int pc, rtcStateChangeCallbackFunc cb);
 RTC_EXPORT int rtcSetGatheringStateChangeCallback(int pc, rtcGatheringStateCallbackFunc cb);
 
+RTC_EXPORT int rtcSetLocalDescription(int pc);
 RTC_EXPORT int rtcSetRemoteDescription(int pc, const char *sdp, const char *type);
 RTC_EXPORT int rtcAddRemoteCandidate(int pc, const char *cand, const char *mid);
 

+ 7 - 0
src/rtc.cpp

@@ -476,6 +476,13 @@ int rtcSetTrackCallback(int pc, rtcTrackCallbackFunc cb) {
 	});
 }
 
+int rtcSetLocalDescription(int pc) {
+	return WRAP({
+		auto peerConnection = getPeerConnection(pc);
+		peerConnection->setLocalDescription();
+	});
+}
+
 int rtcSetRemoteDescription(int pc, const char *sdp, const char *type) {
 	return WRAP({
 		auto peerConnection = getPeerConnection(pc);