forked from JumpingYang001/webrtc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "Move allocation and rtp conversion logic out of payload router."
This reverts commit c2406e4. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > Move allocation and rtp conversion logic out of payload router. > > > > Makes it easier to write tests, and allows for moving rtp module > > ownership into the payload router in the future. > > > > The RtpPayloadParams class is split into declaration and definition and > > moved into separate files. > > > > Bug: webrtc:9517 > > Change-Id: I8700628edff19abcacfe8d3a20e4ba7476f712ad > > Reviewed-on: https://webrtc-review.googlesource.com/88564 > > Commit-Queue: Stefan Holmer <[email protected]> > > Reviewed-by: Sebastian Jansson <[email protected]> > > Cr-Commit-Position: refs/heads/master@{#23983} > > [email protected],[email protected],[email protected] > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <[email protected]> > Commit-Queue: JT Teh <[email protected]> > Cr-Commit-Position: refs/heads/master@{#23991} [email protected],[email protected],[email protected],[email protected],[email protected],[email protected] Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <[email protected]> Reviewed-by: Stefan Holmer <[email protected]> Cr-Commit-Position: refs/heads/master@{#23996}
- Loading branch information
Stefan Holmer
authored and
Commit Bot
committed
Jul 17, 2018
1 parent
e250645
commit f704468
Showing
12 changed files
with
623 additions
and
637 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright (c) 2018 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("../../../webrtc.gni") | ||
|
||
rtc_source_set("rtc_api_video_unittests") { | ||
testonly = true | ||
|
||
sources = [ | ||
"video_bitrate_allocation_unittest.cc", | ||
] | ||
|
||
if (!build_with_chromium && is_clang) { | ||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | ||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | ||
} | ||
|
||
deps = [ | ||
"..:video_bitrate_allocation", | ||
"../../../test:test_support", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright (c) 2018 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. | ||
*/ | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
#include "api/video/video_bitrate_allocation.h" | ||
#include "test/gtest.h" | ||
|
||
namespace webrtc { | ||
TEST(VideoBitrateAllocation, SimulcastTargetBitrate) { | ||
VideoBitrateAllocation bitrate; | ||
bitrate.SetBitrate(0, 0, 10000); | ||
bitrate.SetBitrate(0, 1, 20000); | ||
bitrate.SetBitrate(1, 0, 40000); | ||
bitrate.SetBitrate(1, 1, 80000); | ||
|
||
VideoBitrateAllocation layer0_bitrate; | ||
layer0_bitrate.SetBitrate(0, 0, 10000); | ||
layer0_bitrate.SetBitrate(0, 1, 20000); | ||
|
||
VideoBitrateAllocation layer1_bitrate; | ||
layer1_bitrate.SetBitrate(0, 0, 40000); | ||
layer1_bitrate.SetBitrate(0, 1, 80000); | ||
|
||
std::vector<absl::optional<VideoBitrateAllocation>> layer_allocations = | ||
bitrate.GetSimulcastAllocations(); | ||
|
||
EXPECT_EQ(layer0_bitrate, layer_allocations[0]); | ||
EXPECT_EQ(layer1_bitrate, layer_allocations[1]); | ||
} | ||
|
||
TEST(VideoBitrateAllocation, SimulcastTargetBitrateWithInactiveStream) { | ||
// Create bitrate allocation with bitrate only for the first and third stream. | ||
VideoBitrateAllocation bitrate; | ||
bitrate.SetBitrate(0, 0, 10000); | ||
bitrate.SetBitrate(0, 1, 20000); | ||
bitrate.SetBitrate(2, 0, 40000); | ||
bitrate.SetBitrate(2, 1, 80000); | ||
|
||
VideoBitrateAllocation layer0_bitrate; | ||
layer0_bitrate.SetBitrate(0, 0, 10000); | ||
layer0_bitrate.SetBitrate(0, 1, 20000); | ||
|
||
VideoBitrateAllocation layer2_bitrate; | ||
layer2_bitrate.SetBitrate(0, 0, 40000); | ||
layer2_bitrate.SetBitrate(0, 1, 80000); | ||
|
||
std::vector<absl::optional<VideoBitrateAllocation>> layer_allocations = | ||
bitrate.GetSimulcastAllocations(); | ||
|
||
EXPECT_EQ(layer0_bitrate, layer_allocations[0]); | ||
EXPECT_FALSE(layer_allocations[1]); | ||
EXPECT_EQ(layer2_bitrate, layer_allocations[2]); | ||
} | ||
} // namespace webrtc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.