Replace SequencedTaskChecker in RTPSenderVideo
This is not the right place for a SequencedTaskChecker, as we can
not make any guarantees about the thread this method runs on.
We were hitting this check on Android and iOS whenever the encoder
would be reconfigured. Access to these ivars should be guarded
by a lock.
As a bonus, an unused method declaration was removed.
BUG=webrtc:6686
Review-Url: https://codereview.webrtc.org/2495483002
Cr-Commit-Position: refs/heads/master@{#15019}
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
index 4a007c5..0cc5831 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
@@ -58,9 +58,7 @@
delta_fec_params_{0, 1, kFecMaskRandom},
key_fec_params_{0, 1, kFecMaskRandom},
fec_bitrate_(1000, RateStatistics::kBpsScale),
- video_bitrate_(1000, RateStatistics::kBpsScale) {
- encoder_checker_.Detach();
-}
+ video_bitrate_(1000, RateStatistics::kBpsScale) { }
RTPSenderVideo::~RTPSenderVideo() {}
@@ -284,7 +282,6 @@
size_t payload_size,
const RTPFragmentationHeader* fragmentation,
const RTPVideoHeader* video_header) {
- RTC_DCHECK_CALLED_SEQUENTIALLY(&encoder_checker_);
if (payload_size == 0)
return false;
@@ -306,6 +303,8 @@
if (video_header) {
// Set rotation when key frame or when changed (to follow standard).
// Or when different from 0 (to follow current receiver implementation).
+ // TODO(kthelgason): Merge this crit scope with the one below.
+ rtc::CritScope cs(&crit_);
VideoRotation current_rotation = video_header->rotation;
if (frame_type == kVideoFrameKey || current_rotation != last_rotation_ ||
current_rotation != kVideoRotation_0)
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.h b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.h
index da016b7..2486104 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.h
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.h
@@ -58,8 +58,6 @@
const RTPFragmentationHeader* fragmentation,
const RTPVideoHeader* video_header);
- int32_t SendRTPIntraRequest();
-
void SetVideoCodecType(RtpVideoCodecTypes type);
// ULPFEC.
@@ -105,11 +103,10 @@
// Should never be held when calling out of this class.
rtc::CriticalSection crit_;
- rtc::SequencedTaskChecker encoder_checker_;
RtpVideoCodecTypes video_type_;
int32_t retransmission_settings_ GUARDED_BY(crit_);
- VideoRotation last_rotation_ GUARDED_BY(encoder_checker_);
+ VideoRotation last_rotation_ GUARDED_BY(crit_);
// RED/ULPFEC.
int red_payload_type_ GUARDED_BY(crit_);