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}
This commit is contained in:
kthelgason 2016-11-10 06:22:17 -08:00 committed by Commit bot
parent 1b35d4cdf1
commit 917a4eeb60
2 changed files with 4 additions and 8 deletions

View File

@ -58,9 +58,7 @@ RTPSenderVideo::RTPSenderVideo(Clock* clock,
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 @@ bool RTPSenderVideo::SendVideo(RtpVideoCodecTypes video_type,
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 @@ bool RTPSenderVideo::SendVideo(RtpVideoCodecTypes video_type,
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)

View File

@ -58,8 +58,6 @@ class RTPSenderVideo {
const RTPFragmentationHeader* fragmentation,
const RTPVideoHeader* video_header);
int32_t SendRTPIntraRequest();
void SetVideoCodecType(RtpVideoCodecTypes type);
// ULPFEC.
@ -105,11 +103,10 @@ class RTPSenderVideo {
// 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_);