 Chromium Code Reviews
 Chromium Code Reviews Issue 2887733002:
  Store/restore RTP state for audio streams with same SSRC within a call  (Closed)
    
  
    Issue 2887733002:
  Store/restore RTP state for audio streams with same SSRC within a call  (Closed) 
  | Index: webrtc/call/call.cc | 
| diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc | 
| index d178406b2972307b3d77998ebaa303b31c1aef35..22f5af36d2965c8aca40333518a8ba4286a66d6d 100644 | 
| --- a/webrtc/call/call.cc | 
| +++ b/webrtc/call/call.cc | 
| @@ -251,7 +251,10 @@ class Call : public webrtc::Call, | 
| std::map<uint32_t, VideoSendStream*> video_send_ssrcs_ GUARDED_BY(send_crit_); | 
| std::set<VideoSendStream*> video_send_streams_ GUARDED_BY(send_crit_); | 
| - VideoSendStream::RtpStateMap suspended_video_send_ssrcs_; | 
| 
pbos-webrtc
2017/05/22 15:40:18
Does this mean that there's some VideoSendStream::
 
ossu
2017/05/22 17:13:59
I chose to let RtpStateMap be a shorthand for std:
 | 
| + typedef std::map<uint32_t, RtpState> RtpStateMap; | 
| 
kwiberg-webrtc
2017/05/19 01:05:09
using?
 
ossu
2017/05/22 17:13:59
Alright!
 | 
| + RtpStateMap suspended_audio_send_ssrcs_; | 
| 
pbos-webrtc
2017/05/22 15:39:50
Can you do GUARDED_BY (configuration_thread_checke
 
ossu
2017/05/22 17:13:59
Alright!
 | 
| + RtpStateMap suspended_video_send_ssrcs_; | 
| + | 
| webrtc::RtcEventLog* event_log_; | 
| // The following members are only accessed (exclusively) from one thread and | 
| @@ -509,9 +512,19 @@ webrtc::AudioSendStream* Call::CreateAudioSendStream( | 
| TRACE_EVENT0("webrtc", "Call::CreateAudioSendStream"); | 
| RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 
| event_log_->LogAudioSendStreamConfig(config); | 
| + | 
| + rtc::Optional<RtpState> suspended_rtp_state; | 
| + { | 
| + const auto& iter = suspended_audio_send_ssrcs_.find(config.rtp.ssrc); | 
| + if (iter != suspended_audio_send_ssrcs_.end()) { | 
| + suspended_rtp_state.emplace(iter->second); | 
| + } | 
| + } | 
| + | 
| AudioSendStream* send_stream = new AudioSendStream( | 
| config, config_.audio_state, &worker_queue_, transport_send_.get(), | 
| - bitrate_allocator_.get(), event_log_, call_stats_->rtcp_rtt_stats()); | 
| + bitrate_allocator_.get(), event_log_, call_stats_->rtcp_rtt_stats(), | 
| + suspended_rtp_state); | 
| { | 
| WriteLockScoped write_lock(*send_crit_); | 
| RTC_DCHECK(audio_send_ssrcs_.find(config.rtp.ssrc) == | 
| @@ -540,7 +553,8 @@ void Call::DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) { | 
| webrtc::internal::AudioSendStream* audio_send_stream = | 
| static_cast<webrtc::internal::AudioSendStream*>(send_stream); | 
| - uint32_t ssrc = audio_send_stream->config().rtp.ssrc; | 
| + const uint32_t ssrc = audio_send_stream->config().rtp.ssrc; | 
| + suspended_audio_send_ssrcs_[ssrc] = audio_send_stream->GetRtpState(); | 
| { | 
| WriteLockScoped write_lock(*send_crit_); | 
| size_t num_deleted = audio_send_ssrcs_.erase(ssrc); |