You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: DOC.md
+22-3
Original file line number
Diff line number
Diff line change
@@ -207,7 +207,9 @@ Initiates the handshake process. Following this call, the local description call
207
207
Arguments:
208
208
209
209
-`pc`: the Peer Connection identifier
210
-
-`type` (optional): type of the description ("offer", "answer", "pranswer", or "rollback") or NULL for autodetection.
210
+
-`type` (optional): type of the description ("offer", "answer", "pranswer", or "rollback") or NULL for automatic (recommended).
211
+
212
+
Warning: This function expects the optional type for the local description and not an SDP description. It is not possible to set an existing SDP description.
211
213
212
214
#### rtcSetRemoteDescription
213
215
@@ -220,7 +222,8 @@ Sets the remote description received from the remote peer by the user's method o
220
222
Arguments:
221
223
222
224
-`pc`: the Peer Connection identifier
223
-
-`type` (optional): type of the description ("offer", "answer", "pranswer", or "rollback") or NULL for autodetection.
225
+
-`sdp`: the remote description in SDP format
226
+
-`type` (optional): type of the description ("offer", "answer", "pranswer", or "rollback") or NULL for automatic (not recommended).
224
227
225
228
If the remote description is an offer and `disableAutoNegotiation` was not set in `rtcConfiguration`, the library will automatically answer by calling `rtcSetLocalDescription` internally. Otherwise, the user must call it to answer the remote description.
226
229
@@ -296,7 +299,7 @@ Return value: the length of the string copied in buffer (including the terminati
296
299
297
300
If `buffer` is `NULL`, the description is not copied but the size is still returned.
298
301
299
-
#### rtcGetRemoteDescription
302
+
#### rtcGetRemoteDescriptionType
300
303
301
304
```
302
305
int rtcGetRemoteDescriptionType(int pc, char *buffer, int size)
@@ -314,6 +317,22 @@ Return value: the length of the string copied in buffer (including the terminati
314
317
315
318
If `buffer` is `NULL`, the description is not copied but the size is still returned.
316
319
320
+
#### rtcCreateOffer/rtcCreateAnswer
321
+
322
+
```
323
+
int rtcCreateOffer(int pc, char *buffer, int size)
324
+
int rtcCreateAnswer(int pc, char *buffer, int size)
325
+
```
326
+
327
+
Create a local offer or answer description in SDP format. These functions are intended only for specific use cases where the application needs to generate a description without setting it. It is useless to call them before `rtcSetLocalDescription` as it doesn't expect the user to supply a description.
328
+
329
+
-`pc`: the Peer Connection identifier
330
+
-`buffer`: a user-supplied buffer to store the description
331
+
-`size`: the size of `buffer`
332
+
333
+
Return value: the length of the string copied in buffer (including the terminating null character) or a negative error code
334
+
335
+
If `buffer` is `NULL`, the description is not copied but the size is still returned.
Copy file name to clipboardexpand all lines: pages/content/pages/reference.md
+22-3
Original file line number
Diff line number
Diff line change
@@ -210,7 +210,9 @@ Initiates the handshake process. Following this call, the local description call
210
210
Arguments:
211
211
212
212
-`pc`: the Peer Connection identifier
213
-
-`type` (optional): type of the description ("offer", "answer", "pranswer", or "rollback") or NULL for autodetection.
213
+
-`type` (optional): type of the description ("offer", "answer", "pranswer", or "rollback") or NULL for automatic (recommended).
214
+
215
+
Warning: This function expects the optional type for the local description and not an SDP description. It is not possible to set an existing SDP description.
214
216
215
217
#### rtcSetRemoteDescription
216
218
@@ -223,7 +225,8 @@ Sets the remote description received from the remote peer by the user's method o
223
225
Arguments:
224
226
225
227
-`pc`: the Peer Connection identifier
226
-
-`type` (optional): type of the description ("offer", "answer", "pranswer", or "rollback") or NULL for autodetection.
228
+
-`sdp`: the remote description in SDP format
229
+
-`type` (optional): type of the description ("offer", "answer", "pranswer", or "rollback") or NULL for automatic (not recommended).
227
230
228
231
If the remote description is an offer and `disableAutoNegotiation` was not set in `rtcConfiguration`, the library will automatically answer by calling `rtcSetLocalDescription` internally. Otherwise, the user must call it to answer the remote description.
229
232
@@ -299,7 +302,7 @@ Return value: the length of the string copied in buffer (including the terminati
299
302
300
303
If `buffer` is `NULL`, the description is not copied but the size is still returned.
301
304
302
-
#### rtcGetRemoteDescription
305
+
#### rtcGetRemoteDescriptionType
303
306
304
307
```
305
308
int rtcGetRemoteDescriptionType(int pc, char *buffer, int size)
@@ -317,6 +320,22 @@ Return value: the length of the string copied in buffer (including the terminati
317
320
318
321
If `buffer` is `NULL`, the description is not copied but the size is still returned.
319
322
323
+
#### rtcCreateOffer/rtcCreateAnswer
324
+
325
+
```
326
+
int rtcCreateOffer(int pc, char *buffer, int size)
327
+
int rtcCreateAnswer(int pc, char *buffer, int size)
328
+
```
329
+
330
+
Create a local offer or answer description in SDP format. These functions are intended only for specific use cases where the application needs to generate a description without setting it. It is useless to call them before `rtcSetLocalDescription` as it doesn't expect the user to supply a description.
331
+
332
+
-`pc`: the Peer Connection identifier
333
+
-`buffer`: a user-supplied buffer to store the description
334
+
-`size`: the size of `buffer`
335
+
336
+
Return value: the length of the string copied in buffer (including the terminating null character) or a negative error code
337
+
338
+
If `buffer` is `NULL`, the description is not copied but the size is still returned.
0 commit comments