Simplify RtpVideoStreamReceiver::NotifyReceiverOfFecPacket.
This also has the benefit of deleting one unneeded call to RTPPayloadRegistry::last_received_media_payload_type. To make this work, also extend NackModule with a OnReceivedPacket method taking only the sequence number and the is_keyframe flag, rather than a complete VCMPacket. Bug: webrtc:8995 Change-Id: Ice379581166e7b1609ec719e944a5a543d69acc1 Reviewed-on: https://webrtc-review.googlesource.com/64120 Reviewed-by: Erik Språng <sprang@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22584}
This commit is contained in:
committed by
Niels Moller
parent
9718711dee
commit
bc01047ece
@ -55,16 +55,13 @@ NackModule::NackModule(Clock* clock,
|
||||
RTC_DCHECK(keyframe_request_sender_);
|
||||
}
|
||||
|
||||
int NackModule::OnReceivedPacket(const VCMPacket& packet) {
|
||||
int NackModule::OnReceivedPacket(uint16_t seq_num, bool is_keyframe) {
|
||||
rtc::CritScope lock(&crit_);
|
||||
uint16_t seq_num = packet.seqNum;
|
||||
// TODO(philipel): When the packet includes information whether it is
|
||||
// retransmitted or not, use that value instead. For
|
||||
// now set it to true, which will cause the reordering
|
||||
// statistics to never be updated.
|
||||
bool is_retransmitted = true;
|
||||
bool is_keyframe =
|
||||
packet.is_first_packet_in_frame && packet.frameType == kVideoFrameKey;
|
||||
|
||||
if (!initialized_) {
|
||||
newest_seq_num_ = seq_num;
|
||||
@ -111,6 +108,12 @@ int NackModule::OnReceivedPacket(const VCMPacket& packet) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int NackModule::OnReceivedPacket(const VCMPacket& packet) {
|
||||
return OnReceivedPacket(
|
||||
packet.seqNum,
|
||||
packet.is_first_packet_in_frame && packet.frameType == kVideoFrameKey);
|
||||
}
|
||||
|
||||
void NackModule::ClearUpTo(uint16_t seq_num) {
|
||||
rtc::CritScope lock(&crit_);
|
||||
nack_list_.erase(nack_list_.begin(), nack_list_.lower_bound(seq_num));
|
||||
|
||||
@ -32,6 +32,7 @@ class NackModule : public Module {
|
||||
NackSender* nack_sender,
|
||||
KeyFrameRequestSender* keyframe_request_sender);
|
||||
|
||||
int OnReceivedPacket(uint16_t seq_num, bool is_keyframe);
|
||||
int OnReceivedPacket(const VCMPacket& packet);
|
||||
void ClearUpTo(uint16_t seq_num);
|
||||
void UpdateRtt(int64_t rtt_ms);
|
||||
|
||||
Reference in New Issue
Block a user