Skip to content

Commit

Permalink
Update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
paullouisageneau committed Jan 18, 2025
1 parent bab9544 commit ac6eb05
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
24 changes: 21 additions & 3 deletions DOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ Initiates the handshake process. Following this call, the local description call
Arguments:

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

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.

#### rtcSetRemoteDescription

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

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

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.

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

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

#### rtcGetRemoteDescription
#### rtcGetRemoteDescriptionType

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

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

#### rtcCreateOffer/rtcCreateAnswer

```
int rtcCreateOffer(int pc, char *buffer, int size)
int rtcCreateAnswer(int pc, char *buffer, int size)
```

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.

- `pc`: the Peer Connection identifier
- `buffer`: a user-supplied buffer to store the description
- `size`: the size of `buffer`

Return value: the length of the string copied in buffer (including the terminating null character) or a negative error code

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

#### rtcGetLocalAddress

Expand Down
24 changes: 21 additions & 3 deletions pages/content/pages/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ Initiates the handshake process. Following this call, the local description call
Arguments:

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

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.

#### rtcSetRemoteDescription

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

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

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.

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

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

#### rtcGetRemoteDescription
#### rtcGetRemoteDescriptionType

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

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

#### rtcCreateOffer/rtcCreateAnswer

```
int rtcCreateOffer(int pc, char *buffer, int size)
int rtcCreateAnswer(int pc, char *buffer, int size)
```

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.

- `pc`: the Peer Connection identifier
- `buffer`: a user-supplied buffer to store the description
- `size`: the size of `buffer`

Return value: the length of the string copied in buffer (including the terminating null character) or a negative error code

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

#### rtcGetLocalAddress

Expand Down

0 comments on commit ac6eb05

Please sign in to comment.