Move BitrateAllocation to api/ and rename it VideoBitrateAllocation

Since the webrtc_common build target does not have visibility set, we
cannot easily use BitrateAllocation in other parts of Chromium.
This is currently blocking parts of chromium:794608, and I know of other
usage outside webrtc already, so moving it to api/ should be warranted.

Also, since there's some naming confusion and this class is video
specific rename it VideoBitrateAllocation. This also fits with the
standard interface for producing these: VideoBitrateAllocator.

Bug: chromium:794608
Change-Id: I4c0fae40f9365e860c605a76a4f67ecc9b9cf9fe
Reviewed-on: https://webrtc-review.googlesource.com/70783
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22986}
This commit is contained in:
Erik Språng
2018-04-23 12:32:22 +02:00
committed by Commit Bot
parent 5c14725d53
commit 566124a6df
75 changed files with 452 additions and 348 deletions

View File

@ -35,7 +35,7 @@ using ::testing::Invoke;
using ::testing::Return;
using ::testing::SizeIs;
using ::testing::StrictMock;
using ::webrtc::BitrateAllocation;
using ::webrtc::VideoBitrateAllocation;
using ::webrtc::CompactNtp;
using ::webrtc::CompactNtpRttToMs;
using ::webrtc::MockRtcpRttStats;
@ -60,7 +60,8 @@ class MockMediaReceiverRtcpObserver : public webrtc::MediaReceiverRtcpObserver {
public:
MOCK_METHOD3(OnSenderReport, void(uint32_t, NtpTime, uint32_t));
MOCK_METHOD1(OnBye, void(uint32_t));
MOCK_METHOD2(OnBitrateAllocation, void(uint32_t, const BitrateAllocation&));
MOCK_METHOD2(OnBitrateAllocation,
void(uint32_t, const VideoBitrateAllocation&));
};
// Since some tests will need to wait for this period, make it small to avoid
@ -552,7 +553,7 @@ TEST(RtcpTransceiverImplTest, CallsObserverOnTargetBitrateBySenderSsrc) {
xr.SetTargetBitrate(target_bitrate);
auto raw_packet = xr.Build();
BitrateAllocation bitrate_allocation;
VideoBitrateAllocation bitrate_allocation;
bitrate_allocation.SetBitrate(0, 0, /*bitrate_bps=*/10000);
bitrate_allocation.SetBitrate(0, 1, /*bitrate_bps=*/20000);
bitrate_allocation.SetBitrate(1, 0, /*bitrate_bps=*/40000);
@ -578,7 +579,7 @@ TEST(RtcpTransceiverImplTest, SkipsIncorrectTargetBitrateEntries) {
xr.SetSenderSsrc(kRemoteSsrc);
auto raw_packet = xr.Build();
BitrateAllocation expected_allocation;
VideoBitrateAllocation expected_allocation;
expected_allocation.SetBitrate(0, 0, /*bitrate_bps=*/10000);
EXPECT_CALL(observer, OnBitrateAllocation(kRemoteSsrc, expected_allocation));
rtcp_transceiver.ReceivePacket(raw_packet, /*now_us=*/0);