webrtc/api
Palak Agarwal a09f21b207 Introduce capture_time_identifier in webrtc::EncodedImage
This CL propagates capture_time_identifier introduced in
webrtc::VideoFrame and propagates it to EncodedImage. For use cases
involving EncodedTransforms, this identifier is further propagated to
TransformableVideoSenderFrame.

VideoEncoder::Encode function is overriden by each encoder. Each of
these overriden functions needs to be changed so that they can handle
this new identifier and propagate its value in the created EncodedImage.

Change-Id: I5bea4c5a3fe714f1198e497a4bcb5fd059afe516
Bug: webrtc:14878
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291800
Reviewed-by: Tony Herre <herre@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Palak Agarwal <agpalak@google.com>
Cr-Commit-Position: refs/heads/main@{#39374}
2023-02-22 17:08:53 +00:00
..
adaptation Remove rtc_base:rtc_base_approved 2022-05-05 09:43:31 +00:00
audio delay estrimator: Enable looking for early reverberation 2022-10-24 08:35:52 +00:00
audio_codecs Don't use low complexity Opus on all ARM devices. 2022-12-20 10:30:30 +00:00
call Make header files self contained. 2022-10-08 08:38:36 +00:00
crypto Remove all usage of //rtc_base target 2023-01-16 14:36:06 +00:00
g3doc Reland "Migrate WebRTC documentation to new renderer" 2023-01-31 09:30:04 +00:00
metronome Metronome: complete API migration. 2022-11-10 13:42:30 +00:00
neteq Reland "Change default NetEq sample rate to 48k." 2022-11-07 18:14:33 +00:00
numerics Migrate CallSimulator to the new perf metrics logging API 2022-09-26 19:37:51 +00:00
rtc_event_log Add RtcEvent to store when MinimumSetDelay is set on NetEq 2023-01-13 17:15:48 +00:00
stats stats: Deprecate RTCStatsReport(int64 timestamp_us) 2023-02-22 12:32:02 +00:00
task_queue Ensure task queues delete closures in task queue context. 2022-12-19 10:41:03 +00:00
test Make FrameGeneratorInterface::GetResolution pure virtual. 2023-02-17 17:03:24 +00:00
transport Remove all usage of //rtc_base target 2023-01-16 14:36:06 +00:00
units Add IWYU pragmas for some api headers 2022-10-31 15:43:16 +00:00
video Introduce capture_time_identifier in webrtc::EncodedImage 2023-02-22 17:08:53 +00:00
video_codecs Enable multithreaded OpenH264 encoding behind field trial 2023-02-22 14:26:33 +00:00
voip Remove usage of INFO alias for LS_INFO in log messages 2021-11-04 13:46:17 +00:00
array_view.h Fix array_view nested namespace. 2021-08-16 14:38:57 +00:00
array_view_unittest.cc rtc::ArrayView reverse iterators 2020-10-21 08:57:13 +00:00
async_dns_resolver.h Support DNS resolution matching a specified IP family. 2022-08-11 13:52:53 +00:00
async_resolver_factory.h (4) Rename files to snake_case: update BUILD.gn, include paths, header guards, and DEPS entries 2019-01-11 17:11:39 +00:00
audio_options.cc Remove legacy (unused) config param: jitter_buffer_enable_rtx_handling 2022-05-21 23:06:21 +00:00
audio_options.h Remove legacy (unused) config param: jitter_buffer_enable_rtx_handling 2022-05-21 23:06:21 +00:00
BUILD.gn Remove deprecated VideoStreamDecoderInterface and FrameBuffer2. 2023-02-13 16:25:00 +00:00
candidate.cc Remove fields from remote candidates that could cause crashes in GetStats 2022-10-19 08:06:23 +00:00
candidate.h Limit number of TURN servers to 32 2022-11-29 17:04:11 +00:00
create_peerconnection_factory.cc Reland "Add TaskQueueStdlib experiment." 2022-08-29 10:48:42 +00:00
create_peerconnection_factory.h WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 16/inf 2022-04-20 06:35:27 +00:00
crypto_params.h Delete variant of rtc::split that copies the output fields 2022-06-09 08:29:33 +00:00
data_channel_interface.cc datachannel: Add a MaxSendQueueSize() accessor in the API 2021-10-18 11:24:06 +00:00
data_channel_interface.h datachannel: Don't close a data channel when the queue is full 2021-11-04 11:40:28 +00:00
DEPS Rename api/stats_types.h to api/legacy_stats_types.h. 2022-11-11 10:29:25 +00:00
dtls_transport_interface.cc Make DTLS role visible on DtlsTransport interface 2022-02-10 11:04:36 +00:00
dtls_transport_interface.h Make DTLS role visible on DtlsTransport interface 2022-02-10 11:04:36 +00:00
dtmf_sender_interface.h Use backticks not vertical bars to denote variables in comments for /api 2021-07-26 18:27:34 +00:00
fec_controller.h Use backticks not vertical bars to denote variables in comments for /api 2021-07-26 18:27:34 +00:00
fec_controller_override.h Define FecControllerOverride and plumb it down to VideoEncoder 2019-06-28 15:57:22 +00:00
field_trials.cc Add FieldTrialsRegistry that verifies looked up field trials 2022-10-24 09:12:30 +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 Add FieldTrialsRegistry that verifies looked up field trials 2022-10-24 09:12:30 +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 Use ScopedFieldTrials in FieldTrialsTest 2022-12-02 15:57:57 +00:00
field_trials_view.h Add FieldTrialsRegistry that verifies looked up field trials 2022-10-24 09:12:30 +00:00
frame_transformer_factory.cc Add a clone method to the video frame transformer API. 2022-11-25 11:18:22 +00:00
frame_transformer_factory.h Add a clone method to the video frame transformer API. 2022-11-25 11:18:22 +00:00
frame_transformer_interface.h Introduce capture_time_identifier in webrtc::EncodedImage 2023-02-22 17:08:53 +00:00
function_view.h Move rtc::FunctionView to the public API 2019-03-21 15:23:05 +00:00
function_view_unittest.cc Format almost everything. 2019-07-08 13:45:15 +00:00
ice_transport_factory.cc Add rtc::make_ref_counted to api/ 2022-06-13 15:53:27 +00:00
ice_transport_factory.h Use backticks not vertical bars to denote variables in comments 2021-08-10 10:40:03 +00:00
ice_transport_interface.h Reland "Add an active ICE controller that wraps a legacy controller (#7/n)" 2022-09-21 11:02:26 +00:00
jsep.cc Reland "Remove old-style OnFailure callbacks" 2020-02-21 14:07:57 +00:00
jsep.h Use backticks not vertical bars to denote variables in comments 2021-08-10 10:40:03 +00:00
jsep_ice_candidate.cc Use unique_ptr in JsepCandidateCollection 2019-07-31 01:48:07 +00:00
jsep_ice_candidate.h Remove RTC_DISALLOW_COPY_AND_ASSIGN more. 2022-01-20 11:00:18 +00:00
jsep_session_description.h Remove RTC_DISALLOW_COPY_AND_ASSIGN more. 2022-01-20 11:00:18 +00:00
legacy_stats_types.cc Rename api/stats_types.h to api/legacy_stats_types.h. 2022-11-11 10:29:25 +00:00
legacy_stats_types.h Rename api/stats_types.h to api/legacy_stats_types.h. 2022-11-11 10:29:25 +00:00
make_ref_counted.h Move rtc::make_ref_counted to api/ 2022-06-15 09:47:38 +00:00
media_stream_interface.cc New target for api/rtp_parameters.h and api/media_types.h. 2019-08-29 09:04:32 +00:00
media_stream_interface.h Change stream.AddTrack/RemoveTrack to take a scoped_refptr argument 2022-04-21 12:32:17 +00:00
media_stream_track.h Use string_view to pass track ids to constructors 2022-05-30 10:28:57 +00:00
media_types.cc Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED 2021-11-15 21:44:59 +00:00
media_types.h Revert "Define cricket::MediaType in terms of webrtc::MediaType" 2021-05-12 17:06:58 +00:00
network_state_predictor.h Add base class NetworkPredictor and NetworkPredictorFactory and wire up. 2019-04-10 12:38:58 +00:00
notifier.h Add SequenceChecker on Notifier 2022-03-02 22:35:46 +00:00
OWNERS Rearrange api/OWNERS to show who's backup OWNERS 2022-10-07 05:56:08 +00:00
packet_socket_factory.h Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED 2021-11-15 21:44:59 +00:00
peer_connection_interface.cc Make PeerConnectionInterface::SetConfiguration pure virtual 2022-07-05 09:21:03 +00:00
peer_connection_interface.h Delete deprecated disable_ipv6 flag. 2022-12-01 11:01:02 +00:00
priority.h Pass datachannel priority in DC open messages 2020-05-17 10:57:27 +00:00
README.md Reland "Migrate WebRTC documentation to new renderer" 2023-01-31 09:30:04 +00:00
ref_counted_base.h Remove RTC_DISALLOW_COPY_AND_ASSIGN more. 2022-01-20 11:00:18 +00:00
rtc_error.cc Return an error when datachannel closes due to network error 2019-12-08 17:33:54 +00:00
rtc_error.h Fix use-after-move in RTCErrorOr 2021-12-14 21:16:18 +00:00
rtc_error_unittest.cc Format almost everything. 2019-07-08 13:45:15 +00:00
rtc_event_log_output.h Remove unnecessary overload in RtcEventLogOutput 2022-07-12 22:09:36 +00:00
rtc_event_log_output_file.cc Remove unnecessary std::string overloads 2022-07-07 14:24:14 +00:00
rtc_event_log_output_file.h Remove unnecessary std::string overloads 2022-07-07 14:24:14 +00:00
rtc_event_log_output_file_unittest.cc Remove unnecessary overload in RtcEventLogOutput 2022-07-12 22:09:36 +00:00
rtp_headers.cc Remove framemarking RTP extension. 2020-06-15 11:18:00 +00:00
rtp_headers.h mark RTPHeader struct RTC_EXPORT 2023-01-20 15:46:01 +00:00
rtp_packet_info.cc RtpPacketInfo: deprecated ctors and getter removed 2022-09-21 12:00:56 +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 Surface local_capture_clock_offset from RtpSource 2022-09-20 12:51:22 +00:00
rtp_packet_infos.h Add rtc::make_ref_counted to api/ 2022-06-13 15:53:27 +00:00
rtp_packet_infos_unittest.cc RtpPacketInfo: new ctor + deprecated ctors clean-up 2022-09-20 08:58:38 +00:00
rtp_parameters.cc Change SetLocalContent in channel classes to avoid Invoke. 2022-01-06 12:52:35 +00:00
rtp_parameters.h Reland "RtpEncodingParameters::request_resolution patch 1" 2022-09-23 11:48:19 +00:00
rtp_parameters_unittest.cc Change SetLocalContent in channel classes to avoid Invoke. 2022-01-06 12:52:35 +00:00
rtp_receiver_interface.cc Insert frame transformer between Depacketizer and Decoder. 2020-03-02 08:33:44 +00:00
rtp_receiver_interface.h Use backticks not vertical bars to denote variables in comments for /api 2021-07-26 18:27:34 +00:00
rtp_sender_interface.cc pc: Add asynchronous RtpSender::SetParameters() call 2022-11-15 15:31:40 +00:00
rtp_sender_interface.h pc: Add asynchronous RtpSender::SetParameters() call 2022-11-15 15:31:40 +00:00
rtp_transceiver_direction.h RtpTransceiverInterface: add header_extensions_to_offer() 2020-03-16 13:16:42 +00:00
rtp_transceiver_interface.cc Reland "Remove some default implementations in api/rtp_transcever_interface" 2022-01-19 11:32:24 +00:00
rtp_transceiver_interface.h Reland "Remove some default implementations in api/rtp_transcever_interface" 2022-01-19 11:32:24 +00:00
scoped_refptr.h Delete implicit conversion from rtc::scoped_refptr<T> to T* 2022-05-09 09:06:44 +00:00
scoped_refptr_unittest.cc Update api/ to not use implicit T* --> scoped_refptr<T> conversion 2022-01-12 11:26:05 +00:00
sctp_transport_interface.cc Format almost everything. 2019-07-08 13:45:15 +00:00
sctp_transport_interface.h Reland "Fix unsynchronized access to mid_to_transport_ in JsepTransportController" 2021-02-10 13:40:22 +00:00
sequence_checker.h Inline assert in RTC_DCHECK_RUN_ON macro 2022-08-03 13:28:28 +00:00
sequence_checker_unittest.cc Make ExpectationToString generate detailed logs in more cases. 2022-09-26 16:24:04 +00:00
set_local_description_observer_interface.h Use backticks not vertical bars to denote variables in comments 2021-08-10 10:40:03 +00:00
set_remote_description_observer_interface.h Use backticks not vertical bars to denote variables in comments 2021-08-10 10:40:03 +00:00
turn_customizer.h Make header files self contained. 2022-10-08 08:38:36 +00:00
uma_metrics.h Measure RTCPMuxPolicy at time of connect 2023-01-26 14:06:01 +00:00
video_track_source_constraints.h Route min/max FPS constraints to VideoStreamEncoder. 2021-10-14 06:49:05 +00:00
video_track_source_proxy_factory.h Make header files self contained. 2022-10-08 08:38:36 +00:00
webrtc_key_value_config.h WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 12/inf 2022-03-29 10:14:00 +00:00
wrapping_async_dns_resolver.cc Add CreateAsyncDnsResolver to PacketSocketFactory API 2021-10-01 16:12:50 +00:00
wrapping_async_dns_resolver.h Support DNS resolution matching a specified IP family. 2022-08-11 13:52:53 +00: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/.

That is, 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.