mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-19 08:37:54 +01:00

This reverts commit0f2ce5cc1c
. Reason for revert: Downstream infrastructure should be ready now Original change's description: > Revert "Migrate WebRTC documentation to new renderer" > > This reverts commit3eceaf4669
. > > Reason for revert: > > Original change's description: > > Migrate WebRTC documentation to new renderer > > > > Bug: b/258408932 > > Change-Id: Ib96f39fe0c3912f9746bcc09d079097a145d6115 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290987 > > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > > Commit-Queue: Artem Titov <titovartem@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#39205} > > Bug: b/258408932 > Change-Id: I16cb4088bee3fc15c2bb88bd692c592b3a7db9fe > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291560 > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Owners-Override: Artem Titov <titovartem@webrtc.org> > Commit-Queue: Artem Titov <titovartem@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#39209} Bug: b/258408932 Change-Id: Ia172e4a6ad1cc7953b48eed08776e9d1e44eb074 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291660 Owners-Override: Artem Titov <titovartem@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Artem Titov <titovartem@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39231}
51 lines
2.2 KiB
Markdown
51 lines
2.2 KiB
Markdown
<!-- go/cmark -->
|
|
<!--* freshness: {owner: 'hta' reviewed: '2021-04-12'} *-->
|
|
|
|
# The WebRTC API
|
|
|
|
The public API of the WebRTC library consists of the api/ directory and
|
|
its subdirectories. No other files should be depended on by webrtc users.
|
|
|
|
Before starting to code against the API, it is important to understand
|
|
some basic concepts, such as:
|
|
|
|
* Memory management, including webrtc's reference counted objects
|
|
* [Thread management](threading_design.md)
|
|
|
|
## Using WebRTC through the PeerConnection class
|
|
|
|
The
|
|
[PeerConnectionInterface](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/peer_connection_interface.h?q=webrtc::PeerConnectionInterface)
|
|
class is the recommended way to use the WebRTC library.
|
|
|
|
It is closely modeled after the Javascript API documented in the [WebRTC
|
|
specification](https://w3c.github.io/webrtc-pc/).
|
|
|
|
PeerConnections are created using the [PeerConnectionFactoryInterface](https://source.chromium.org/search?q=webrtc::PeerConnectionFactoryInterface).
|
|
|
|
There are two levels of customization available:
|
|
|
|
* Pass a PeerConnectionFactoryDependencies object to the function that creates
|
|
a PeerConnectionFactory. This object defines factories for a lot of internal
|
|
objects inside the PeerConnection, so that users can override them.
|
|
All PeerConnections using this interface will have the same options.
|
|
* Pass a PeerConnectionInterface::RTCConfiguration object to the
|
|
CreatePeerConnectionOrError() function on the
|
|
PeerConnectionFactoryInterface. These customizations will apply only to a
|
|
single PeerConnection.
|
|
|
|
Most functions on the PeerConnection interface are asynchronous, and take a
|
|
callback that is executed when the function is finished. The callbacks are
|
|
mostly called on the thread that is passed as the "signaling thread" field of
|
|
the PeerConnectionFactoryDependencies, or the thread that called
|
|
PeerConnectionFactory::CreatePeerConnectionOrError() if no thread is given.
|
|
|
|
See each class' module documentation for details.
|
|
|
|
## Using WebRTC components without the PeerConnection class
|
|
|
|
This needs to be done carefully, and in consultation with the WebRTC team. There
|
|
are non-obvious dependencies between many of the components.
|
|
|
|
|
|
|