blob: 01783552628fe696d8d9291a89457e770a6c706d [file] [log] [blame]
Tommid3807da2020-05-22 15:36:361/*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef VIDEO_RTP_VIDEO_STREAM_RECEIVER2_H_
12#define VIDEO_RTP_VIDEO_STREAM_RECEIVER2_H_
13
Tommid3807da2020-05-22 15:36:3614#include <map>
15#include <memory>
16#include <string>
17#include <vector>
18
19#include "absl/types/optional.h"
Tommid3807da2020-05-22 15:36:3620#include "api/crypto/frame_decryptor_interface.h"
Artem Titovd15a5752021-02-10 13:31:2421#include "api/sequence_checker.h"
philipelce423ce2021-04-12 11:42:0322#include "api/units/timestamp.h"
Tommid3807da2020-05-22 15:36:3623#include "api/video/color_space.h"
Danil Chapovalov5653c952021-08-10 14:57:5624#include "api/video/video_codec_type.h"
Tommid3807da2020-05-22 15:36:3625#include "call/rtp_packet_sink_interface.h"
26#include "call/syncable.h"
27#include "call/video_receive_stream.h"
28#include "modules/rtp_rtcp/include/receive_statistics.h"
Per K5e5d0172022-12-22 12:43:4129#include "modules/rtp_rtcp/include/recovered_packet_receiver.h"
Tommid3807da2020-05-22 15:36:3630#include "modules/rtp_rtcp/include/remote_ntp_time_estimator.h"
31#include "modules/rtp_rtcp/include/rtp_header_extension_map.h"
Minyue Li63b30952021-05-19 12:38:2532#include "modules/rtp_rtcp/source/absolute_capture_time_interpolator.h"
33#include "modules/rtp_rtcp/source/capture_clock_offset_updater.h"
Tommid3807da2020-05-22 15:36:3634#include "modules/rtp_rtcp/source/rtp_dependency_descriptor_extension.h"
35#include "modules/rtp_rtcp/source/rtp_packet_received.h"
Tomas Gunnarssonf25761d2020-06-03 20:55:3336#include "modules/rtp_rtcp/source/rtp_rtcp_impl2.h"
37#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
Tommid3807da2020-05-22 15:36:3638#include "modules/rtp_rtcp/source/rtp_video_header.h"
Tony Herrebe9b5762023-02-03 11:29:0439#include "modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.h"
Tommid3807da2020-05-22 15:36:3640#include "modules/rtp_rtcp/source/video_rtp_depacketizer.h"
41#include "modules/video_coding/h264_sps_pps_tracker.h"
42#include "modules/video_coding/loss_notification_controller.h"
Markus Handell06a2bf02021-07-22 13:09:3943#include "modules/video_coding/nack_requester.h"
Tommid3807da2020-05-22 15:36:3644#include "modules/video_coding/packet_buffer.h"
45#include "modules/video_coding/rtp_frame_reference_finder.h"
Tommid3807da2020-05-22 15:36:3646#include "rtc_base/experiments/field_trial_parser.h"
Evan Shrubsole097fc342023-01-09 10:21:4347#include "rtc_base/numerics/sequence_number_unwrapper.h"
Mirko Bonadei20e4c802020-11-23 10:07:4248#include "rtc_base/system/no_unique_address.h"
Tommid3807da2020-05-22 15:36:3649#include "rtc_base/thread_annotations.h"
Tommid3807da2020-05-22 15:36:3650#include "video/buffered_frame_decryptor.h"
Rasmus Brandtfbf66dd2022-05-23 07:53:3251#include "video/unique_timestamp_counter.h"
Tommid3807da2020-05-22 15:36:3652
53namespace webrtc {
54
Markus Handell06a2bf02021-07-22 13:09:3955class NackRequester;
Tommid3807da2020-05-22 15:36:3656class PacketRouter;
Tommid3807da2020-05-22 15:36:3657class ReceiveStatistics;
58class RtcpRttStats;
59class RtpPacketReceived;
60class Transport;
61class UlpfecReceiver;
62
63class RtpVideoStreamReceiver2 : public LossNotificationSender,
64 public RecoveredPacketReceiver,
65 public RtpPacketSinkInterface,
66 public KeyFrameRequestSender,
philipelb9813942022-07-05 09:31:3667 public NackSender,
Tommid3807da2020-05-22 15:36:3668 public OnDecryptedFrameCallback,
69 public OnDecryptionStatusChangeCallback,
70 public RtpVideoFrameReceiver {
71 public:
philipel21820962021-05-25 13:35:5772 // A complete frame is a frame which has received all its packets and all its
73 // references are known.
74 class OnCompleteFrameCallback {
75 public:
76 virtual ~OnCompleteFrameCallback() {}
77 virtual void OnCompleteFrame(std::unique_ptr<EncodedFrame> frame) = 0;
78 };
79
Tommid3807da2020-05-22 15:36:3680 RtpVideoStreamReceiver2(
Tommi63673fe2020-05-27 10:55:3881 TaskQueueBase* current_queue,
Tommid3807da2020-05-22 15:36:3682 Clock* clock,
83 Transport* transport,
84 RtcpRttStats* rtt_stats,
85 // The packet router is optional; if provided, the RtpRtcp module for this
86 // stream is registered as a candidate for sending REMB and transport
87 // feedback.
88 PacketRouter* packet_router,
Tommif6f45432022-05-20 13:21:2089 const VideoReceiveStreamInterface::Config* config,
Tommid3807da2020-05-22 15:36:3690 ReceiveStatistics* rtp_receive_statistics,
91 RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer,
92 RtcpCnameCallback* rtcp_cname_callback,
Markus Handell0e62f7a2021-07-20 11:32:0293 NackPeriodicProcessor* nack_periodic_processor,
Tommid3807da2020-05-22 15:36:3694 // The KeyFrameRequestSender is optional; if not provided, key frame
95 // requests are sent via the internal RtpRtcp module.
philipel6a671502021-03-22 13:17:0996 OnCompleteFrameCallback* complete_frame_callback,
Tommid3807da2020-05-22 15:36:3697 rtc::scoped_refptr<FrameDecryptorInterface> frame_decryptor,
Jonas Oreland8ca06132022-03-14 11:52:4898 rtc::scoped_refptr<FrameTransformerInterface> frame_transformer,
Brett Heberte04d0fa2022-08-09 18:25:0499 const FieldTrialsView& field_trials,
100 RtcEventLog* event_log);
Tommid3807da2020-05-22 15:36:36101 ~RtpVideoStreamReceiver2() override;
102
Niels Möller5401bad2020-08-11 10:17:42103 void AddReceiveCodec(uint8_t payload_type,
Danil Chapovalov5653c952021-08-10 14:57:56104 VideoCodecType video_codec,
Mirko Bonadei6c9c9582023-12-13 16:26:57105 const std::map<std::string, std::string>& codec_params,
Tommid3807da2020-05-22 15:36:36106 bool raw_payload);
Tommi96c1a9b2022-09-29 10:24:02107 void RemoveReceiveCodec(uint8_t payload_type);
108
109 // Clears state for all receive codecs added via `AddReceiveCodec`.
110 void RemoveReceiveCodecs();
Tommid3807da2020-05-22 15:36:36111
112 void StartReceive();
113 void StopReceive();
114
115 // Produces the transport-related timestamps; current_delay_ms is left unset.
116 absl::optional<Syncable::Info> GetSyncInfo() const;
117
118 bool DeliverRtcp(const uint8_t* rtcp_packet, size_t rtcp_packet_length);
119
120 void FrameContinuous(int64_t seq_num);
121
122 void FrameDecoded(int64_t seq_num);
123
124 void SignalNetworkState(NetworkState state);
125
126 // Returns number of different frames seen.
127 int GetUniqueFramesSeen() const {
Tommi376cf072021-05-31 17:14:38128 RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36129 return frame_counter_.GetUniqueSeen();
130 }
131
132 // Implements RtpPacketSinkInterface.
133 void OnRtpPacket(const RtpPacketReceived& packet) override;
134
Niels Möller3a749332020-09-03 13:40:44135 // Public only for tests.
Tommid3807da2020-05-22 15:36:36136 void OnReceivedPayloadData(rtc::CopyOnWriteBuffer codec_payload,
137 const RtpPacketReceived& rtp_packet,
138 const RTPVideoHeader& video);
139
140 // Implements RecoveredPacketReceiver.
Per K5e5d0172022-12-22 12:43:41141 void OnRecoveredPacket(const RtpPacketReceived& packet) override;
Tommid3807da2020-05-22 15:36:36142
143 // Send an RTCP keyframe request.
144 void RequestKeyFrame() override;
145
philipelb9813942022-07-05 09:31:36146 // Implements NackSender.
147 void SendNack(const std::vector<uint16_t>& sequence_numbers,
148 bool buffering_allowed) override;
149
Tommid3807da2020-05-22 15:36:36150 // Implements LossNotificationSender.
151 void SendLossNotification(uint16_t last_decoded_seq_num,
152 uint16_t last_received_seq_num,
153 bool decodability_flag,
154 bool buffering_allowed) override;
155
Tommid3807da2020-05-22 15:36:36156 // Returns true if a decryptor is attached and frames can be decrypted.
157 // Updated by OnDecryptionStatusChangeCallback. Note this refers to Frame
158 // Decryption not SRTP.
159 bool IsDecryptable() const;
160
Tommid3807da2020-05-22 15:36:36161 // Implements OnDecryptedFrameCallback.
philipelca188092021-03-23 11:00:49162 void OnDecryptedFrame(std::unique_ptr<RtpFrameObject> frame) override;
Tommid3807da2020-05-22 15:36:36163
164 // Implements OnDecryptionStatusChangeCallback.
165 void OnDecryptionStatusChange(
166 FrameDecryptorInterface::Status status) override;
167
168 // Optionally set a frame decryptor after a stream has started. This will not
169 // reset the decoder state.
170 void SetFrameDecryptor(
171 rtc::scoped_refptr<FrameDecryptorInterface> frame_decryptor);
172
173 // Sets a frame transformer after a stream has started, if no transformer
174 // has previously been set. Does not reset the decoder state.
175 void SetDepacketizerToDecoderFrameTransformer(
176 rtc::scoped_refptr<FrameTransformerInterface> frame_transformer);
177
Tommif6f45432022-05-20 13:21:20178 // Called by VideoReceiveStreamInterface when stats are updated.
Tommid3807da2020-05-22 15:36:36179 void UpdateRtt(int64_t max_rtt_ms);
180
Tommi1331c182022-05-17 08:13:52181 // Called when the local_ssrc is changed to match with a sender.
182 void OnLocalSsrcChange(uint32_t local_ssrc);
183
Tommiaeb44122022-07-14 16:33:42184 // Forwards the call to set rtcp_sender_ to the RTCP mode of the rtcp sender.
185 void SetRtcpMode(RtcpMode mode);
186
Tommi2e809362022-08-12 20:06:20187 void SetReferenceTimeReport(bool enabled);
188
Tommi185f10c2022-08-02 09:51:20189 // Sets or clears the callback sink that gets called for RTP packets. Used for
190 // packet handlers such as FlexFec. Must be called on the packet delivery
191 // thread (same context as `OnRtpPacket` is called on).
192 // TODO(bugs.webrtc.org/11993): Packet delivery thread today means `worker
193 // thread` but will be `network thread`.
194 void SetPacketSink(RtpPacketSinkInterface* packet_sink);
195
Tommie644a4b2022-08-03 14:13:53196 // Turns on/off loss notifications. Must be called on the packet delivery
197 // thread.
198 void SetLossNotificationEnabled(bool enabled);
199
Tommi3900f212022-08-05 14:21:54200 void SetNackHistory(TimeDelta history);
201
Tommi66d20c42022-08-12 13:05:17202 int ulpfec_payload_type() const;
Tommi1c5f3172022-08-13 08:43:59203 int red_payload_type() const;
Tommie1bd8332022-08-13 08:44:10204 void SetProtectionPayloadTypes(int red_payload_type, int ulpfec_payload_type);
Tommi1c5f3172022-08-13 08:43:59205
Tommid3807da2020-05-22 15:36:36206 absl::optional<int64_t> LastReceivedPacketMs() const;
Philipp Hancke5f4a7e02023-07-03 09:18:37207 absl::optional<uint32_t> LastReceivedFrameRtpTimestamp() const;
Tommid3807da2020-05-22 15:36:36208 absl::optional<int64_t> LastReceivedKeyframePacketMs() const;
209
Tommid3807da2020-05-22 15:36:36210 private:
211 // Implements RtpVideoFrameReceiver.
philipelca188092021-03-23 11:00:49212 void ManageFrame(std::unique_ptr<RtpFrameObject> frame) override;
Tommid3807da2020-05-22 15:36:36213
Tommi376cf072021-05-31 17:14:38214 void OnCompleteFrames(RtpFrameReferenceFinder::ReturnVector frame)
215 RTC_RUN_ON(packet_sequence_checker_);
216
Tommid3807da2020-05-22 15:36:36217 // Used for buffering RTCP feedback messages and sending them all together.
218 // Note:
219 // 1. Key frame requests and NACKs are mutually exclusive, with the
220 // former taking precedence over the latter.
221 // 2. Loss notifications are orthogonal to either. (That is, may be sent
222 // alongside either.)
223 class RtcpFeedbackBuffer : public KeyFrameRequestSender,
224 public NackSender,
225 public LossNotificationSender {
226 public:
227 RtcpFeedbackBuffer(KeyFrameRequestSender* key_frame_request_sender,
228 NackSender* nack_sender,
229 LossNotificationSender* loss_notification_sender);
230
231 ~RtcpFeedbackBuffer() override = default;
232
233 // KeyFrameRequestSender implementation.
Tommi63673fe2020-05-27 10:55:38234 void RequestKeyFrame() override;
Tommid3807da2020-05-22 15:36:36235
236 // NackSender implementation.
237 void SendNack(const std::vector<uint16_t>& sequence_numbers,
Tommi63673fe2020-05-27 10:55:38238 bool buffering_allowed) override;
Tommid3807da2020-05-22 15:36:36239
240 // LossNotificationSender implementation.
241 void SendLossNotification(uint16_t last_decoded_seq_num,
242 uint16_t last_received_seq_num,
243 bool decodability_flag,
Tommi63673fe2020-05-27 10:55:38244 bool buffering_allowed) override;
Tommid3807da2020-05-22 15:36:36245
246 // Send all RTCP feedback messages buffered thus far.
Tommi63673fe2020-05-27 10:55:38247 void SendBufferedRtcpFeedback();
Tommid3807da2020-05-22 15:36:36248
Tommie644a4b2022-08-03 14:13:53249 void ClearLossNotificationState();
250
Tommid3807da2020-05-22 15:36:36251 private:
252 // LNTF-related state.
253 struct LossNotificationState {
254 LossNotificationState(uint16_t last_decoded_seq_num,
255 uint16_t last_received_seq_num,
256 bool decodability_flag)
257 : last_decoded_seq_num(last_decoded_seq_num),
258 last_received_seq_num(last_received_seq_num),
259 decodability_flag(decodability_flag) {}
260
261 uint16_t last_decoded_seq_num;
262 uint16_t last_received_seq_num;
263 bool decodability_flag;
264 };
Tommid3807da2020-05-22 15:36:36265
Tommi376cf072021-05-31 17:14:38266 RTC_NO_UNIQUE_ADDRESS SequenceChecker packet_sequence_checker_;
Tommid3807da2020-05-22 15:36:36267 KeyFrameRequestSender* const key_frame_request_sender_;
268 NackSender* const nack_sender_;
269 LossNotificationSender* const loss_notification_sender_;
270
Tommid3807da2020-05-22 15:36:36271 // Key-frame-request-related state.
Tommi376cf072021-05-31 17:14:38272 bool request_key_frame_ RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36273
274 // NACK-related state.
Tommi63673fe2020-05-27 10:55:38275 std::vector<uint16_t> nack_sequence_numbers_
Tommi376cf072021-05-31 17:14:38276 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36277
Tommi63673fe2020-05-27 10:55:38278 absl::optional<LossNotificationState> lntf_state_
Tommi376cf072021-05-31 17:14:38279 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36280 };
281 enum ParseGenericDependenciesResult {
282 kDropPacket,
283 kHasGenericDescriptor,
284 kNoGenericDescriptor
285 };
286
287 // Entry point doing non-stats work for a received packet. Called
288 // for the same packet both before and after RED decapsulation.
Tommi376cf072021-05-31 17:14:38289 void ReceivePacket(const RtpPacketReceived& packet)
290 RTC_RUN_ON(packet_sequence_checker_);
291
Tommid3807da2020-05-22 15:36:36292 // Parses and handles RED headers.
293 // This function assumes that it's being called from only one thread.
Tommi376cf072021-05-31 17:14:38294 void ParseAndHandleEncapsulatingHeader(const RtpPacketReceived& packet)
295 RTC_RUN_ON(packet_sequence_checker_);
296 void NotifyReceiverOfEmptyPacket(uint16_t seq_num)
297 RTC_RUN_ON(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36298 bool IsRedEnabled() const;
Tommi376cf072021-05-31 17:14:38299 void InsertSpsPpsIntoTracker(uint8_t payload_type)
300 RTC_RUN_ON(packet_sequence_checker_);
301 void OnInsertedPacket(video_coding::PacketBuffer::InsertResult result)
302 RTC_RUN_ON(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36303 ParseGenericDependenciesResult ParseGenericDependenciesExtension(
304 const RtpPacketReceived& rtp_packet,
Tommi376cf072021-05-31 17:14:38305 RTPVideoHeader* video_header) RTC_RUN_ON(packet_sequence_checker_);
306 void OnAssembledFrame(std::unique_ptr<RtpFrameObject> frame)
307 RTC_RUN_ON(packet_sequence_checker_);
philipelce423ce2021-04-12 11:42:03308 void UpdatePacketReceiveTimestamps(const RtpPacketReceived& packet,
309 bool is_keyframe)
Tommi376cf072021-05-31 17:14:38310 RTC_RUN_ON(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36311
Jonas Orelande62c2f22022-03-29 09:04:48312 const FieldTrialsView& field_trials_;
Tommi3900f212022-08-05 14:21:54313 TaskQueueBase* const worker_queue_;
Tommid3807da2020-05-22 15:36:36314 Clock* const clock_;
Tommif6f45432022-05-20 13:21:20315 // Ownership of this object lies with VideoReceiveStreamInterface, which owns
316 // `this`.
317 const VideoReceiveStreamInterface::Config& config_;
Tommid3807da2020-05-22 15:36:36318 PacketRouter* const packet_router_;
Tommid3807da2020-05-22 15:36:36319
320 RemoteNtpTimeEstimator ntp_estimator_;
321
Tommid3807da2020-05-22 15:36:36322 // Set by the field trial WebRTC-ForcePlayoutDelay to override any playout
323 // delay that is specified in the received packets.
324 FieldTrialOptional<int> forced_playout_delay_max_ms_;
325 FieldTrialOptional<int> forced_playout_delay_min_ms_;
326 ReceiveStatistics* const rtp_receive_statistics_;
Tommi66d20c42022-08-12 13:05:17327 std::unique_ptr<UlpfecReceiver> ulpfec_receiver_
328 RTC_GUARDED_BY(packet_sequence_checker_);
Tommi1c5f3172022-08-13 08:43:59329 int red_payload_type_ RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36330
Mirko Bonadei20e4c802020-11-23 10:07:42331 RTC_NO_UNIQUE_ADDRESS SequenceChecker worker_task_checker_;
Tommi376cf072021-05-31 17:14:38332 // TODO(bugs.webrtc.org/11993): This checker conceptually represents
333 // operations that belong to the network thread. The Call class is currently
334 // moving towards handling network packets on the network thread and while
335 // that work is ongoing, this checker may in practice represent the worker
336 // thread, but still serves as a mechanism of grouping together concepts
337 // that belong to the network thread. Once the packets are fully delivered
338 // on the network thread, this comment will be deleted.
339 RTC_NO_UNIQUE_ADDRESS SequenceChecker packet_sequence_checker_;
Tommi185f10c2022-08-02 09:51:20340 RtpPacketSinkInterface* packet_sink_ RTC_GUARDED_BY(packet_sequence_checker_);
Tommi376cf072021-05-31 17:14:38341 bool receiving_ RTC_GUARDED_BY(packet_sequence_checker_);
342 int64_t last_packet_log_ms_ RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36343
Tomas Gunnarssonf25761d2020-06-03 20:55:33344 const std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp_;
Tommid3807da2020-05-22 15:36:36345
Tommi3900f212022-08-05 14:21:54346 NackPeriodicProcessor* const nack_periodic_processor_;
philipel6a671502021-03-22 13:17:09347 OnCompleteFrameCallback* complete_frame_callback_;
Nico Grunbauma36f10b2021-12-09 04:59:31348 const KeyFrameReqMethod keyframe_request_method_;
Tommid3807da2020-05-22 15:36:36349
350 RtcpFeedbackBuffer rtcp_feedback_buffer_;
Tommi3900f212022-08-05 14:21:54351 // TODO(tommi): Consider absl::optional<NackRequester> instead of unique_ptr
352 // since nack is usually configured.
353 std::unique_ptr<NackRequester> nack_module_
354 RTC_GUARDED_BY(packet_sequence_checker_);
Tommie644a4b2022-08-03 14:13:53355 std::unique_ptr<LossNotificationController> loss_notification_controller_
356 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36357
philipeldad500a2021-04-14 14:23:34358 video_coding::PacketBuffer packet_buffer_
Tommi376cf072021-05-31 17:14:38359 RTC_GUARDED_BY(packet_sequence_checker_);
360 UniqueTimestampCounter frame_counter_
361 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36362 SeqNumUnwrapper<uint16_t> frame_id_unwrapper_
Tommi376cf072021-05-31 17:14:38363 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36364
365 // Video structure provided in the dependency descriptor in a first packet
366 // of a key frame. It is required to parse dependency descriptor in the
367 // following delta packets.
368 std::unique_ptr<FrameDependencyStructure> video_structure_
Tommi376cf072021-05-31 17:14:38369 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36370 // Frame id of the last frame with the attached video structure.
371 // absl::nullopt when `video_structure_ == nullptr`;
372 absl::optional<int64_t> video_structure_frame_id_
Tommi376cf072021-05-31 17:14:38373 RTC_GUARDED_BY(packet_sequence_checker_);
philipelc4ea5ae2023-01-20 12:13:01374 Timestamp last_logged_failed_to_parse_dd_
375 RTC_GUARDED_BY(packet_sequence_checker_) = Timestamp::MinusInfinity();
Tommid3807da2020-05-22 15:36:36376
philipel6a671502021-03-22 13:17:09377 std::unique_ptr<RtpFrameReferenceFinder> reference_finder_
Tommi376cf072021-05-31 17:14:38378 RTC_GUARDED_BY(packet_sequence_checker_);
Tommi63673fe2020-05-27 10:55:38379 absl::optional<VideoCodecType> current_codec_
Tommi376cf072021-05-31 17:14:38380 RTC_GUARDED_BY(packet_sequence_checker_);
Tommi63673fe2020-05-27 10:55:38381 uint32_t last_assembled_frame_rtp_timestamp_
Tommi376cf072021-05-31 17:14:38382 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36383
Tommid3807da2020-05-22 15:36:36384 std::map<int64_t, uint16_t> last_seq_num_for_pic_id_
Tommi376cf072021-05-31 17:14:38385 RTC_GUARDED_BY(packet_sequence_checker_);
386 video_coding::H264SpsPpsTracker tracker_
387 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36388
389 // Maps payload id to the depacketizer.
Tommi63673fe2020-05-27 10:55:38390 std::map<uint8_t, std::unique_ptr<VideoRtpDepacketizer>> payload_type_map_
Tommi376cf072021-05-31 17:14:38391 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36392
393 // TODO(johan): Remove pt_codec_params_ once
394 // https://bugs.chromium.org/p/webrtc/issues/detail?id=6883 is resolved.
395 // Maps a payload type to a map of out-of-band supplied codec parameters.
Mirko Bonadei6c9c9582023-12-13 16:26:57396 std::map<uint8_t, std::map<std::string, std::string>> pt_codec_params_
Tommi376cf072021-05-31 17:14:38397 RTC_GUARDED_BY(packet_sequence_checker_);
398 int16_t last_payload_type_ RTC_GUARDED_BY(packet_sequence_checker_) = -1;
Tommid3807da2020-05-22 15:36:36399
Tommi376cf072021-05-31 17:14:38400 bool has_received_frame_ RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36401
Tommid3807da2020-05-22 15:36:36402 absl::optional<uint32_t> last_received_rtp_timestamp_
Tommi376cf072021-05-31 17:14:38403 RTC_GUARDED_BY(packet_sequence_checker_);
philipelb8493112021-04-16 10:10:22404 absl::optional<uint32_t> last_received_keyframe_rtp_timestamp_
Tommi376cf072021-05-31 17:14:38405 RTC_GUARDED_BY(packet_sequence_checker_);
philipelce423ce2021-04-12 11:42:03406 absl::optional<Timestamp> last_received_rtp_system_time_
Tommi376cf072021-05-31 17:14:38407 RTC_GUARDED_BY(packet_sequence_checker_);
philipelce423ce2021-04-12 11:42:03408 absl::optional<Timestamp> last_received_keyframe_rtp_system_time_
Tommi376cf072021-05-31 17:14:38409 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36410
Tommid3807da2020-05-22 15:36:36411 // Handles incoming encrypted frames and forwards them to the
412 // rtp_reference_finder if they are decryptable.
413 std::unique_ptr<BufferedFrameDecryptor> buffered_frame_decryptor_
Tommi376cf072021-05-31 17:14:38414 RTC_PT_GUARDED_BY(packet_sequence_checker_);
Tommi63673fe2020-05-27 10:55:38415 bool frames_decryptable_ RTC_GUARDED_BY(worker_task_checker_);
Tommid3807da2020-05-22 15:36:36416 absl::optional<ColorSpace> last_color_space_;
417
Minyue Li63b30952021-05-19 12:38:25418 AbsoluteCaptureTimeInterpolator absolute_capture_time_interpolator_
Tommi376cf072021-05-31 17:14:38419 RTC_GUARDED_BY(packet_sequence_checker_);
Minyue Li63b30952021-05-19 12:38:25420
421 CaptureClockOffsetUpdater capture_clock_offset_updater_
Tommi376cf072021-05-31 17:14:38422 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36423
424 int64_t last_completed_picture_id_ = 0;
425
426 rtc::scoped_refptr<RtpVideoStreamReceiverFrameTransformerDelegate>
427 frame_transformer_delegate_;
philipel9599b3c2021-05-11 09:30:52428
429 SeqNumUnwrapper<uint16_t> rtp_seq_num_unwrapper_
Tommi376cf072021-05-31 17:14:38430 RTC_GUARDED_BY(packet_sequence_checker_);
philipel9599b3c2021-05-11 09:30:52431 std::map<int64_t, RtpPacketInfo> packet_infos_
Tommi376cf072021-05-31 17:14:38432 RTC_GUARDED_BY(packet_sequence_checker_);
philipel17093412022-06-13 11:14:43433
434 Timestamp next_keyframe_request_for_missing_video_structure_ =
435 Timestamp::MinusInfinity();
Tommid3807da2020-05-22 15:36:36436};
437
438} // namespace webrtc
439
440#endif // VIDEO_RTP_VIDEO_STREAM_RECEIVER2_H_