Make SendStatisticsProxy outlive ViEChannel.

Prevents data race on stats_proxy_ on VideoSendStream destruction.

BUG=
TBR=mflodman@webrtc.org

Review URL: https://codereview.webrtc.org/1409133006 .

Cr-Commit-Position: refs/heads/master@{#10493}
This commit is contained in:
Peter Boström 2015-11-03 13:53:06 +01:00
parent 1ba936a807
commit 373284da06
2 changed files with 5 additions and 5 deletions

View File

@ -117,7 +117,8 @@ VideoSendStream::VideoSendStream(
const VideoSendStream::Config& config,
const VideoEncoderConfig& encoder_config,
const std::map<uint32_t, RtpState>& suspended_ssrcs)
: transport_adapter_(config.send_transport),
: stats_proxy_(Clock::GetRealTimeClock(), config),
transport_adapter_(config.send_transport),
encoded_frame_proxy_(config.post_encode_callback),
config_(config),
suspended_ssrcs_(suspended_ssrcs),
@ -125,8 +126,7 @@ VideoSendStream::VideoSendStream(
call_stats_(call_stats),
congestion_controller_(congestion_controller),
encoder_feedback_(new EncoderStateFeedback()),
use_config_bitrate_(true),
stats_proxy_(Clock::GetRealTimeClock(), config) {
use_config_bitrate_(true) {
LOG(LS_INFO) << "VideoSendStream: " << config_.ToString();
RTC_DCHECK(!config_.rtp.ssrcs.empty());

View File

@ -72,6 +72,8 @@ class VideoSendStream : public webrtc::VideoSendStream,
private:
bool SetSendCodec(VideoCodec video_codec);
void ConfigureSsrcs();
SendStatisticsProxy stats_proxy_;
TransportAdapter transport_adapter_;
EncodedFrameCallbackAdapter encoded_frame_proxy_;
const VideoSendStream::Config config_;
@ -91,8 +93,6 @@ class VideoSendStream : public webrtc::VideoSendStream,
// start bitrate initially, instead of the one reported by VideoEngine (which
// defaults to too high).
bool use_config_bitrate_;
SendStatisticsProxy stats_proxy_;
};
} // namespace internal
} // namespace webrtc