blob: 66445203cb341cfab0a2d399dcb8a2b4d62b7f39 [file] [log] [blame] [view]
Artem Titova6178672023-01-30 10:51:011<!-- go/cmark -->
2<!--* freshness: {owner: 'hta' reviewed: '2021-01-01'} *-->
3
Karl Wibergd4f01c12017-11-10 09:55:454# API header files
5
6As a user of the WebRTC library, you may use headers and build files
7in the following directories:
8
9API directory | Including subdirectories?
10--------------|-------------------------
11`api` | Yes
12
13For now, you may also use headers and build files in the following
14legacy API directories&mdash;but see the
15[disclaimer](#legacy-disclaimer) below.
16
17Legacy API directory | Including subdirectories?
18-------------------------------------------|--------------------------
19`common_audio/include` | No
Mirko Bonadeia4eeeff2018-01-11 12:16:5220`media/base` | No
21`media/engine` | No
Karl Wibergd4f01c12017-11-10 09:55:4522`modules/audio_coding/include` | No
23`modules/audio_device/include` | No
24`modules/audio_processing/include` | No
Karl Wibergd4f01c12017-11-10 09:55:4525`modules/congestion_controller/include` | No
26`modules/include` | No
Karl Wibergd4f01c12017-11-10 09:55:4527`modules/rtp_rtcp/include` | No
28`modules/rtp_rtcp/source` | No
29`modules/utility/include` | No
30`modules/video_coding/codecs/h264/include` | No
Karl Wibergd4f01c12017-11-10 09:55:4531`modules/video_coding/codecs/vp8/include` | No
32`modules/video_coding/codecs/vp9/include` | No
33`modules/video_coding/include` | No
34`pc` | No
35`rtc_base` | No
36`system_wrappers/include` | No
Karl Wibergd4f01c12017-11-10 09:55:4537
38While the files, types, functions, macros, build targets, etc. in the
39API and legacy API directories will sometimes undergo incompatible
40changes, such changes will be announced in advance to
41[discuss-webrtc@googlegroups.com][discuss-webrtc], and a migration
42path will be provided.
43
44[discuss-webrtc]: https://groups.google.com/forum/#!forum/discuss-webrtc
45
46In the directories not listed in the tables above, incompatible
47changes may happen at any time, and are not announced.
48
49## <a name="legacy-disclaimer"></a>The legacy API directories contain some things you shouldn&rsquo;t use
50
51The legacy API directories, in addition to things that genuinely
52should be part of the API, also contain things that should *not* be
53part of the API. We are in the process of moving the good stuff to the
54`api` directory tree, and will remove directories from the legacy list
55once they no longer contain anything that should be in the API.
56
57In other words, if you find things in the legacy API directories that
58don&rsquo;t seem like they belong in the WebRTC native API,
59don&rsquo;t grow too attached to them.
60
61## All these worlds are yours&mdash;except Europa
62
63In the API headers, or in files included by the API headers, there are
64types, functions, namespaces, etc. that have `impl` or `internal` in
65their names (in various styles, such as `CamelCaseImpl`,
66`snake_case_impl`). They are not part of the API, and may change
67incompatibly at any time; do not use them.
Mirko Bonadei4555c652018-08-16 13:09:5968
69# Preprocessor macros
70
71The following preprocessor macros are read (but never set) by WebRTC; they allow
72you to enable or disable parts of WebRTC at compile time.
73
74Be sure to set them the same way in all translation units that include WebRTC
75code.
76
77## `WEBRTC_EXCLUDE_BUILT_IN_SSL_ROOT_CERTS`
78If you want to ship your own set of SSL certificates and inject them into WebRTC
79PeerConnections, you will probably want to avoid to compile and ship WebRTC's
80default set of SSL certificates.
81
82You can achieve this by defining the preprocessor macro
83`WEBRTC_EXCLUDE_BUILT_IN_SSL_ROOT_CERTS`. If you use GN, you can just set the GN
84argument `rtc_builtin_ssl_root_certificates` to false and GN will define the
85macro for you.
Mirko Bonadeiba64afb2018-09-18 11:26:0286
87## `WEBRTC_EXCLUDE_FIELD_TRIAL_DEFAULT`
88If you want to provide your own implementation of `webrtc::field_trial` functions
89(more info [here][field_trial_h]) you will have to exclude WebRTC's default
90implementation.
91
92You can achieve this by defining the preprocessor macro
93`WEBRTC_EXCLUDE_FIELD_TRIAL_DEFAULT`. If you use GN, you can just set the GN
94argument `rtc_exclude_field_trial_default` to true and GN will define the
95macro for you.
96
Fanny Linderborg0d2dc1f2021-07-14 14:02:1197[field_trial_h]: https://webrtc.googlesource.com/src/+/main/system_wrappers/include/field_trial.h
Mirko Bonadeiba64afb2018-09-18 11:26:0298
99## `WEBRTC_EXCLUDE_METRICS_DEFAULT`
100If you want to provide your own implementation of `webrtc::metrics` functions
101(more info [here][metrics_h]) you will have to exclude WebRTC's default
102implementation.
103
104You can achieve this by defining the preprocessor macro
105`WEBRTC_EXCLUDE_METRICS_DEFAULT`. If you use GN, you can just set the GN
106argument `rtc_exclude_metrics_default` to true and GN will define the
107macro for you.
108
Fanny Linderborg0d2dc1f2021-07-14 14:02:11109[metrics_h]: https://webrtc.googlesource.com/src/+/main/system_wrappers/include/metrics.h
sazaaa42ecd2020-04-01 13:24:40110