Skip to content

Commit ac6eb05

Browse files
Update doc
1 parent bab9544 commit ac6eb05

File tree

2 files changed

+42
-6
lines changed

2 files changed

+42
-6
lines changed

DOC.md

+21-3
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ Initiates the handshake process. Following this call, the local description call
207207
Arguments:
208208

209209
- `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.
211213

212214
#### rtcSetRemoteDescription
213215

@@ -220,7 +222,7 @@ Sets the remote description received from the remote peer by the user's method o
220222
Arguments:
221223

222224
- `pc`: the Peer Connection identifier
223-
- `type` (optional): type of the description ("offer", "answer", "pranswer", or "rollback") or NULL for autodetection.
225+
- `type` (optional): type of the description ("offer", "answer", "pranswer", or "rollback") or NULL for automatic (not recommended).
224226

225227
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.
226228

@@ -296,7 +298,7 @@ Return value: the length of the string copied in buffer (including the terminati
296298

297299
If `buffer` is `NULL`, the description is not copied but the size is still returned.
298300

299-
#### rtcGetRemoteDescription
301+
#### rtcGetRemoteDescriptionType
300302

301303
```
302304
int rtcGetRemoteDescriptionType(int pc, char *buffer, int size)
@@ -314,6 +316,22 @@ Return value: the length of the string copied in buffer (including the terminati
314316

315317
If `buffer` is `NULL`, the description is not copied but the size is still returned.
316318

319+
#### rtcCreateOffer/rtcCreateAnswer
320+
321+
```
322+
int rtcCreateOffer(int pc, char *buffer, int size)
323+
int rtcCreateAnswer(int pc, char *buffer, int size)
324+
```
325+
326+
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.
327+
328+
- `pc`: the Peer Connection identifier
329+
- `buffer`: a user-supplied buffer to store the description
330+
- `size`: the size of `buffer`
331+
332+
Return value: the length of the string copied in buffer (including the terminating null character) or a negative error code
333+
334+
If `buffer` is `NULL`, the description is not copied but the size is still returned.
317335

318336
#### rtcGetLocalAddress
319337

pages/content/pages/reference.md

+21-3
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ Initiates the handshake process. Following this call, the local description call
210210
Arguments:
211211

212212
- `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.
214216

215217
#### rtcSetRemoteDescription
216218

@@ -223,7 +225,7 @@ Sets the remote description received from the remote peer by the user's method o
223225
Arguments:
224226

225227
- `pc`: the Peer Connection identifier
226-
- `type` (optional): type of the description ("offer", "answer", "pranswer", or "rollback") or NULL for autodetection.
228+
- `type` (optional): type of the description ("offer", "answer", "pranswer", or "rollback") or NULL for automatic (not recommended).
227229

228230
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.
229231

@@ -299,7 +301,7 @@ Return value: the length of the string copied in buffer (including the terminati
299301

300302
If `buffer` is `NULL`, the description is not copied but the size is still returned.
301303

302-
#### rtcGetRemoteDescription
304+
#### rtcGetRemoteDescriptionType
303305

304306
```
305307
int rtcGetRemoteDescriptionType(int pc, char *buffer, int size)
@@ -317,6 +319,22 @@ Return value: the length of the string copied in buffer (including the terminati
317319

318320
If `buffer` is `NULL`, the description is not copied but the size is still returned.
319321

322+
#### rtcCreateOffer/rtcCreateAnswer
323+
324+
```
325+
int rtcCreateOffer(int pc, char *buffer, int size)
326+
int rtcCreateAnswer(int pc, char *buffer, int size)
327+
```
328+
329+
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.
330+
331+
- `pc`: the Peer Connection identifier
332+
- `buffer`: a user-supplied buffer to store the description
333+
- `size`: the size of `buffer`
334+
335+
Return value: the length of the string copied in buffer (including the terminating null character) or a negative error code
336+
337+
If `buffer` is `NULL`, the description is not copied but the size is still returned.
320338

321339
#### rtcGetLocalAddress
322340

0 commit comments

Comments
 (0)