webrtc/api
Miriam Zimmerman 31a3397e96 Merge remote-tracking branch 'upstream/branch-heads/7778' into mutexlox/webrtc-148
Merge conflicts resolved in:
* api/neteq/neteq.h
* audio/channel_receive.cc
* audio/channel_receive.h
* media/engine/simulcast_encoder_adapter.cc
* modules/audio_coding/BUILD.gn
* modules/audio_coding/acm2/acm_resampler.cc
* modules/audio_coding/acm2/acm_resampler_unittest.cc
* modules/audio_processing/audio_processing_impl.h
* modules/video_coding/BUILD.gn
* p2p/base/p2p_transport_channel_unittest.cc
* pc/jsep_transport_controller.cc
* pc/rtp_transport.h
* pc/rtp_transport_internal.h
* unsafe_buffers_paths.txt
2026-05-08 13:42:18 -04:00
..
adaptation turn rtc_source_set with cc files into rtc_library 2025-05-07 11:28:30 -07:00
audio Merge remote-tracking branch 'upstream/branch-heads/7778' into mutexlox/webrtc-148 2026-05-08 13:42:18 -04:00
audio_codecs Merge remote-tracking branch 'upstream/branch-heads/7778' into mutexlox/webrtc-148 2026-05-08 13:42:18 -04:00
call Replace ArrayView with std::span in api/ 2026-04-02 00:13:26 -07:00
crypto Merge remote-tracking branch 'upstream/branch-heads/7778' into mutexlox/webrtc-148 2026-05-08 13:42:18 -04:00
environment TaskQueueFactory: implement go/cstyle#Enumerator_Names 2026-01-26 02:38:24 -08:00
g3doc Warn against calling WebRTC functions from callbacks 2025-07-03 07:56:46 -07:00
metronome Comment unused variables in implemented functions 7\n 2024-10-28 12:04:15 +00:00
neteq Merge remote-tracking branch 'upstream/branch-heads/7778' into mutexlox/webrtc-148 2026-05-08 13:42:18 -04:00
numerics Replace ArrayView with std::span in api/ 2026-04-02 00:13:26 -07:00
rtc_event_log Remove usage of global clock in RtcEvent constructor 2025-11-03 10:38:50 -08:00
sframe Sframe API support for sender and receiver 2026-03-22 01:34:08 -07:00
stats Make Evan co-owner of WebRTC stats directories. 2026-03-19 05:52:19 -07:00
task_queue Add encoder switch request callback to VideoMediaSendChannel 2026-03-13 03:44:12 -07:00
test Merge remote-tracking branch 'upstream/branch-heads/7778' into mutexlox/webrtc-148 2026-05-08 13:42:18 -04:00
transport Replace ArrayView with std::span in api/ 2026-04-02 00:13:26 -07:00
units Replace ArrayView with std::span in api/ 2026-04-02 00:13:26 -07:00
video Replace ArrayView with std::span in api/ 2026-04-02 00:13:26 -07:00
video_codecs Merge remote-tracking branch 'upstream/branch-heads/7778' into mutexlox/webrtc-148 2026-05-08 13:42:18 -04:00
voip Replace ArrayView with std::span in api/ 2026-04-02 00:13:26 -07:00
array_view_unittest.cc Delete deprecated reinterpret_array_view 2026-04-01 00:31:09 -07:00
array_view.h Delete deprecated reinterpret_array_view 2026-04-01 00:31:09 -07:00
async_dns_resolver.h Replace erase-remove idiom with std::erase and std::erase_if. 2025-08-14 23:02:02 -07:00
audio_options.cc Replace ArrayView with std::span in api/ 2026-04-02 00:13:26 -07:00
audio_options.h Remove re-exported symbols from rtc and cricket namespaces 2025-07-01 03:58:20 -07:00
BUILD.gn Merge remote-tracking branch 'upstream/branch-heads/7778' into mutexlox/webrtc-148 2026-05-08 13:42:18 -04:00
candidate_unittest.cc Move IceCandidate::Create to api/ and break cyclical pc/ dependency 2025-10-03 02:53:34 -07:00
candidate.cc Add operator<< support to RTCError 2025-12-14 08:52:39 -08:00
candidate.h Remove deprecated port type constants. 2025-10-03 21:31:50 -07:00
create_modular_peer_connection_factory.cc Reland "Remove CreateModularPeerConnectionFactory from peer_connection_interface.h" 2025-08-29 03:36:44 -07:00
create_modular_peer_connection_factory.h Introduce create_modular_peer_connection_factory build target 2025-07-04 10:55:18 -07:00
create_peerconnection_factory.cc Introduce create_modular_peer_connection_factory build target 2025-07-04 10:55:18 -07:00
create_peerconnection_factory.h Use webrtc name specifier instead of rtc/cricket in api 2025-04-15 22:17:02 -07:00
crypto_params.h m140 merge fixes 2025-09-25 18:15:57 -07:00
data_channel_event_observer_interface.h Replace ArrayView with std::span in api/ 2026-04-02 00:13:26 -07:00
data_channel_interface.cc Remove deprecated non-Optional datachannel parameters 2025-03-12 07:13:24 -07:00
data_channel_interface.h Make SctpDataChannel::Send return false with any error. Update the comments and tests accordingly. 2025-12-11 10:18:12 -08:00
datagram_connection_factory.cc Add WireProtocol switch to DatagramConnection 2025-09-30 06:48:54 -07:00
datagram_connection_factory.h Add WireProtocol switch to DatagramConnection 2025-09-30 06:48:54 -07:00
datagram_connection.h Replace ArrayView with std::span in api/ 2026-04-02 00:13:26 -07:00
DEPS Merge remote-tracking branch 'upstream/branch-heads/7778' into mutexlox/webrtc-148 2026-05-08 13:42:18 -04:00
dtls_transport_interface.cc WebRTC/PQC - Add ssl_group_id to DtlsTransport::Information 2025-05-21 01:38:54 -07:00
dtls_transport_interface.h Reland "Mark deprecated features with [[deprecated]]" 2025-09-12 02:03:36 -07:00
dtmf_sender_interface.h Reland "Mark deprecated features with [[deprecated]]" 2025-09-12 02:03:36 -07:00
enable_media_with_defaults.cc Delete deprecated PeerConnectionFactoryDependendencies::audio_processing 2025-05-13 11:04:59 -07:00
enable_media_with_defaults.h Add EnableMediaWithDefaults to replace SetMediaEngineDefaults 2023-11-01 11:47:59 +00:00
enable_media.cc Delete deprecated PeerConnectionFactoryDependendencies::audio_processing 2025-05-13 11:04:59 -07:00
enable_media.h Mark EnableMedia with RTC_EXPORT 2023-10-31 22:15:21 +00:00
fec_controller_override.h
fec_controller.h Format /api folder 2025-01-07 18:41:45 -08:00
field_trials_registry.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
field_trials_registry.h
field_trials_unittest.cc Use RTC_DCHECK_IS_ON rather than NDBUG for FieldTrials immutability DCHECK 2025-09-21 08:19:16 -07:00
field_trials_view.h Add RTC_DCHECK for immutable field-trials 2025-09-21 00:12:28 -07:00
field_trials.cc Make the debug only get_value_called atomic in FieldTrials 2025-09-22 23:41:24 -07:00
field_trials.h Make the debug only get_value_called atomic in FieldTrials 2025-09-22 23:41:24 -07:00
frame_transformer_factory.cc Pass receive_time through frame transformer 2024-08-02 07:01:33 +00:00
frame_transformer_factory.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
frame_transformer_interface.cc Add passkey to TransformableFrameInterface to prevent external impls 2024-05-16 13:12:51 +00:00
frame_transformer_interface.h Replace ArrayView with std::span in api/ 2026-04-02 00:13:26 -07:00
function_view_unittest.cc Move function_view.h to webrtc namespace 2025-03-12 04:33:54 -07:00
function_view.h Remove re-exported symbols from rtc and cricket namespaces 2025-07-01 03:58:20 -07:00
ice_gatherer_interface.h Fixes for review comments 2025-05-06 14:15:06 -07:00
ice_server_parsing.cc Reland "Expose ParseIceServers in api/" 2025-10-01 03:48:19 -07:00
ice_server_parsing.h Reland "Expose ParseIceServers in api/" 2025-10-01 03:48:19 -07:00
ice_transport_factory.cc Propagate Environment to P2PTransportChannel 2025-08-25 08:17:44 -07:00
ice_transport_factory.h Propagate Environment to P2PTransportChannel 2025-08-25 08:17:44 -07:00
ice_transport_interface.h Propagate Environment to P2PTransportChannel 2025-08-25 08:17:44 -07:00
jsep_ice_candidate.cc Consolidate the IceCandidate implementation 2025-10-06 05:39:30 -07:00
jsep_ice_candidate.h IWYU misc files 2025-07-15 09:04:53 -07:00
jsep_unittest.cc Add AbslStringify for SessionDescriptionInterface 2024-10-07 12:43:15 +00:00
jsep.cc Use absl::string_view for sdp_mid parameters in a few places. 2025-12-13 17:39:58 -08:00
jsep.h Merge remote branch 'upstream/branch-heads/7680' 2026-04-06 00:16:11 -07:00
legacy_stats_types.cc Modernize deprecated headers in api/, pc/ and rtc_base/ 2025-07-21 00:02:35 -07:00
legacy_stats_types.h Run tools_webrtc/apply-clang-tidy on the repo 2026-01-09 10:26:41 -08:00
local_network_access_permission.h Replace erase-remove idiom with std::erase and std::erase_if. 2025-08-14 23:02:02 -07:00
location.h
make_ref_counted.h Remove re-exported symbols from rtc and cricket namespaces 2025-07-01 03:58:20 -07:00
media_stream_interface.cc Use webrtc name specifier instead of rtc/cricket in api 2025-04-15 22:17:02 -07:00
media_stream_interface.h Remove redundant webrtc:: prefixes in api 2025-06-11 10:27:01 -07:00
media_stream_track.h
media_types.cc Reland "Remove cricket::MediaType as a separate enum definition" 2025-03-25 14:04:10 -07:00
media_types.h Remove deprecated names inherited from cricket::MediaType 2025-08-28 01:21:38 -07:00
network_state_predictor.h Apply include-cleaner to api direct files 2024-09-10 08:29:26 +00:00
notifier.h Run tools_webrtc/apply-clang-tidy on the repo 2026-01-09 10:26:41 -08:00
OWNERS Make Evan and Guido peer_connection/webrtc_sdp co-owners. 2026-03-19 06:01:26 -07:00
packet_socket_factory.h turns UDP + DTLS case implementation 2026-01-14 04:32:09 -08:00
payload_type.h Use the PayloadType class rather than uint8_t in Codec class 2026-03-27 07:22:47 -07:00
peer_connection_interface_unittest.cc Add stringifiers to a few more enums in PeerConnectionInterface 2025-10-07 02:15:45 -07:00
peer_connection_interface.cc Merge remote-tracking branch 'upstream/branch-heads/7444' into mutexlox/m142-merge 2025-12-04 14:36:56 -05:00
peer_connection_interface.h Add opus decoder configuration plumbing 2026-04-20 11:06:14 -07:00
priority.cc Move priority implementation to cc file 2025-05-05 07:34:09 -07:00
priority.h Remove redundant webrtc:: prefixes in api 2025-06-11 10:27:01 -07:00
README.md Discourage structs in api 2023-09-07 10:41:49 +00:00
ref_count.h Remove redundant webrtc:: prefixes in api 2025-06-11 10:27:01 -07:00
ref_counted_base.h Remove re-exported symbols from rtc and cricket namespaces 2025-07-01 03:58:20 -07:00
rtc_error_unittest.cc Replace LOG_AND_RETURN_ERROR with "return LOG_ERROR" 2026-03-24 03:52:49 -07:00
rtc_error.cc Reduce the number of webrtc:: prefixes in code 2026-03-06 06:29:19 -08:00
rtc_error.h Replace LOG_AND_RETURN_ERROR with "return LOG_ERROR" 2026-03-24 03:52:49 -07:00
rtc_event_log_output_file_unittest.cc Modernize deprecated headers in api/, pc/ and rtc_base/ 2025-07-21 00:02:35 -07:00
rtc_event_log_output_file.cc Include-what-you-use api/rtc_event_log_output* 2024-06-16 15:13:29 +00:00
rtc_event_log_output_file.h Include-what-you-use api/rtc_event_log_output* 2024-06-16 15:13:29 +00:00
rtc_event_log_output.h Format /api folder 2025-01-07 18:41:45 -08:00
rtp_headers.cc Apply include-cleaner to api direct files 2024-09-10 08:29:26 +00:00
rtp_headers.h Migrate absl::optional to std::optional 2024-09-02 12:16:47 +00:00
rtp_packet_info_unittest.cc Encapsulate and make RTP sequence number available in RtpPacketInfo. 2026-03-12 03:07:15 -07:00
rtp_packet_info.cc Encapsulate and make RTP sequence number available in RtpPacketInfo. 2026-03-12 03:07:15 -07:00
rtp_packet_info.h Encapsulate and make RTP sequence number available in RtpPacketInfo. 2026-03-12 03:07:15 -07:00
rtp_packet_infos_unittest.cc Modernize deprecated headers in api/, pc/ and rtc_base/ 2025-07-21 00:02:35 -07:00
rtp_packet_infos.h Merge remote-tracking branch 'upstream/branch-heads/7204' 2025-07-11 15:20:30 -07:00
rtp_packet_sender.h Comment unused variables in implemented functions 7\n 2024-10-28 12:04:15 +00:00
rtp_parameters_unittest.cc Ensure that SVC is not enabled when mixed codec is used. 2025-10-21 03:55:28 -07:00
rtp_parameters.cc Harden SimpleStringBuilder safety checks 2026-03-25 01:02:30 -07:00
rtp_parameters.h Merge remote-tracking branch 'upstream/branch-heads/7778' into mutexlox/webrtc-148 2026-05-08 13:42:18 -04:00
rtp_receiver_interface.cc Use webrtc name specifier instead of rtc/cricket in api 2025-04-15 22:17:02 -07:00
rtp_receiver_interface.h Sframe API support for sender and receiver 2026-03-22 01:34:08 -07:00
rtp_sender_interface.cc Comment unused variables in implemented functions 4\n 2024-10-22 11:59:50 +00:00
rtp_sender_interface.h Sframe API support for sender and receiver 2026-03-22 01:34:08 -07:00
rtp_transceiver_direction.h Add stringifiers for RtpHeaderExtension 2025-06-05 06:24:42 -07:00
rtp_transceiver_interface.cc add receptive() flag to RTPTransceiver 2025-10-31 12:23:32 -07:00
rtp_transceiver_interface.h Replace ArrayView with std::span in api/ 2026-04-02 00:13:26 -07:00
rtp_transport_factory.h More std::string usage updates in pc/ using absl::string_view 2025-12-14 11:07:25 -08:00
scoped_refptr_unittest.cc Last namespace cleanups 2025-04-10 07:49:19 -07:00
scoped_refptr.h Remove re-exported symbols from rtc and cricket namespaces 2025-07-01 03:58:20 -07:00
sctp_transport_interface.cc Use webrtc name specifier instead of rtc/cricket in api 2025-04-15 22:17:02 -07:00
sctp_transport_interface.h Plumb a control for max SCTP streams from PeerConnection options. 2025-12-17 02:33:59 -08:00
sequence_checker_unittest.cc Initialize SequenceChecker as detached. 2025-09-29 23:04:31 -07:00
sequence_checker.h Initialize SequenceChecker as detached. 2025-09-29 23:04:31 -07:00
set_local_description_observer_interface.h Remove redundant webrtc:: prefixes in api 2025-06-11 10:27:01 -07:00
set_remote_description_observer_interface.h Remove redundant webrtc:: prefixes in api 2025-06-11 10:27:01 -07:00
turn_customizer.h Move cricket namespace to webrtc 2025-04-08 23:53:44 -07:00
uma_metrics.h sdp: detect data channel munging 2025-10-24 06:59:57 -07:00
video_track_source_constraints.h Migrate absl::optional to std::optional 2024-09-02 12:16:47 +00:00
video_track_source_proxy_factory.h Use webrtc name specifier instead of rtc/cricket in api 2025-04-15 22:17:02 -07:00
webrtc_sdp_unittest.cc Replace ArrayView with std::span in api/ 2026-04-02 00:13:26 -07:00
webrtc_sdp.cc Use the PayloadType class rather than uint8_t in Codec class 2026-03-27 07:22:47 -07:00
webrtc_sdp.h Move webrtc_sdp serialization methods and SessionDescriptionInterface 2025-10-12 12:48:02 -07:00

