소스 검색

Added rtcGetMaxDataChannelStream() to C API

Paul-Louis Ageneau 3 년 전
부모
커밋
cfd98a9444
2개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      include/rtc/rtc.h
  2. 7 0
      src/capi.cpp

+ 2 - 0
include/rtc/rtc.h

@@ -190,6 +190,8 @@ RTC_EXPORT int rtcGetRemoteAddress(int pc, char *buffer, int size);
 RTC_EXPORT int rtcGetSelectedCandidatePair(int pc, char *local, int localSize, char *remote,
                                            int remoteSize);
 
+RTC_EXPORT int rtcGetMaxDataChannelStream(int pc);
+
 // DataChannel, Track, and WebSocket common API
 
 RTC_EXPORT int rtcSetOpenCallback(int id, rtcOpenCallbackFunc cb);

+ 7 - 0
src/capi.cpp

@@ -614,6 +614,13 @@ int rtcGetSelectedCandidatePair(int pc, char *local, int localSize, char *remote
 	});
 }
 
+int rtcGetMaxDataChannelStream(int pc) {
+	return wrap([&] {
+		auto peerConnection = getPeerConnection(pc);
+		return int(peerConnection->maxDataChannelId());
+	});
+}
+
 int rtcSetOpenCallback(int id, rtcOpenCallbackFunc cb) {
 	return wrap([&] {
 		auto channel = getChannel(id);