blob: cead2a3147570440f55f4559caa3c60f94082874 [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"
29#include "modules/rtp_rtcp/include/remote_ntp_time_estimator.h"
30#include "modules/rtp_rtcp/include/rtp_header_extension_map.h"
Tommid3807da2020-05-22 15:36:3631#include "modules/rtp_rtcp/include/rtp_rtcp_defines.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"
39#include "modules/rtp_rtcp/source/video_rtp_depacketizer.h"
40#include "modules/video_coding/h264_sps_pps_tracker.h"
41#include "modules/video_coding/loss_notification_controller.h"
Markus Handell06a2bf02021-07-22 13:09:3942#include "modules/video_coding/nack_requester.h"
Tommid3807da2020-05-22 15:36:3643#include "modules/video_coding/packet_buffer.h"
44#include "modules/video_coding/rtp_frame_reference_finder.h"
Tommid3807da2020-05-22 15:36:3645#include "rtc_base/experiments/field_trial_parser.h"
46#include "rtc_base/numerics/sequence_number_util.h"
Mirko Bonadei20e4c802020-11-23 10:07:4247#include "rtc_base/system/no_unique_address.h"
Tommid3807da2020-05-22 15:36:3648#include "rtc_base/thread_annotations.h"
Tommid3807da2020-05-22 15:36:3649#include "video/buffered_frame_decryptor.h"
50#include "video/rtp_video_stream_receiver_frame_transformer_delegate.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,
Tommid3807da2020-05-22 15:36:36105 const std::map<std::string, std::string>& codec_params,
106 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.
141 void OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override;
142
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
Tommi1f38a382021-09-08 08:44:50178 // Updates the rtp header extensions at runtime. Must be called on the
179 // `packet_sequence_checker_` thread.
180 void SetRtpExtensions(const std::vector<RtpExtension>& extensions);
Tommicf4ed152022-05-09 20:46:57181 const RtpHeaderExtensionMap& GetRtpExtensions() const;
Tommi1f38a382021-09-08 08:44:50182
Tommif6f45432022-05-20 13:21:20183 // Called by VideoReceiveStreamInterface when stats are updated.
Tommid3807da2020-05-22 15:36:36184 void UpdateRtt(int64_t max_rtt_ms);
185
Tommi1331c182022-05-17 08:13:52186 // Called when the local_ssrc is changed to match with a sender.
187 void OnLocalSsrcChange(uint32_t local_ssrc);
188
Tommiaeb44122022-07-14 16:33:42189 // Forwards the call to set rtcp_sender_ to the RTCP mode of the rtcp sender.
190 void SetRtcpMode(RtcpMode mode);
191
Tommi2e809362022-08-12 20:06:20192 void SetReferenceTimeReport(bool enabled);
193
Tommi185f10c2022-08-02 09:51:20194 // Sets or clears the callback sink that gets called for RTP packets. Used for
195 // packet handlers such as FlexFec. Must be called on the packet delivery
196 // thread (same context as `OnRtpPacket` is called on).
197 // TODO(bugs.webrtc.org/11993): Packet delivery thread today means `worker
198 // thread` but will be `network thread`.
199 void SetPacketSink(RtpPacketSinkInterface* packet_sink);
200
Tommie644a4b2022-08-03 14:13:53201 // Turns on/off loss notifications. Must be called on the packet delivery
202 // thread.
203 void SetLossNotificationEnabled(bool enabled);
204
Tommi3900f212022-08-05 14:21:54205 void SetNackHistory(TimeDelta history);
206
Tommi66d20c42022-08-12 13:05:17207 int ulpfec_payload_type() const;
Tommi1c5f3172022-08-13 08:43:59208 int red_payload_type() const;
Tommie1bd8332022-08-13 08:44:10209 void SetProtectionPayloadTypes(int red_payload_type, int ulpfec_payload_type);
Tommi1c5f3172022-08-13 08:43:59210
Tommid3807da2020-05-22 15:36:36211 absl::optional<int64_t> LastReceivedPacketMs() const;
212 absl::optional<int64_t> LastReceivedKeyframePacketMs() const;
213
Tommid3807da2020-05-22 15:36:36214 private:
215 // Implements RtpVideoFrameReceiver.
philipelca188092021-03-23 11:00:49216 void ManageFrame(std::unique_ptr<RtpFrameObject> frame) override;
Tommid3807da2020-05-22 15:36:36217
Tommi376cf072021-05-31 17:14:38218 void OnCompleteFrames(RtpFrameReferenceFinder::ReturnVector frame)
219 RTC_RUN_ON(packet_sequence_checker_);
220
Tommid3807da2020-05-22 15:36:36221 // Used for buffering RTCP feedback messages and sending them all together.
222 // Note:
223 // 1. Key frame requests and NACKs are mutually exclusive, with the
224 // former taking precedence over the latter.
225 // 2. Loss notifications are orthogonal to either. (That is, may be sent
226 // alongside either.)
227 class RtcpFeedbackBuffer : public KeyFrameRequestSender,
228 public NackSender,
229 public LossNotificationSender {
230 public:
231 RtcpFeedbackBuffer(KeyFrameRequestSender* key_frame_request_sender,
232 NackSender* nack_sender,
233 LossNotificationSender* loss_notification_sender);
234
235 ~RtcpFeedbackBuffer() override = default;
236
237 // KeyFrameRequestSender implementation.
Tommi63673fe2020-05-27 10:55:38238 void RequestKeyFrame() override;
Tommid3807da2020-05-22 15:36:36239
240 // NackSender implementation.
241 void SendNack(const std::vector<uint16_t>& sequence_numbers,
Tommi63673fe2020-05-27 10:55:38242 bool buffering_allowed) override;
Tommid3807da2020-05-22 15:36:36243
244 // LossNotificationSender implementation.
245 void SendLossNotification(uint16_t last_decoded_seq_num,
246 uint16_t last_received_seq_num,
247 bool decodability_flag,
Tommi63673fe2020-05-27 10:55:38248 bool buffering_allowed) override;
Tommid3807da2020-05-22 15:36:36249
250 // Send all RTCP feedback messages buffered thus far.
Tommi63673fe2020-05-27 10:55:38251 void SendBufferedRtcpFeedback();
Tommid3807da2020-05-22 15:36:36252
Tommie644a4b2022-08-03 14:13:53253 void ClearLossNotificationState();
254
Tommid3807da2020-05-22 15:36:36255 private:
256 // LNTF-related state.
257 struct LossNotificationState {
258 LossNotificationState(uint16_t last_decoded_seq_num,
259 uint16_t last_received_seq_num,
260 bool decodability_flag)
261 : last_decoded_seq_num(last_decoded_seq_num),
262 last_received_seq_num(last_received_seq_num),
263 decodability_flag(decodability_flag) {}
264
265 uint16_t last_decoded_seq_num;
266 uint16_t last_received_seq_num;
267 bool decodability_flag;
268 };
Tommid3807da2020-05-22 15:36:36269
Tommi376cf072021-05-31 17:14:38270 RTC_NO_UNIQUE_ADDRESS SequenceChecker packet_sequence_checker_;
Tommid3807da2020-05-22 15:36:36271 KeyFrameRequestSender* const key_frame_request_sender_;
272 NackSender* const nack_sender_;
273 LossNotificationSender* const loss_notification_sender_;
274
Tommid3807da2020-05-22 15:36:36275 // Key-frame-request-related state.
Tommi376cf072021-05-31 17:14:38276 bool request_key_frame_ RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36277
278 // NACK-related state.
Tommi63673fe2020-05-27 10:55:38279 std::vector<uint16_t> nack_sequence_numbers_
Tommi376cf072021-05-31 17:14:38280 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36281
Tommi63673fe2020-05-27 10:55:38282 absl::optional<LossNotificationState> lntf_state_
Tommi376cf072021-05-31 17:14:38283 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36284 };
285 enum ParseGenericDependenciesResult {
286 kDropPacket,
287 kHasGenericDescriptor,
288 kNoGenericDescriptor
289 };
290
291 // Entry point doing non-stats work for a received packet. Called
292 // for the same packet both before and after RED decapsulation.
Tommi376cf072021-05-31 17:14:38293 void ReceivePacket(const RtpPacketReceived& packet)
294 RTC_RUN_ON(packet_sequence_checker_);
295
Tommid3807da2020-05-22 15:36:36296 // Parses and handles RED headers.
297 // This function assumes that it's being called from only one thread.
Tommi376cf072021-05-31 17:14:38298 void ParseAndHandleEncapsulatingHeader(const RtpPacketReceived& packet)
299 RTC_RUN_ON(packet_sequence_checker_);
300 void NotifyReceiverOfEmptyPacket(uint16_t seq_num)
301 RTC_RUN_ON(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36302 bool IsRedEnabled() const;
Tommi376cf072021-05-31 17:14:38303 void InsertSpsPpsIntoTracker(uint8_t payload_type)
304 RTC_RUN_ON(packet_sequence_checker_);
305 void OnInsertedPacket(video_coding::PacketBuffer::InsertResult result)
306 RTC_RUN_ON(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36307 ParseGenericDependenciesResult ParseGenericDependenciesExtension(
308 const RtpPacketReceived& rtp_packet,
Tommi376cf072021-05-31 17:14:38309 RTPVideoHeader* video_header) RTC_RUN_ON(packet_sequence_checker_);
310 void OnAssembledFrame(std::unique_ptr<RtpFrameObject> frame)
311 RTC_RUN_ON(packet_sequence_checker_);
philipelce423ce2021-04-12 11:42:03312 void UpdatePacketReceiveTimestamps(const RtpPacketReceived& packet,
313 bool is_keyframe)
Tommi376cf072021-05-31 17:14:38314 RTC_RUN_ON(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36315
Jonas Orelande62c2f22022-03-29 09:04:48316 const FieldTrialsView& field_trials_;
Tommi3900f212022-08-05 14:21:54317 TaskQueueBase* const worker_queue_;
Tommid3807da2020-05-22 15:36:36318 Clock* const clock_;
Tommif6f45432022-05-20 13:21:20319 // Ownership of this object lies with VideoReceiveStreamInterface, which owns
320 // `this`.
321 const VideoReceiveStreamInterface::Config& config_;
Tommid3807da2020-05-22 15:36:36322 PacketRouter* const packet_router_;
Tommid3807da2020-05-22 15:36:36323
324 RemoteNtpTimeEstimator ntp_estimator_;
325
Tommi1f38a382021-09-08 08:44:50326 RtpHeaderExtensionMap rtp_header_extensions_
327 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36328 // Set by the field trial WebRTC-ForcePlayoutDelay to override any playout
329 // delay that is specified in the received packets.
330 FieldTrialOptional<int> forced_playout_delay_max_ms_;
331 FieldTrialOptional<int> forced_playout_delay_min_ms_;
332 ReceiveStatistics* const rtp_receive_statistics_;
Tommi66d20c42022-08-12 13:05:17333 std::unique_ptr<UlpfecReceiver> ulpfec_receiver_
334 RTC_GUARDED_BY(packet_sequence_checker_);
Tommi1c5f3172022-08-13 08:43:59335 int red_payload_type_ RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36336
Mirko Bonadei20e4c802020-11-23 10:07:42337 RTC_NO_UNIQUE_ADDRESS SequenceChecker worker_task_checker_;
Tommi376cf072021-05-31 17:14:38338 // TODO(bugs.webrtc.org/11993): This checker conceptually represents
339 // operations that belong to the network thread. The Call class is currently
340 // moving towards handling network packets on the network thread and while
341 // that work is ongoing, this checker may in practice represent the worker
342 // thread, but still serves as a mechanism of grouping together concepts
343 // that belong to the network thread. Once the packets are fully delivered
344 // on the network thread, this comment will be deleted.
345 RTC_NO_UNIQUE_ADDRESS SequenceChecker packet_sequence_checker_;
Tommi185f10c2022-08-02 09:51:20346 RtpPacketSinkInterface* packet_sink_ RTC_GUARDED_BY(packet_sequence_checker_);
Tommi376cf072021-05-31 17:14:38347 bool receiving_ RTC_GUARDED_BY(packet_sequence_checker_);
348 int64_t last_packet_log_ms_ RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36349
Tomas Gunnarssonf25761d2020-06-03 20:55:33350 const std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp_;
Tommid3807da2020-05-22 15:36:36351
Tommi3900f212022-08-05 14:21:54352 NackPeriodicProcessor* const nack_periodic_processor_;
philipel6a671502021-03-22 13:17:09353 OnCompleteFrameCallback* complete_frame_callback_;
Nico Grunbauma36f10b2021-12-09 04:59:31354 const KeyFrameReqMethod keyframe_request_method_;
Tommid3807da2020-05-22 15:36:36355
356 RtcpFeedbackBuffer rtcp_feedback_buffer_;
Tommi3900f212022-08-05 14:21:54357 // TODO(tommi): Consider absl::optional<NackRequester> instead of unique_ptr
358 // since nack is usually configured.
359 std::unique_ptr<NackRequester> nack_module_
360 RTC_GUARDED_BY(packet_sequence_checker_);
Tommie644a4b2022-08-03 14:13:53361 std::unique_ptr<LossNotificationController> loss_notification_controller_
362 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36363
philipeldad500a2021-04-14 14:23:34364 video_coding::PacketBuffer packet_buffer_
Tommi376cf072021-05-31 17:14:38365 RTC_GUARDED_BY(packet_sequence_checker_);
366 UniqueTimestampCounter frame_counter_
367 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36368 SeqNumUnwrapper<uint16_t> frame_id_unwrapper_
Tommi376cf072021-05-31 17:14:38369 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36370
371 // Video structure provided in the dependency descriptor in a first packet
372 // of a key frame. It is required to parse dependency descriptor in the
373 // following delta packets.
374 std::unique_ptr<FrameDependencyStructure> video_structure_
Tommi376cf072021-05-31 17:14:38375 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36376 // Frame id of the last frame with the attached video structure.
377 // absl::nullopt when `video_structure_ == nullptr`;
378 absl::optional<int64_t> video_structure_frame_id_
Tommi376cf072021-05-31 17:14:38379 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36380
philipel6a671502021-03-22 13:17:09381 std::unique_ptr<RtpFrameReferenceFinder> reference_finder_
Tommi376cf072021-05-31 17:14:38382 RTC_GUARDED_BY(packet_sequence_checker_);
Tommi63673fe2020-05-27 10:55:38383 absl::optional<VideoCodecType> current_codec_
Tommi376cf072021-05-31 17:14:38384 RTC_GUARDED_BY(packet_sequence_checker_);
Tommi63673fe2020-05-27 10:55:38385 uint32_t last_assembled_frame_rtp_timestamp_
Tommi376cf072021-05-31 17:14:38386 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36387
Tommid3807da2020-05-22 15:36:36388 std::map<int64_t, uint16_t> last_seq_num_for_pic_id_
Tommi376cf072021-05-31 17:14:38389 RTC_GUARDED_BY(packet_sequence_checker_);
390 video_coding::H264SpsPpsTracker tracker_
391 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36392
393 // Maps payload id to the depacketizer.
Tommi63673fe2020-05-27 10:55:38394 std::map<uint8_t, std::unique_ptr<VideoRtpDepacketizer>> payload_type_map_
Tommi376cf072021-05-31 17:14:38395 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36396
397 // TODO(johan): Remove pt_codec_params_ once
398 // https://bugs.chromium.org/p/webrtc/issues/detail?id=6883 is resolved.
399 // Maps a payload type to a map of out-of-band supplied codec parameters.
Tommi63673fe2020-05-27 10:55:38400 std::map<uint8_t, std::map<std::string, std::string>> pt_codec_params_
Tommi376cf072021-05-31 17:14:38401 RTC_GUARDED_BY(packet_sequence_checker_);
402 int16_t last_payload_type_ RTC_GUARDED_BY(packet_sequence_checker_) = -1;
Tommid3807da2020-05-22 15:36:36403
Tommi376cf072021-05-31 17:14:38404 bool has_received_frame_ RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36405
Tommid3807da2020-05-22 15:36:36406 absl::optional<uint32_t> last_received_rtp_timestamp_
Tommi376cf072021-05-31 17:14:38407 RTC_GUARDED_BY(packet_sequence_checker_);
philipelb8493112021-04-16 10:10:22408 absl::optional<uint32_t> last_received_keyframe_rtp_timestamp_
Tommi376cf072021-05-31 17:14:38409 RTC_GUARDED_BY(packet_sequence_checker_);
philipelce423ce2021-04-12 11:42:03410 absl::optional<Timestamp> last_received_rtp_system_time_
Tommi376cf072021-05-31 17:14:38411 RTC_GUARDED_BY(packet_sequence_checker_);
philipelce423ce2021-04-12 11:42:03412 absl::optional<Timestamp> last_received_keyframe_rtp_system_time_
Tommi376cf072021-05-31 17:14:38413 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36414
Tommid3807da2020-05-22 15:36:36415 // Handles incoming encrypted frames and forwards them to the
416 // rtp_reference_finder if they are decryptable.
417 std::unique_ptr<BufferedFrameDecryptor> buffered_frame_decryptor_
Tommi376cf072021-05-31 17:14:38418 RTC_PT_GUARDED_BY(packet_sequence_checker_);
Tommi63673fe2020-05-27 10:55:38419 bool frames_decryptable_ RTC_GUARDED_BY(worker_task_checker_);
Tommid3807da2020-05-22 15:36:36420 absl::optional<ColorSpace> last_color_space_;
421
Minyue Li63b30952021-05-19 12:38:25422 AbsoluteCaptureTimeInterpolator absolute_capture_time_interpolator_
Tommi376cf072021-05-31 17:14:38423 RTC_GUARDED_BY(packet_sequence_checker_);
Minyue Li63b30952021-05-19 12:38:25424
425 CaptureClockOffsetUpdater capture_clock_offset_updater_
Tommi376cf072021-05-31 17:14:38426 RTC_GUARDED_BY(packet_sequence_checker_);
Tommid3807da2020-05-22 15:36:36427
428 int64_t last_completed_picture_id_ = 0;
429
430 rtc::scoped_refptr<RtpVideoStreamReceiverFrameTransformerDelegate>
431 frame_transformer_delegate_;
philipel9599b3c2021-05-11 09:30:52432
433 SeqNumUnwrapper<uint16_t> rtp_seq_num_unwrapper_
Tommi376cf072021-05-31 17:14:38434 RTC_GUARDED_BY(packet_sequence_checker_);
philipel9599b3c2021-05-11 09:30:52435 std::map<int64_t, RtpPacketInfo> packet_infos_
Tommi376cf072021-05-31 17:14:38436 RTC_GUARDED_BY(packet_sequence_checker_);
philipel17093412022-06-13 11:14:43437
438 Timestamp next_keyframe_request_for_missing_video_structure_ =
439 Timestamp::MinusInfinity();
Tommid3807da2020-05-22 15:36:36440};
441
442} // namespace webrtc
443
444#endif // VIDEO_RTP_VIDEO_STREAM_RECEIVER2_H_