How to write code in the api/ directory

Mostly, just follow the regular style guide, but:

  • Note that api/ code is not exempt from the “.h and .cc files come in pairs” rule, so if you declare something in api/path/to/foo.h, it should be defined in api/path/to/foo.cc.
  • Headers in api/ should, if possible, not #include headers outside api/. Its not always possible to avoid this, but be aware that it adds to a small mountain of technical debt that were trying to shrink.
  • .cc files in api/, on the other hand, are free to #include headers outside api/.
  • Avoid structs in api, prefer classes.

The preferred way for api/ code to access non-api/ code is to call it from a .cc file, so that users of our API headers wont transitively #include non-public headers.

For headers in api/ that need to refer to non-public types, forward declarations are often a lesser evil than including non-public header files. The usual rules still apply, though.

.cc files in api/ should preferably be kept reasonably small. If a substantial implementation is needed, consider putting it with our non-public code, and just call it from the api/ .cc file.

Avoid defining api with structs as it makes harder for the api to evolve. Your struct may gain invariant, or change how it represents data. Evolving struct from the api is particular challenging as it is designed to be used in other code bases and thus needs to be updated independetly from its usage. Class with accessors and setters makes such migration safer. See Google C++ style guide for more.

If you need to evolve existent struct in api, prefer first to convert it into a class.