Miscellaneous cleanups in VCMReceiver and its unit tests.
The most important change is to prevent a potential buffer overflow in
NackList(). It cannot happen if the |size| argument passed to NackList()
is consistent with the |max_nack_list_size| argument passed to
SetNackSettings(), and there is an assertion to check that. But it is
good to defend against this in the release build because assert() is
compiled away in the release build.
Remove the unused |master| parameter to the VCMReceiver constructor.
Remove the unused State() getter method and the corresponding state_
member.
Remove the declarations for the nonexistent GenerateReceiverId()
method and the receiver_id_counter_ member.
Remove the unneeded data_buffer_ member of TestVCMReceiver. It was
assigned to packet.dataPtr and then immediately overwritten by
stream_generator_->GetPacket() or stream_generator_->PopPacket().
R=stefan@webrtc.org
BUG=none
TEST=none
Review URL: https://webrtc-codereview.appspot.com/51119004
Cr-Commit-Position: refs/heads/master@{#9318}
diff --git a/webrtc/modules/video_coding/main/source/receiver.h b/webrtc/modules/video_coding/main/source/receiver.h
index fd48afc..049fb84 100644
--- a/webrtc/modules/video_coding/main/source/receiver.h
+++ b/webrtc/modules/video_coding/main/source/receiver.h
@@ -28,18 +28,11 @@
kNackKeyFrameRequest
};
-enum VCMReceiverState {
- kReceiving,
- kPassive,
- kWaitForPrimaryDecode
-};
-
class VCMReceiver {
public:
VCMReceiver(VCMTiming* timing,
Clock* clock,
- EventFactory* event_factory,
- bool master);
+ EventFactory* event_factory);
~VCMReceiver();
void Reset();
@@ -64,7 +57,6 @@
VCMNackMode NackMode() const;
VCMNackStatus NackList(uint16_t* nackList, uint16_t size,
uint16_t* nack_list_length);
- VCMReceiverState State() const;
// Receiver video delay.
int SetMinReceiverDelay(int desired_delay_ms);
@@ -83,17 +75,12 @@
void TriggerDecoderShutdown();
private:
- static int32_t GenerateReceiverId();
-
CriticalSectionWrapper* crit_sect_;
Clock* const clock_;
VCMJitterBuffer jitter_buffer_;
VCMTiming* timing_;
rtc::scoped_ptr<EventWrapper> render_wait_event_;
- VCMReceiverState state_;
int max_video_delay_ms_;
-
- static int32_t receiver_id_counter_;
};
} // namespace webrtc