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

Side by Side Diff: webrtc/video/video_send_stream.cc

Issue 1913073002: Extract common simulcast logic from VP8 wrapper and simulcast adapter (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address comments, added tests Created 4 years, 7 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
11 #include "webrtc/video/video_send_stream.h" 11 #include "webrtc/video/video_send_stream.h"
12 12
13 #include <algorithm> 13 #include <algorithm>
14 #include <sstream> 14 #include <sstream>
15 #include <string> 15 #include <string>
16 #include <vector> 16 #include <vector>
17 17
18 #include "webrtc/base/checks.h" 18 #include "webrtc/base/checks.h"
19 #include "webrtc/base/logging.h" 19 #include "webrtc/base/logging.h"
20 #include "webrtc/base/trace_event.h" 20 #include "webrtc/base/trace_event.h"
21 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" 21 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
22 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" 22 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h"
23 #include "webrtc/modules/congestion_controller/include/congestion_controller.h" 23 #include "webrtc/modules/congestion_controller/include/congestion_controller.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_rtcp.h" 25 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h"
26 #include "webrtc/modules/video_coding/utility/simulcast_state.h"
26 #include "webrtc/modules/utility/include/process_thread.h" 27 #include "webrtc/modules/utility/include/process_thread.h"
27 #include "webrtc/video/call_stats.h" 28 #include "webrtc/video/call_stats.h"
28 #include "webrtc/video/video_capture_input.h" 29 #include "webrtc/video/video_capture_input.h"
29 #include "webrtc/video/vie_remb.h" 30 #include "webrtc/video/vie_remb.h"
30 #include "webrtc/video_send_stream.h" 31 #include "webrtc/video_send_stream.h"
31 32
32 namespace webrtc { 33 namespace webrtc {
33 34
34 class RtcpIntraFrameObserver; 35 class RtcpIntraFrameObserver;
35 class TransportFeedbackObserver; 36 class TransportFeedbackObserver;
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 LOG(LS_INFO) << "(Re)configureVideoEncoder: " << config.ToString(); 598 LOG(LS_INFO) << "(Re)configureVideoEncoder: " << config.ToString();
598 RTC_DCHECK_GE(config_.rtp.ssrcs.size(), config.streams.size()); 599 RTC_DCHECK_GE(config_.rtp.ssrcs.size(), config.streams.size());
599 VideoCodec video_codec = VideoEncoderConfigToVideoCodec( 600 VideoCodec video_codec = VideoEncoderConfigToVideoCodec(
600 config, config_.encoder_settings.payload_name, 601 config, config_.encoder_settings.payload_name,
601 config_.encoder_settings.payload_type); 602 config_.encoder_settings.payload_type);
602 { 603 {
603 rtc::CritScope lock(&encoder_settings_crit_); 604 rtc::CritScope lock(&encoder_settings_crit_);
604 pending_encoder_settings_ = rtc::Optional<EncoderSettings>( 605 pending_encoder_settings_ = rtc::Optional<EncoderSettings>(
605 {video_codec, config.min_transmit_bitrate_bps, config.streams}); 606 {video_codec, config.min_transmit_bitrate_bps, config.streams});
606 } 607 }
608 payload_router_.UpdateSimulcastState(SimulcastState(video_codec));
607 encoder_wakeup_event_.Set(); 609 encoder_wakeup_event_.Set();
608 } 610 }
609 611
610 VideoSendStream::Stats VideoSendStream::GetStats() { 612 VideoSendStream::Stats VideoSendStream::GetStats() {
611 return stats_proxy_.GetStats(); 613 return stats_proxy_.GetStats();
612 } 614 }
613 615
614 void VideoSendStream::OveruseDetected() { 616 void VideoSendStream::OveruseDetected() {
615 if (config_.overuse_callback) 617 if (config_.overuse_callback)
616 config_.overuse_callback->OnLoadUpdate(LoadObserver::kOveruse); 618 config_.overuse_callback->OnLoadUpdate(LoadObserver::kOveruse);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 &module_nack_rate); 776 &module_nack_rate);
775 *sent_video_rate_bps += module_video_rate; 777 *sent_video_rate_bps += module_video_rate;
776 *sent_nack_rate_bps += module_nack_rate; 778 *sent_nack_rate_bps += module_nack_rate;
777 *sent_fec_rate_bps += module_fec_rate; 779 *sent_fec_rate_bps += module_fec_rate;
778 } 780 }
779 return 0; 781 return 0;
780 } 782 }
781 783
782 } // namespace internal 784 } // namespace internal
783 } // namespace webrtc 785 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698