Move congestion controller to a separate module.

This allows other projects to more easily depend on this.

The plan is to move remote_bitrate_estimator and bitrate_controller into this module and reduce the exposed interface to only a simplified version of congestion_controller.h.

No functional changes in this CL.

R=mflodman@webrtc.org, pbos@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#11718}
This commit is contained in:
Stefan Holmer 2016-02-23 13:30:42 +01:00
parent ba3e25e502
commit 80e12072cf
16 changed files with 85 additions and 17 deletions

View file

@ -21,6 +21,7 @@ CPPLINT_DIRS = [
'webrtc/common_video', 'webrtc/common_video',
'webrtc/examples', 'webrtc/examples',
'webrtc/modules/bitrate_controller', 'webrtc/modules/bitrate_controller',
'webrtc/modules/congestion_controller',
'webrtc/modules/pacing', 'webrtc/modules/pacing',
'webrtc/modules/remote_bitrate_estimator', 'webrtc/modules/remote_bitrate_estimator',
'webrtc/modules/rtp_rtcp', 'webrtc/modules/rtp_rtcp',
@ -61,6 +62,7 @@ NATIVE_API_DIRS = (
'webrtc/modules/audio_device/include', 'webrtc/modules/audio_device/include',
'webrtc/modules/audio_processing/include', 'webrtc/modules/audio_processing/include',
'webrtc/modules/bitrate_controller/include', 'webrtc/modules/bitrate_controller/include',
'webrtc/modules/congestion_controller/include',
'webrtc/modules/include', 'webrtc/modules/include',
'webrtc/modules/remote_bitrate_estimator/include', 'webrtc/modules/remote_bitrate_estimator/include',
'webrtc/modules/rtp_rtcp/include', 'webrtc/modules/rtp_rtcp/include',

View file

@ -18,7 +18,7 @@
#include "webrtc/audio/conversion.h" #include "webrtc/audio/conversion.h"
#include "webrtc/base/checks.h" #include "webrtc/base/checks.h"
#include "webrtc/base/logging.h" #include "webrtc/base/logging.h"
#include "webrtc/call/congestion_controller.h" #include "webrtc/modules/congestion_controller/include/congestion_controller.h"
#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h" #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
#include "webrtc/system_wrappers/include/tick_util.h" #include "webrtc/system_wrappers/include/tick_util.h"
#include "webrtc/voice_engine/channel_proxy.h" #include "webrtc/voice_engine/channel_proxy.h"

View file

@ -15,8 +15,8 @@
#include "webrtc/audio/audio_receive_stream.h" #include "webrtc/audio/audio_receive_stream.h"
#include "webrtc/audio/conversion.h" #include "webrtc/audio/conversion.h"
#include "webrtc/call/mock/mock_congestion_controller.h"
#include "webrtc/modules/bitrate_controller/include/mock/mock_bitrate_controller.h" #include "webrtc/modules/bitrate_controller/include/mock/mock_bitrate_controller.h"
#include "webrtc/modules/congestion_controller/include/mock/mock_congestion_controller.h"
#include "webrtc/modules/pacing/packet_router.h" #include "webrtc/modules/pacing/packet_router.h"
#include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h" #include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h"
#include "webrtc/modules/rtp_rtcp/source/byte_io.h" #include "webrtc/modules/rtp_rtcp/source/byte_io.h"

View file

@ -17,7 +17,7 @@
#include "webrtc/audio/scoped_voe_interface.h" #include "webrtc/audio/scoped_voe_interface.h"
#include "webrtc/base/checks.h" #include "webrtc/base/checks.h"
#include "webrtc/base/logging.h" #include "webrtc/base/logging.h"
#include "webrtc/call/congestion_controller.h" #include "webrtc/modules/congestion_controller/include/congestion_controller.h"
#include "webrtc/modules/pacing/paced_sender.h" #include "webrtc/modules/pacing/paced_sender.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "webrtc/voice_engine/channel_proxy.h" #include "webrtc/voice_engine/channel_proxy.h"

View file

@ -16,8 +16,8 @@
#include "webrtc/audio/audio_send_stream.h" #include "webrtc/audio/audio_send_stream.h"
#include "webrtc/audio/audio_state.h" #include "webrtc/audio/audio_state.h"
#include "webrtc/audio/conversion.h" #include "webrtc/audio/conversion.h"
#include "webrtc/call/congestion_controller.h"
#include "webrtc/modules/bitrate_controller/include/mock/mock_bitrate_controller.h" #include "webrtc/modules/bitrate_controller/include/mock/mock_bitrate_controller.h"
#include "webrtc/modules/congestion_controller/include/congestion_controller.h"
#include "webrtc/modules/pacing/paced_sender.h" #include "webrtc/modules/pacing/paced_sender.h"
#include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h" #include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h"
#include "webrtc/test/mock_voe_channel_proxy.h" #include "webrtc/test/mock_voe_channel_proxy.h"

View file

@ -12,7 +12,6 @@ source_set("call") {
sources = [ sources = [
"bitrate_allocator.cc", "bitrate_allocator.cc",
"call.cc", "call.cc",
"congestion_controller.cc",
"transport_adapter.cc", "transport_adapter.cc",
"transport_adapter.h", "transport_adapter.h",
] ]
@ -29,6 +28,7 @@ source_set("call") {
deps = [ deps = [
"..:rtc_event_log", "..:rtc_event_log",
"..:webrtc_common", "..:webrtc_common",
"../modules/congestion_controller",
"../modules/rtp_rtcp", "../modules/rtp_rtcp",
"../system_wrappers", "../system_wrappers",
] ]

View file

@ -25,10 +25,10 @@
#include "webrtc/base/trace_event.h" #include "webrtc/base/trace_event.h"
#include "webrtc/call.h" #include "webrtc/call.h"
#include "webrtc/call/bitrate_allocator.h" #include "webrtc/call/bitrate_allocator.h"
#include "webrtc/call/congestion_controller.h"
#include "webrtc/call/rtc_event_log.h" #include "webrtc/call/rtc_event_log.h"
#include "webrtc/config.h" #include "webrtc/config.h"
#include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h"
#include "webrtc/modules/congestion_controller/include/congestion_controller.h"
#include "webrtc/modules/pacing/paced_sender.h" #include "webrtc/modules/pacing/paced_sender.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
#include "webrtc/modules/rtp_rtcp/source/byte_io.h" #include "webrtc/modules/rtp_rtcp/source/byte_io.h"

View file

@ -9,6 +9,7 @@
'variables': { 'variables': {
'webrtc_call_dependencies': [ 'webrtc_call_dependencies': [
'<(webrtc_root)/common.gyp:webrtc_common', '<(webrtc_root)/common.gyp:webrtc_common',
'<(webrtc_root)/modules/modules.gyp:congestion_controller',
'<(webrtc_root)/modules/modules.gyp:rtp_rtcp', '<(webrtc_root)/modules/modules.gyp:rtp_rtcp',
'<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers', '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
'<(webrtc_root)/webrtc.gyp:rtc_event_log', '<(webrtc_root)/webrtc.gyp:rtc_event_log',
@ -16,7 +17,6 @@
'webrtc_call_sources': [ 'webrtc_call_sources': [
'call/bitrate_allocator.cc', 'call/bitrate_allocator.cc',
'call/call.cc', 'call/call.cc',
'call/congestion_controller.cc',
'call/transport_adapter.cc', 'call/transport_adapter.cc',
'call/transport_adapter.h', 'call/transport_adapter.h',
], ],

View file

@ -0,0 +1,38 @@
# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
import("../../build/webrtc.gni")
source_set("congestion_controller") {
sources = [
"congestion_controller.cc",
"include/congestion_controller.h",
]
if (is_win) {
cflags = [
# TODO(jschuh): Bug 1348: fix this warning.
"/wd4267", # size_t to int truncations
]
}
configs += [ "../..:common_config" ]
public_configs = [ "../..:common_inherited_config" ]
if (is_clang) {
# Suppress warnings from Chrome's Clang plugins.
# See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
configs -= [ "//build/config/clang:find_bad_constructs" ]
}
deps = [
"../bitrate_controller",
"../pacing",
"../remote_bitrate_estimator",
]
}

View file

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include "webrtc/call/congestion_controller.h" #include "webrtc/modules/congestion_controller/include/congestion_controller.h"
#include <algorithm> #include <algorithm>
#include <vector> #include <vector>

View file

@ -0,0 +1,27 @@
# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
{
'targets': [
{
'target_name': 'congestion_controller',
'type': 'static_library',
'dependencies': [
'<(webrtc_root)/modules/modules.gyp:bitrate_controller',
'<(webrtc_root)/modules/modules.gyp:paced_sender',
'<(webrtc_root)/modules/modules.gyp:remote_bitrate_estimator',
],
'sources': [
'congestion_controller.cc',
'include/congestion_controller.h',
],
# TODO(jschuh): Bug 1348: fix size_t to int truncations.
'msvs_disabled_warnings': [ 4267, ],
},
], # targets
}

View file

@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#ifndef WEBRTC_CALL_CONGESTION_CONTROLLER_H_ #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_
#define WEBRTC_CALL_CONGESTION_CONTROLLER_H_ #define WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_
#include "webrtc/base/scoped_ptr.h" #include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/thread_checker.h" #include "webrtc/base/thread_checker.h"
@ -84,4 +84,4 @@ class CongestionController : public CallStatsObserver, public Module {
} // namespace webrtc } // namespace webrtc
#endif // WEBRTC_CALL_CONGESTION_CONTROLLER_H_ #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_

View file

@ -8,12 +8,12 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#ifndef WEBRTC_CALL_MOCK_MOCK_CONGESTION_CONTROLLER_H_ #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_CONGESTION_CONTROLLER_H_
#define WEBRTC_CALL_MOCK_MOCK_CONGESTION_CONTROLLER_H_ #define WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_CONGESTION_CONTROLLER_H_
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "webrtc/base/socket.h" #include "webrtc/base/socket.h"
#include "webrtc/call/congestion_controller.h" #include "webrtc/modules/congestion_controller/include/congestion_controller.h"
namespace webrtc { namespace webrtc {
namespace test { namespace test {
@ -48,4 +48,4 @@ class MockCongestionController : public CongestionController {
}; };
} // namespace test } // namespace test
} // namespace webrtc } // namespace webrtc
#endif // WEBRTC_CALL_MOCK_MOCK_CONGESTION_CONTROLLER_H_ #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_CONGESTION_CONTROLLER_H_

View file

@ -14,6 +14,7 @@
'audio_device/audio_device.gypi', 'audio_device/audio_device.gypi',
'audio_processing/audio_processing.gypi', 'audio_processing/audio_processing.gypi',
'bitrate_controller/bitrate_controller.gypi', 'bitrate_controller/bitrate_controller.gypi',
'congestion_controller/congestion_controller.gypi',
'desktop_capture/desktop_capture.gypi', 'desktop_capture/desktop_capture.gypi',
'media_file/media_file.gypi', 'media_file/media_file.gypi',
'pacing/pacing.gypi', 'pacing/pacing.gypi',

View file

@ -17,8 +17,8 @@
#include "webrtc/base/checks.h" #include "webrtc/base/checks.h"
#include "webrtc/base/logging.h" #include "webrtc/base/logging.h"
#include "webrtc/call/congestion_controller.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/congestion_controller/include/congestion_controller.h"
#include "webrtc/modules/utility/include/process_thread.h" #include "webrtc/modules/utility/include/process_thread.h"
#include "webrtc/system_wrappers/include/clock.h" #include "webrtc/system_wrappers/include/clock.h"
#include "webrtc/video/call_stats.h" #include "webrtc/video/call_stats.h"

View file

@ -18,9 +18,9 @@
#include "webrtc/base/checks.h" #include "webrtc/base/checks.h"
#include "webrtc/base/logging.h" #include "webrtc/base/logging.h"
#include "webrtc/base/trace_event.h" #include "webrtc/base/trace_event.h"
#include "webrtc/call/congestion_controller.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h"
#include "webrtc/modules/congestion_controller/include/congestion_controller.h"
#include "webrtc/modules/pacing/packet_router.h" #include "webrtc/modules/pacing/packet_router.h"
#include "webrtc/modules/utility/include/process_thread.h" #include "webrtc/modules/utility/include/process_thread.h"
#include "webrtc/video/call_stats.h" #include "webrtc/video/call_stats.h"