Artem Titov | a617867 | 2023-01-30 10:51:01 | [diff] [blame] | 1 | <!-- go/cmark --> |
| 2 | <!--* freshness: {owner: 'hta' reviewed: '2021-01-01'} *--> |
| 3 | |
Karl Wiberg | d4f01c1 | 2017-11-10 09:55:45 | [diff] [blame] | 4 | # API header files |
| 5 | |
| 6 | As a user of the WebRTC library, you may use headers and build files |
| 7 | in the following directories: |
| 8 | |
| 9 | API directory | Including subdirectories? |
| 10 | --------------|------------------------- |
| 11 | `api` | Yes |
| 12 | |
| 13 | For now, you may also use headers and build files in the following |
| 14 | legacy API directories—but see the |
| 15 | [disclaimer](#legacy-disclaimer) below. |
| 16 | |
| 17 | Legacy API directory | Including subdirectories? |
| 18 | -------------------------------------------|-------------------------- |
| 19 | `common_audio/include` | No |
Mirko Bonadei | a4eeeff | 2018-01-11 12:16:52 | [diff] [blame] | 20 | `media/base` | No |
| 21 | `media/engine` | No |
Karl Wiberg | d4f01c1 | 2017-11-10 09:55:45 | [diff] [blame] | 22 | `modules/audio_coding/include` | No |
| 23 | `modules/audio_device/include` | No |
| 24 | `modules/audio_processing/include` | No |
Karl Wiberg | d4f01c1 | 2017-11-10 09:55:45 | [diff] [blame] | 25 | `modules/congestion_controller/include` | No |
| 26 | `modules/include` | No |
Karl Wiberg | d4f01c1 | 2017-11-10 09:55:45 | [diff] [blame] | 27 | `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 Wiberg | d4f01c1 | 2017-11-10 09:55:45 | [diff] [blame] | 31 | `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 Wiberg | d4f01c1 | 2017-11-10 09:55:45 | [diff] [blame] | 37 | |
| 38 | While the files, types, functions, macros, build targets, etc. in the |
| 39 | API and legacy API directories will sometimes undergo incompatible |
| 40 | changes, such changes will be announced in advance to |
| 41 | [discuss-webrtc@googlegroups.com][discuss-webrtc], and a migration |
| 42 | path will be provided. |
| 43 | |
| 44 | [discuss-webrtc]: https://groups.google.com/forum/#!forum/discuss-webrtc |
| 45 | |
| 46 | In the directories not listed in the tables above, incompatible |
| 47 | changes 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’t use |
| 50 | |
| 51 | The legacy API directories, in addition to things that genuinely |
| 52 | should be part of the API, also contain things that should *not* be |
| 53 | part 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 |
| 55 | once they no longer contain anything that should be in the API. |
| 56 | |
| 57 | In other words, if you find things in the legacy API directories that |
| 58 | don’t seem like they belong in the WebRTC native API, |
| 59 | don’t grow too attached to them. |
| 60 | |
| 61 | ## All these worlds are yours—except Europa |
| 62 | |
| 63 | In the API headers, or in files included by the API headers, there are |
| 64 | types, functions, namespaces, etc. that have `impl` or `internal` in |
| 65 | their names (in various styles, such as `CamelCaseImpl`, |
| 66 | `snake_case_impl`). They are not part of the API, and may change |
| 67 | incompatibly at any time; do not use them. |
Mirko Bonadei | 4555c65 | 2018-08-16 13:09:59 | [diff] [blame] | 68 | |
| 69 | # Preprocessor macros |
| 70 | |
| 71 | The following preprocessor macros are read (but never set) by WebRTC; they allow |
| 72 | you to enable or disable parts of WebRTC at compile time. |
| 73 | |
| 74 | Be sure to set them the same way in all translation units that include WebRTC |
| 75 | code. |
| 76 | |
| 77 | ## `WEBRTC_EXCLUDE_BUILT_IN_SSL_ROOT_CERTS` |
| 78 | If you want to ship your own set of SSL certificates and inject them into WebRTC |
| 79 | PeerConnections, you will probably want to avoid to compile and ship WebRTC's |
| 80 | default set of SSL certificates. |
| 81 | |
| 82 | You 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 |
| 84 | argument `rtc_builtin_ssl_root_certificates` to false and GN will define the |
| 85 | macro for you. |
Mirko Bonadei | ba64afb | 2018-09-18 11:26:02 | [diff] [blame] | 86 | |
| 87 | ## `WEBRTC_EXCLUDE_FIELD_TRIAL_DEFAULT` |
| 88 | If 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 |
| 90 | implementation. |
| 91 | |
| 92 | You can achieve this by defining the preprocessor macro |
| 93 | `WEBRTC_EXCLUDE_FIELD_TRIAL_DEFAULT`. If you use GN, you can just set the GN |
| 94 | argument `rtc_exclude_field_trial_default` to true and GN will define the |
| 95 | macro for you. |
| 96 | |
Fanny Linderborg | 0d2dc1f | 2021-07-14 14:02:11 | [diff] [blame] | 97 | [field_trial_h]: https://webrtc.googlesource.com/src/+/main/system_wrappers/include/field_trial.h |
Mirko Bonadei | ba64afb | 2018-09-18 11:26:02 | [diff] [blame] | 98 | |
| 99 | ## `WEBRTC_EXCLUDE_METRICS_DEFAULT` |
| 100 | If 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 |
| 102 | implementation. |
| 103 | |
| 104 | You can achieve this by defining the preprocessor macro |
| 105 | `WEBRTC_EXCLUDE_METRICS_DEFAULT`. If you use GN, you can just set the GN |
| 106 | argument `rtc_exclude_metrics_default` to true and GN will define the |
| 107 | macro for you. |
| 108 | |
Fanny Linderborg | 0d2dc1f | 2021-07-14 14:02:11 | [diff] [blame] | 109 | [metrics_h]: https://webrtc.googlesource.com/src/+/main/system_wrappers/include/metrics.h |
saza | aa42ecd | 2020-04-01 13:24:40 | [diff] [blame] | 110 | |