webrtc/api
Danil Chapovalov 12b861ef29 Delete FieldTrialsView parameter for AudioEncoderFactoryTemplate as unused
The template never pass that parameter to create an audio encoder, and thus is de-facto always unused.
Plan is to propagate field trials differently, during construction of the encoder rather than during construction of the encoder factory.

Bug: webrtc:343086059
Change-Id: I96d49ef7f7ff37524a1eb64f7a2d73881c07e00a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/354360
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42527}
2024-06-25 07:54:32 +00:00
..
adaptation Deprecate rtc::RefCountInterface 2024-06-07 09:47:26 +00:00
audio [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
audio_codecs Delete FieldTrialsView parameter for AudioEncoderFactoryTemplate as unused 2024-06-25 07:54:32 +00:00
call [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
crypto [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
environment [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
g3doc Reland "Migrate WebRTC documentation to new renderer" 2023-01-31 09:30:04 +00:00
metronome [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
neteq [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
numerics [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
rtc_event_log Include-what-you-use api/rtc_event_log/ 2024-06-16 13:53:56 +00:00
stats Deprecate rtc::RefCountInterface 2024-06-07 09:47:26 +00:00
task_queue Mass removal of absl_deps in all BUILD.gn files 2024-05-23 15:09:46 +00:00
test Pass random seed to SchedulableNetworkBehavior. 2024-06-19 08:40:36 +00:00
transport Add RTC_EXPORT to API structs needed for RTCRtpTransport JS API 2024-06-07 12:40:52 +00:00
units Format ^(api|call|common_audio|examples|media|net|p2p|pc)/ 2023-05-03 11:09:26 +00:00
video Remove kMaxNalusPerPacket hard limit for H264 frames 2024-06-14 16:29:42 +00:00
video_codecs Mark SimulcastStream RTC_EXPORT 2024-06-05 08:31:14 +00:00
voip [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
array_view.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
array_view_unittest.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
async_dns_resolver.h Convert AsyncDnsResolver to use absl::AnyInvocable 2023-08-31 08:50:40 +00:00
audio_options.cc Remove unused combined_audio_video_bwe. 2023-05-26 15:56:00 +00:00
audio_options.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
BUILD.gn [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
candidate.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
candidate.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
candidate_unittest.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
create_peerconnection_factory.cc Remove default field trials and task queue factory in CreatePeerConnectionFactory function 2024-05-16 11:25:44 +00:00
create_peerconnection_factory.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
data_channel_interface.cc [DataChannelInterface] Introduce DataChannelInterface::SendAsync() 2023-04-11 19:46:36 +00:00
data_channel_interface.h Move some users to use webrtc::RefCountInterface 2023-11-02 14:45:57 +00:00
DEPS [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
dtls_transport_interface.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
dtls_transport_interface.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
dtmf_sender_interface.h Move all api/ files to use webrtc::RefCountInterface 2023-10-31 15:45:12 +00:00
enable_media.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
enable_media.h Mark EnableMedia with RTC_EXPORT 2023-10-31 22:15:21 +00:00
enable_media_with_defaults.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
enable_media_with_defaults.h Add EnableMediaWithDefaults to replace SetMediaEngineDefaults 2023-11-01 11:47:59 +00:00
fec_controller.h Delete deprecated FecControllerFactoryInterface::CreateFecController variant 2024-01-09 16:44:46 +00:00
fec_controller_override.h
field_trials.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
field_trials.h Add FieldTrialsRegistry that verifies looked up field trials 2022-10-24 09:12:30 +00: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 Add FieldTrialsRegistry that verifies looked up field trials 2022-10-24 09:12:30 +00:00
field_trials_unittest.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
field_trials_view.h Cleanup FieldTrialView 2023-03-27 17:06:33 +00:00
frame_transformer_factory.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +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 Reland "Run IWYU on some files I intend to work on" 2024-06-05 08:59:49 +00:00
function_view.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
function_view_unittest.cc
ice_transport_factory.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
ice_transport_factory.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
ice_transport_interface.h Delete deprecated AsyncResolver and related classes 2023-11-30 15:36:55 +00:00
jsep.cc
jsep.h Move all api/ files to use webrtc::RefCountInterface 2023-10-31 15:45:12 +00:00
jsep_ice_candidate.cc
jsep_ice_candidate.h
jsep_session_description.h Remove JsepSessionDescription::kDefaultVideoCodecName 2023-03-02 12:28:29 +00:00
legacy_stats_types.cc Add missing method definition for StatsReport::Value::id_val() 2023-06-15 13:53:37 +00:00
legacy_stats_types.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
location.h Implement support for Chrome task origin tracing. #2/4 2023-02-27 13:17:38 +00:00
make_ref_counted.h Deprecate rtc::RefCountInterface 2024-06-07 09:47:26 +00:00
media_stream_interface.cc Format ^(api|call|common_audio|examples|media|net|p2p|pc)/ 2023-05-03 11:09:26 +00:00
media_stream_interface.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
media_stream_track.h
media_types.cc
media_types.h
network_state_predictor.h Split BandwidthUsage from network_state_predictor.h 2024-05-24 13:44:37 +00:00
notifier.h Use SequenceChecker(SequenceChecker::kDetached) in a few places. 2023-03-24 07:44:18 +00:00
OWNERS Rearrange api/OWNERS to show who's backup OWNERS 2022-10-07 05:56:08 +00:00
packet_socket_factory.h Remove deprecated ProxyInfo code 2024-04-22 08:38:36 +00:00
peer_connection_interface.cc Delete deprecated call_factory and media_engine 2023-12-04 14:42:44 +00:00
peer_connection_interface.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
priority.h
README.md Discourage structs in api 2023-09-07 10:41:49 +00:00
ref_count.h Move RefCountInterface to api/ and webrtc: namespace 2023-10-31 14:02:50 +00:00
ref_counted_base.h Deprecate rtc::RefCountInterface 2024-06-07 09:47:26 +00:00
rtc_error.cc Use absl::string_view type as parameter for RTCError message 2023-03-20 18:16:10 +00:00
rtc_error.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
rtc_error_unittest.cc Use absl::string_view type as parameter for RTCError message 2023-03-20 18:16:10 +00:00
rtc_event_log_output.h Include-what-you-use api/rtc_event_log_output* 2024-06-16 15:13:29 +00: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_file_unittest.cc Include-what-you-use api/rtc_event_log_output* 2024-06-16 15:13:29 +00:00
rtp_headers.cc Remove deprecated accessors for audio_level in RTPHeaderExtension 2024-04-17 15:41:59 +00:00
rtp_headers.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
rtp_packet_info.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
rtp_packet_info.h RtpPacketInfo: deprecated ctors and getter removed 2022-09-21 12:00:56 +00:00
rtp_packet_info_unittest.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
rtp_packet_infos.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
rtp_packet_infos_unittest.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
rtp_parameters.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
rtp_parameters.h Fix list of resiliency mechanisms in setCodecPreferences 2024-01-09 13:09:59 +00:00
rtp_parameters_unittest.cc
rtp_receiver_interface.cc Reland "Run IWYU on some files I intend to work on" 2024-06-05 08:59:49 +00:00
rtp_receiver_interface.h Introduce the TransformerHost interface 2024-04-25 07:54:28 +00:00
rtp_sender_interface.cc pc: Add asynchronous RtpSender::SetParameters() call 2022-11-15 15:31:40 +00:00
rtp_sender_interface.h Introduce the TransformerHost interface 2024-04-25 07:54:28 +00:00
rtp_transceiver_direction.h
rtp_transceiver_interface.cc
rtp_transceiver_interface.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
scoped_refptr.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
scoped_refptr_unittest.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
sctp_transport_interface.cc
sctp_transport_interface.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
sequence_checker.h [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
sequence_checker_unittest.cc [iwyu][1\n] Applying to api/[a-s]* 2024-06-19 06:19:20 +00:00
set_local_description_observer_interface.h Move all api/ files to use webrtc::RefCountInterface 2023-10-31 15:45:12 +00:00
set_remote_description_observer_interface.h Move all api/ files to use webrtc::RefCountInterface 2023-10-31 15:45:12 +00:00
turn_customizer.h Make header files self contained. 2022-10-08 08:38:36 +00:00
uma_metrics.h Removing enum used for removed UMA metrics WebRTC.PeerConnection.Simulcast.ApplyLocalDescription and WebRTC.PeerConnection.Simulcast.ApplyRemoteDescription 2023-07-13 09:00:52 +00:00
video_track_source_constraints.h
video_track_source_proxy_factory.h Make header files self contained. 2022-10-08 08:38:36 +00:00
webrtc_key_value_config.h
wrapping_async_dns_resolver.cc

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.