Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: webrtc/call/call.cc

Issue 2967913002: Get rid of unnecessary cast of FlexfecReceiveStreamImpl to FlexfecReceiveStream (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 // TODO(brandtr): Store config in RtcEventLog here. 855 // TODO(brandtr): Store config in RtcEventLog here.
856 856
857 return receive_stream; 857 return receive_stream;
858 } 858 }
859 859
860 void Call::DestroyFlexfecReceiveStream(FlexfecReceiveStream* receive_stream) { 860 void Call::DestroyFlexfecReceiveStream(FlexfecReceiveStream* receive_stream) {
861 TRACE_EVENT0("webrtc", "Call::DestroyFlexfecReceiveStream"); 861 TRACE_EVENT0("webrtc", "Call::DestroyFlexfecReceiveStream");
862 RTC_DCHECK_RUN_ON(&configuration_thread_checker_); 862 RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
863 863
864 RTC_DCHECK(receive_stream != nullptr); 864 RTC_DCHECK(receive_stream != nullptr);
865 // There exist no other derived classes of FlexfecReceiveStream,
866 // so this downcast is safe.
867 FlexfecReceiveStreamImpl* receive_stream_impl =
868 static_cast<FlexfecReceiveStreamImpl*>(receive_stream);
869 { 865 {
870 WriteLockScoped write_lock(*receive_crit_); 866 WriteLockScoped write_lock(*receive_crit_);
871 867
872 const FlexfecReceiveStream::Config& config = 868 const FlexfecReceiveStream::Config& config = receive_stream->GetConfig();
873 receive_stream_impl->GetConfig();
874 uint32_t ssrc = config.remote_ssrc; 869 uint32_t ssrc = config.remote_ssrc;
875 receive_rtp_config_.erase(ssrc); 870 receive_rtp_config_.erase(ssrc);
876 871
877 // Remove all SSRCs pointing to the FlexfecReceiveStreamImpl to be 872 // Remove all SSRCs pointing to the FlexfecReceiveStreamImpl to be
878 // destroyed. 873 // destroyed.
879 receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config)) 874 receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config))
880 ->RemoveStream(ssrc); 875 ->RemoveStream(ssrc);
881 } 876 }
882 877
883 delete receive_stream_impl; 878 delete receive_stream;
884 } 879 }
885 880
886 Call::Stats Call::GetStats() const { 881 Call::Stats Call::GetStats() const {
887 // TODO(solenberg): Some test cases in EndToEndTest use this from a different 882 // TODO(solenberg): Some test cases in EndToEndTest use this from a different
888 // thread. Re-enable once that is fixed. 883 // thread. Re-enable once that is fixed.
889 // RTC_DCHECK_RUN_ON(&configuration_thread_checker_); 884 // RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
890 Stats stats; 885 Stats stats;
891 // Fetch available send/receive bitrates. 886 // Fetch available send/receive bitrates.
892 uint32_t send_bandwidth = 0; 887 uint32_t send_bandwidth = 0;
893 transport_send_->send_side_cc()->GetBitrateController()->AvailableBandwidth( 888 transport_send_->send_side_cc()->GetBitrateController()->AvailableBandwidth(
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { 1378 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) {
1384 receive_side_cc_.OnReceivedPacket( 1379 receive_side_cc_.OnReceivedPacket(
1385 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), 1380 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(),
1386 header); 1381 header);
1387 } 1382 }
1388 } 1383 }
1389 1384
1390 } // namespace internal 1385 } // namespace internal
1391 1386
1392 } // namespace webrtc 1387 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/call/flexfec_receive_stream.h » ('j') | webrtc/call/flexfec_receive_stream_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698