| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 10 matching lines...) Expand all Loading... |
| 21 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 21 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
| 22 #include "webrtc/frame_callback.h" | 22 #include "webrtc/frame_callback.h" |
| 23 #include "webrtc/modules/pacing/paced_sender.h" | 23 #include "webrtc/modules/pacing/paced_sender.h" |
| 24 #include "webrtc/modules/pacing/packet_router.h" | 24 #include "webrtc/modules/pacing/packet_router.h" |
| 25 #include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h" | 25 #include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h" |
| 26 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | 26 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |
| 27 #include "webrtc/modules/utility/include/process_thread.h" | 27 #include "webrtc/modules/utility/include/process_thread.h" |
| 28 #include "webrtc/modules/video_coding/include/video_coding.h" | 28 #include "webrtc/modules/video_coding/include/video_coding.h" |
| 29 #include "webrtc/modules/video_processing/include/video_processing.h" | 29 #include "webrtc/modules/video_processing/include/video_processing.h" |
| 30 #include "webrtc/modules/video_render/video_render_defines.h" | 30 #include "webrtc/modules/video_render/video_render_defines.h" |
| 31 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | |
| 32 #include "webrtc/system_wrappers/include/metrics.h" | 31 #include "webrtc/system_wrappers/include/metrics.h" |
| 33 #include "webrtc/video/call_stats.h" | 32 #include "webrtc/video/call_stats.h" |
| 34 #include "webrtc/video/payload_router.h" | 33 #include "webrtc/video/payload_router.h" |
| 35 #include "webrtc/video/receive_statistics_proxy.h" | 34 #include "webrtc/video/receive_statistics_proxy.h" |
| 36 #include "webrtc/video/report_block_stats.h" | 35 #include "webrtc/video/report_block_stats.h" |
| 37 | 36 |
| 38 namespace webrtc { | 37 namespace webrtc { |
| 39 | 38 |
| 40 const int kMaxDecodeWaitTimeMs = 50; | 39 const int kMaxDecodeWaitTimeMs = 50; |
| 41 static const int kMaxTargetDelayMs = 10000; | 40 static const int kMaxTargetDelayMs = 10000; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 TransportFeedbackObserver* transport_feedback_observer, | 85 TransportFeedbackObserver* transport_feedback_observer, |
| 87 RemoteBitrateEstimator* remote_bitrate_estimator, | 86 RemoteBitrateEstimator* remote_bitrate_estimator, |
| 88 RtcpRttStats* rtt_stats, | 87 RtcpRttStats* rtt_stats, |
| 89 PacedSender* paced_sender, | 88 PacedSender* paced_sender, |
| 90 PacketRouter* packet_router, | 89 PacketRouter* packet_router, |
| 91 size_t max_rtp_streams, | 90 size_t max_rtp_streams, |
| 92 bool sender) | 91 bool sender) |
| 93 : number_of_cores_(number_of_cores), | 92 : number_of_cores_(number_of_cores), |
| 94 sender_(sender), | 93 sender_(sender), |
| 95 module_process_thread_(module_process_thread), | 94 module_process_thread_(module_process_thread), |
| 96 crit_(CriticalSectionWrapper::CreateCriticalSection()), | |
| 97 send_payload_router_(new PayloadRouter()), | 95 send_payload_router_(new PayloadRouter()), |
| 98 vcm_protection_callback_(new ViEChannelProtectionCallback(this)), | 96 vcm_protection_callback_(new ViEChannelProtectionCallback(this)), |
| 99 vcm_(VideoCodingModule::Create(Clock::GetRealTimeClock(), | 97 vcm_(VideoCodingModule::Create(Clock::GetRealTimeClock(), |
| 100 nullptr, | 98 nullptr, |
| 101 nullptr)), | 99 nullptr)), |
| 102 vie_receiver_(vcm_, remote_bitrate_estimator, this), | 100 vie_receiver_(vcm_, remote_bitrate_estimator, this), |
| 103 vie_sync_(vcm_), | 101 vie_sync_(vcm_), |
| 104 stats_observer_(new ChannelStatsObserver(this)), | 102 stats_observer_(new ChannelStatsObserver(this)), |
| 105 receive_stats_callback_(nullptr), | 103 receive_stats_callback_(nullptr), |
| 106 incoming_video_stream_(nullptr), | 104 incoming_video_stream_(nullptr), |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 if (!sender_) | 187 if (!sender_) |
| 190 StopDecodeThread(); | 188 StopDecodeThread(); |
| 191 // Release modules. | 189 // Release modules. |
| 192 VideoCodingModule::Destroy(vcm_); | 190 VideoCodingModule::Destroy(vcm_); |
| 193 } | 191 } |
| 194 | 192 |
| 195 void ViEChannel::UpdateHistograms() { | 193 void ViEChannel::UpdateHistograms() { |
| 196 int64_t now = Clock::GetRealTimeClock()->TimeInMilliseconds(); | 194 int64_t now = Clock::GetRealTimeClock()->TimeInMilliseconds(); |
| 197 | 195 |
| 198 { | 196 { |
| 199 CriticalSectionScoped cs(crit_.get()); | 197 rtc::CritScope lock(&crit_); |
| 200 int64_t elapsed_sec = (now - time_of_first_rtt_ms_) / 1000; | 198 int64_t elapsed_sec = (now - time_of_first_rtt_ms_) / 1000; |
| 201 if (time_of_first_rtt_ms_ != -1 && num_rtts_ > 0 && | 199 if (time_of_first_rtt_ms_ != -1 && num_rtts_ > 0 && |
| 202 elapsed_sec > metrics::kMinRunTimeInSeconds) { | 200 elapsed_sec > metrics::kMinRunTimeInSeconds) { |
| 203 int64_t avg_rtt_ms = (rtt_sum_ms_ + num_rtts_ / 2) / num_rtts_; | 201 int64_t avg_rtt_ms = (rtt_sum_ms_ + num_rtts_ / 2) / num_rtts_; |
| 204 RTC_HISTOGRAM_COUNTS_SPARSE_10000( | 202 RTC_HISTOGRAM_COUNTS_SPARSE_10000( |
| 205 "WebRTC.Video.AverageRoundTripTimeInMilliseconds", avg_rtt_ms); | 203 "WebRTC.Video.AverageRoundTripTimeInMilliseconds", avg_rtt_ms); |
| 206 } | 204 } |
| 207 } | 205 } |
| 208 | 206 |
| 209 if (sender_) { | 207 if (sender_) { |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 send_payload_router_->SetSendingRtpModules(std::list<RtpRtcp*>()); | 358 send_payload_router_->SetSendingRtpModules(std::list<RtpRtcp*>()); |
| 361 | 359 |
| 362 std::vector<RtpRtcp*> registered_modules; | 360 std::vector<RtpRtcp*> registered_modules; |
| 363 std::vector<RtpRtcp*> deregistered_modules; | 361 std::vector<RtpRtcp*> deregistered_modules; |
| 364 size_t num_active_modules = video_codec.numberOfSimulcastStreams > 0 | 362 size_t num_active_modules = video_codec.numberOfSimulcastStreams > 0 |
| 365 ? video_codec.numberOfSimulcastStreams | 363 ? video_codec.numberOfSimulcastStreams |
| 366 : 1; | 364 : 1; |
| 367 size_t num_prev_active_modules; | 365 size_t num_prev_active_modules; |
| 368 { | 366 { |
| 369 // Cache which modules are active so StartSend can know which ones to start. | 367 // Cache which modules are active so StartSend can know which ones to start. |
| 370 CriticalSectionScoped cs(crit_.get()); | 368 rtc::CritScope lock(&crit_); |
| 371 num_prev_active_modules = num_active_rtp_rtcp_modules_; | 369 num_prev_active_modules = num_active_rtp_rtcp_modules_; |
| 372 num_active_rtp_rtcp_modules_ = num_active_modules; | 370 num_active_rtp_rtcp_modules_ = num_active_modules; |
| 373 } | 371 } |
| 374 for (size_t i = 0; i < num_active_modules; ++i) | 372 for (size_t i = 0; i < num_active_modules; ++i) |
| 375 registered_modules.push_back(rtp_rtcp_modules_[i]); | 373 registered_modules.push_back(rtp_rtcp_modules_[i]); |
| 376 | 374 |
| 377 for (size_t i = num_active_modules; i < rtp_rtcp_modules_.size(); ++i) | 375 for (size_t i = num_active_modules; i < rtp_rtcp_modules_.size(); ++i) |
| 378 deregistered_modules.push_back(rtp_rtcp_modules_[i]); | 376 deregistered_modules.push_back(rtp_rtcp_modules_[i]); |
| 379 | 377 |
| 380 // Disable inactive modules. | 378 // Disable inactive modules. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 } | 437 } |
| 440 | 438 |
| 441 void ViEChannel::RegisterExternalDecoder(const uint8_t pl_type, | 439 void ViEChannel::RegisterExternalDecoder(const uint8_t pl_type, |
| 442 VideoDecoder* decoder) { | 440 VideoDecoder* decoder) { |
| 443 RTC_DCHECK(!sender_); | 441 RTC_DCHECK(!sender_); |
| 444 vcm_->RegisterExternalDecoder(decoder, pl_type); | 442 vcm_->RegisterExternalDecoder(decoder, pl_type); |
| 445 } | 443 } |
| 446 | 444 |
| 447 int32_t ViEChannel::ReceiveCodecStatistics(uint32_t* num_key_frames, | 445 int32_t ViEChannel::ReceiveCodecStatistics(uint32_t* num_key_frames, |
| 448 uint32_t* num_delta_frames) { | 446 uint32_t* num_delta_frames) { |
| 449 CriticalSectionScoped cs(crit_.get()); | 447 rtc::CritScope lock(&crit_); |
| 450 *num_key_frames = receive_frame_counts_.key_frames; | 448 *num_key_frames = receive_frame_counts_.key_frames; |
| 451 *num_delta_frames = receive_frame_counts_.delta_frames; | 449 *num_delta_frames = receive_frame_counts_.delta_frames; |
| 452 return 0; | 450 return 0; |
| 453 } | 451 } |
| 454 | 452 |
| 455 uint32_t ViEChannel::DiscardedPackets() const { | 453 uint32_t ViEChannel::DiscardedPackets() const { |
| 456 return vcm_->DiscardedPackets(); | 454 return vcm_->DiscardedPackets(); |
| 457 } | 455 } |
| 458 | 456 |
| 459 int ViEChannel::ReceiveDelay() const { | 457 int ViEChannel::ReceiveDelay() const { |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 SendSideDelayObserver* observer) { | 875 SendSideDelayObserver* observer) { |
| 878 send_side_delay_observer_.Set(observer); | 876 send_side_delay_observer_.Set(observer); |
| 879 } | 877 } |
| 880 | 878 |
| 881 void ViEChannel::RegisterSendBitrateObserver( | 879 void ViEChannel::RegisterSendBitrateObserver( |
| 882 BitrateStatisticsObserver* observer) { | 880 BitrateStatisticsObserver* observer) { |
| 883 send_bitrate_observer_.Set(observer); | 881 send_bitrate_observer_.Set(observer); |
| 884 } | 882 } |
| 885 | 883 |
| 886 int32_t ViEChannel::StartSend() { | 884 int32_t ViEChannel::StartSend() { |
| 887 CriticalSectionScoped cs(crit_.get()); | 885 rtc::CritScope lock(&crit_); |
| 888 | 886 |
| 889 if (rtp_rtcp_modules_[0]->Sending()) | 887 if (rtp_rtcp_modules_[0]->Sending()) |
| 890 return -1; | 888 return -1; |
| 891 | 889 |
| 892 for (size_t i = 0; i < num_active_rtp_rtcp_modules_; ++i) { | 890 for (size_t i = 0; i < num_active_rtp_rtcp_modules_; ++i) { |
| 893 RtpRtcp* rtp_rtcp = rtp_rtcp_modules_[i]; | 891 RtpRtcp* rtp_rtcp = rtp_rtcp_modules_[i]; |
| 894 rtp_rtcp->SetSendingMediaStatus(true); | 892 rtp_rtcp->SetSendingMediaStatus(true); |
| 895 rtp_rtcp->SetSendingStatus(true); | 893 rtp_rtcp->SetSendingStatus(true); |
| 896 } | 894 } |
| 897 send_payload_router_->set_active(true); | 895 send_payload_router_->set_active(true); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 | 961 |
| 964 CallStatsObserver* ViEChannel::GetStatsObserver() { | 962 CallStatsObserver* ViEChannel::GetStatsObserver() { |
| 965 return stats_observer_.get(); | 963 return stats_observer_.get(); |
| 966 } | 964 } |
| 967 | 965 |
| 968 // Do not acquire the lock of |vcm_| in this function. Decode callback won't | 966 // Do not acquire the lock of |vcm_| in this function. Decode callback won't |
| 969 // necessarily be called from the decoding thread. The decoding thread may have | 967 // necessarily be called from the decoding thread. The decoding thread may have |
| 970 // held the lock when calling VideoDecoder::Decode, Reset, or Release. Acquiring | 968 // held the lock when calling VideoDecoder::Decode, Reset, or Release. Acquiring |
| 971 // the same lock in the path of decode callback can deadlock. | 969 // the same lock in the path of decode callback can deadlock. |
| 972 int32_t ViEChannel::FrameToRender(VideoFrame& video_frame) { // NOLINT | 970 int32_t ViEChannel::FrameToRender(VideoFrame& video_frame) { // NOLINT |
| 973 CriticalSectionScoped cs(crit_.get()); | 971 rtc::CritScope lock(&crit_); |
| 974 | 972 |
| 975 if (pre_render_callback_ != NULL) | 973 if (pre_render_callback_ != NULL) |
| 976 pre_render_callback_->FrameCallback(&video_frame); | 974 pre_render_callback_->FrameCallback(&video_frame); |
| 977 | 975 |
| 978 // TODO(pbos): Remove stream id argument. | 976 // TODO(pbos): Remove stream id argument. |
| 979 incoming_video_stream_->RenderFrame(0xFFFFFFFF, video_frame); | 977 incoming_video_stream_->RenderFrame(0xFFFFFFFF, video_frame); |
| 980 return 0; | 978 return 0; |
| 981 } | 979 } |
| 982 | 980 |
| 983 int32_t ViEChannel::ReceivedDecodedReferenceFrame( | 981 int32_t ViEChannel::ReceivedDecodedReferenceFrame( |
| 984 const uint64_t picture_id) { | 982 const uint64_t picture_id) { |
| 985 return rtp_rtcp_modules_[0]->SendRTCPReferencePictureSelection(picture_id); | 983 return rtp_rtcp_modules_[0]->SendRTCPReferencePictureSelection(picture_id); |
| 986 } | 984 } |
| 987 | 985 |
| 988 void ViEChannel::OnIncomingPayloadType(int payload_type) { | 986 void ViEChannel::OnIncomingPayloadType(int payload_type) { |
| 989 CriticalSectionScoped cs(crit_.get()); | 987 rtc::CritScope lock(&crit_); |
| 990 if (receive_stats_callback_) | 988 if (receive_stats_callback_) |
| 991 receive_stats_callback_->OnIncomingPayloadType(payload_type); | 989 receive_stats_callback_->OnIncomingPayloadType(payload_type); |
| 992 } | 990 } |
| 993 | 991 |
| 994 void ViEChannel::OnDecoderImplementationName(const char* implementation_name) { | 992 void ViEChannel::OnDecoderImplementationName(const char* implementation_name) { |
| 995 CriticalSectionScoped cs(crit_.get()); | 993 rtc::CritScope lock(&crit_); |
| 996 if (receive_stats_callback_) | 994 if (receive_stats_callback_) |
| 997 receive_stats_callback_->OnDecoderImplementationName(implementation_name); | 995 receive_stats_callback_->OnDecoderImplementationName(implementation_name); |
| 998 } | 996 } |
| 999 | 997 |
| 1000 void ViEChannel::OnReceiveRatesUpdated(uint32_t bit_rate, uint32_t frame_rate) { | 998 void ViEChannel::OnReceiveRatesUpdated(uint32_t bit_rate, uint32_t frame_rate) { |
| 1001 CriticalSectionScoped cs(crit_.get()); | 999 rtc::CritScope lock(&crit_); |
| 1002 if (receive_stats_callback_) | 1000 if (receive_stats_callback_) |
| 1003 receive_stats_callback_->OnIncomingRate(frame_rate, bit_rate); | 1001 receive_stats_callback_->OnIncomingRate(frame_rate, bit_rate); |
| 1004 } | 1002 } |
| 1005 | 1003 |
| 1006 void ViEChannel::OnDiscardedPacketsUpdated(int discarded_packets) { | 1004 void ViEChannel::OnDiscardedPacketsUpdated(int discarded_packets) { |
| 1007 CriticalSectionScoped cs(crit_.get()); | 1005 rtc::CritScope lock(&crit_); |
| 1008 if (receive_stats_callback_) | 1006 if (receive_stats_callback_) |
| 1009 receive_stats_callback_->OnDiscardedPacketsUpdated(discarded_packets); | 1007 receive_stats_callback_->OnDiscardedPacketsUpdated(discarded_packets); |
| 1010 } | 1008 } |
| 1011 | 1009 |
| 1012 void ViEChannel::OnFrameCountsUpdated(const FrameCounts& frame_counts) { | 1010 void ViEChannel::OnFrameCountsUpdated(const FrameCounts& frame_counts) { |
| 1013 CriticalSectionScoped cs(crit_.get()); | 1011 rtc::CritScope lock(&crit_); |
| 1014 receive_frame_counts_ = frame_counts; | 1012 receive_frame_counts_ = frame_counts; |
| 1015 if (receive_stats_callback_) | 1013 if (receive_stats_callback_) |
| 1016 receive_stats_callback_->OnFrameCountsUpdated(frame_counts); | 1014 receive_stats_callback_->OnFrameCountsUpdated(frame_counts); |
| 1017 } | 1015 } |
| 1018 | 1016 |
| 1019 void ViEChannel::OnDecoderTiming(int decode_ms, | 1017 void ViEChannel::OnDecoderTiming(int decode_ms, |
| 1020 int max_decode_ms, | 1018 int max_decode_ms, |
| 1021 int current_delay_ms, | 1019 int current_delay_ms, |
| 1022 int target_delay_ms, | 1020 int target_delay_ms, |
| 1023 int jitter_buffer_ms, | 1021 int jitter_buffer_ms, |
| 1024 int min_playout_delay_ms, | 1022 int min_playout_delay_ms, |
| 1025 int render_delay_ms) { | 1023 int render_delay_ms) { |
| 1026 CriticalSectionScoped cs(crit_.get()); | 1024 rtc::CritScope lock(&crit_); |
| 1027 if (!receive_stats_callback_) | 1025 if (!receive_stats_callback_) |
| 1028 return; | 1026 return; |
| 1029 receive_stats_callback_->OnDecoderTiming( | 1027 receive_stats_callback_->OnDecoderTiming( |
| 1030 decode_ms, max_decode_ms, current_delay_ms, target_delay_ms, | 1028 decode_ms, max_decode_ms, current_delay_ms, target_delay_ms, |
| 1031 jitter_buffer_ms, min_playout_delay_ms, render_delay_ms, last_rtt_ms_); | 1029 jitter_buffer_ms, min_playout_delay_ms, render_delay_ms, last_rtt_ms_); |
| 1032 } | 1030 } |
| 1033 | 1031 |
| 1034 int32_t ViEChannel::RequestKeyFrame() { | 1032 int32_t ViEChannel::RequestKeyFrame() { |
| 1035 return rtp_rtcp_modules_[0]->RequestKeyFrame(); | 1033 return rtp_rtcp_modules_[0]->RequestKeyFrame(); |
| 1036 } | 1034 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1051 } | 1049 } |
| 1052 | 1050 |
| 1053 bool ViEChannel::ChannelDecodeProcess() { | 1051 bool ViEChannel::ChannelDecodeProcess() { |
| 1054 vcm_->Decode(kMaxDecodeWaitTimeMs); | 1052 vcm_->Decode(kMaxDecodeWaitTimeMs); |
| 1055 return true; | 1053 return true; |
| 1056 } | 1054 } |
| 1057 | 1055 |
| 1058 void ViEChannel::OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) { | 1056 void ViEChannel::OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) { |
| 1059 vcm_->SetReceiveChannelParameters(max_rtt_ms); | 1057 vcm_->SetReceiveChannelParameters(max_rtt_ms); |
| 1060 | 1058 |
| 1061 CriticalSectionScoped cs(crit_.get()); | 1059 rtc::CritScope lock(&crit_); |
| 1062 if (time_of_first_rtt_ms_ == -1) | 1060 if (time_of_first_rtt_ms_ == -1) |
| 1063 time_of_first_rtt_ms_ = Clock::GetRealTimeClock()->TimeInMilliseconds(); | 1061 time_of_first_rtt_ms_ = Clock::GetRealTimeClock()->TimeInMilliseconds(); |
| 1064 rtt_sum_ms_ += avg_rtt_ms; | 1062 rtt_sum_ms_ += avg_rtt_ms; |
| 1065 last_rtt_ms_ = avg_rtt_ms; | 1063 last_rtt_ms_ = avg_rtt_ms; |
| 1066 ++num_rtts_; | 1064 ++num_rtts_; |
| 1067 } | 1065 } |
| 1068 | 1066 |
| 1069 int ViEChannel::ProtectionRequest(const FecProtectionParams* delta_fec_params, | 1067 int ViEChannel::ProtectionRequest(const FecProtectionParams* delta_fec_params, |
| 1070 const FecProtectionParams* key_fec_params, | 1068 const FecProtectionParams* key_fec_params, |
| 1071 uint32_t* video_rate_bps, | 1069 uint32_t* video_rate_bps, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 rtp_rtcp_modules_[0], | 1159 rtp_rtcp_modules_[0], |
| 1162 vie_receiver_.GetRtpReceiver()); | 1160 vie_receiver_.GetRtpReceiver()); |
| 1163 } | 1161 } |
| 1164 | 1162 |
| 1165 int32_t ViEChannel::VoiceChannel() { | 1163 int32_t ViEChannel::VoiceChannel() { |
| 1166 return vie_sync_.VoiceChannel(); | 1164 return vie_sync_.VoiceChannel(); |
| 1167 } | 1165 } |
| 1168 | 1166 |
| 1169 void ViEChannel::RegisterPreRenderCallback( | 1167 void ViEChannel::RegisterPreRenderCallback( |
| 1170 I420FrameCallback* pre_render_callback) { | 1168 I420FrameCallback* pre_render_callback) { |
| 1171 CriticalSectionScoped cs(crit_.get()); | 1169 rtc::CritScope lock(&crit_); |
| 1172 pre_render_callback_ = pre_render_callback; | 1170 pre_render_callback_ = pre_render_callback; |
| 1173 } | 1171 } |
| 1174 | 1172 |
| 1175 void ViEChannel::RegisterPreDecodeImageCallback( | 1173 void ViEChannel::RegisterPreDecodeImageCallback( |
| 1176 EncodedImageCallback* pre_decode_callback) { | 1174 EncodedImageCallback* pre_decode_callback) { |
| 1177 vcm_->RegisterPreDecodeImageCallback(pre_decode_callback); | 1175 vcm_->RegisterPreDecodeImageCallback(pre_decode_callback); |
| 1178 } | 1176 } |
| 1179 | 1177 |
| 1180 // TODO(pbos): Remove OnInitializeDecoder which is called from the RTP module, | 1178 // TODO(pbos): Remove OnInitializeDecoder which is called from the RTP module, |
| 1181 // any decoder resetting should be handled internally within the VCM. | 1179 // any decoder resetting should be handled internally within the VCM. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1198 | 1196 |
| 1199 void ViEChannel::OnIncomingCSRCChanged(const uint32_t CSRC, const bool added) {} | 1197 void ViEChannel::OnIncomingCSRCChanged(const uint32_t CSRC, const bool added) {} |
| 1200 | 1198 |
| 1201 void ViEChannel::RegisterSendFrameCountObserver( | 1199 void ViEChannel::RegisterSendFrameCountObserver( |
| 1202 FrameCountObserver* observer) { | 1200 FrameCountObserver* observer) { |
| 1203 send_frame_count_observer_.Set(observer); | 1201 send_frame_count_observer_.Set(observer); |
| 1204 } | 1202 } |
| 1205 | 1203 |
| 1206 void ViEChannel::RegisterReceiveStatisticsProxy( | 1204 void ViEChannel::RegisterReceiveStatisticsProxy( |
| 1207 ReceiveStatisticsProxy* receive_statistics_proxy) { | 1205 ReceiveStatisticsProxy* receive_statistics_proxy) { |
| 1208 CriticalSectionScoped cs(crit_.get()); | 1206 rtc::CritScope lock(&crit_); |
| 1209 receive_stats_callback_ = receive_statistics_proxy; | 1207 receive_stats_callback_ = receive_statistics_proxy; |
| 1210 } | 1208 } |
| 1211 | 1209 |
| 1212 void ViEChannel::SetIncomingVideoStream( | 1210 void ViEChannel::SetIncomingVideoStream( |
| 1213 IncomingVideoStream* incoming_video_stream) { | 1211 IncomingVideoStream* incoming_video_stream) { |
| 1214 CriticalSectionScoped cs(crit_.get()); | 1212 rtc::CritScope lock(&crit_); |
| 1215 incoming_video_stream_ = incoming_video_stream; | 1213 incoming_video_stream_ = incoming_video_stream; |
| 1216 } | 1214 } |
| 1217 } // namespace webrtc | 1215 } // namespace webrtc |
| OLD | NEW |