Unify FrameType and VideoFrameType.
Prevents some heap allocation and frame-type conversion since interfaces
mismatch. Also it's less confusing to have one type for this.
BUG=webrtc:5042
R=magjed@webrtc.org, mflodman@webrtc.org, henrik.lundin@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org
Review URL: https://codereview.webrtc.org/1371043003
Cr-Original-Commit-Position: refs/heads/master@{#10320}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 22993e1a0c114122fc1b9de0fc74d4096ec868bd
diff --git a/modules/video_coding/codecs/vp8/simulcast_unittest.h b/modules/video_coding/codecs/vp8/simulcast_unittest.h
index 672fa3a..a3d9e5a 100644
--- a/modules/video_coding/codecs/vp8/simulcast_unittest.h
+++ b/modules/video_coding/codecs/vp8/simulcast_unittest.h
@@ -338,7 +338,7 @@
decoder_->Release();
}
- void ExpectStreams(VideoFrameType frame_type, int expected_video_streams) {
+ void ExpectStreams(FrameType frame_type, int expected_video_streams) {
ASSERT_GE(expected_video_streams, 0);
ASSERT_LE(expected_video_streams, kNumberOfSimulcastStreams);
if (expected_video_streams >= 1) {
@@ -389,8 +389,7 @@
// a key frame was only requested for some of them.
void TestKeyFrameRequestsOnAllStreams() {
encoder_->SetRates(kMaxBitrates[2], 30); // To get all three streams.
- std::vector<VideoFrameType> frame_types(kNumberOfSimulcastStreams,
- kDeltaFrame);
+ std::vector<FrameType> frame_types(kNumberOfSimulcastStreams, kDeltaFrame);
ExpectStreams(kKeyFrame, kNumberOfSimulcastStreams);
EXPECT_EQ(0, encoder_->Encode(input_frame_, NULL, &frame_types));
@@ -424,8 +423,7 @@
void TestPaddingAllStreams() {
// We should always encode the base layer.
encoder_->SetRates(kMinBitrates[0] - 1, 30);
- std::vector<VideoFrameType> frame_types(kNumberOfSimulcastStreams,
- kDeltaFrame);
+ std::vector<FrameType> frame_types(kNumberOfSimulcastStreams, kDeltaFrame);
ExpectStreams(kKeyFrame, 1);
EXPECT_EQ(0, encoder_->Encode(input_frame_, NULL, &frame_types));
@@ -437,8 +435,7 @@
void TestPaddingTwoStreams() {
// We have just enough to get only the first stream and padding for two.
encoder_->SetRates(kMinBitrates[0], 30);
- std::vector<VideoFrameType> frame_types(kNumberOfSimulcastStreams,
- kDeltaFrame);
+ std::vector<FrameType> frame_types(kNumberOfSimulcastStreams, kDeltaFrame);
ExpectStreams(kKeyFrame, 1);
EXPECT_EQ(0, encoder_->Encode(input_frame_, NULL, &frame_types));
@@ -451,8 +448,7 @@
// We are just below limit of sending second stream, so we should get
// the first stream maxed out (at |maxBitrate|), and padding for two.
encoder_->SetRates(kTargetBitrates[0] + kMinBitrates[1] - 1, 30);
- std::vector<VideoFrameType> frame_types(kNumberOfSimulcastStreams,
- kDeltaFrame);
+ std::vector<FrameType> frame_types(kNumberOfSimulcastStreams, kDeltaFrame);
ExpectStreams(kKeyFrame, 1);
EXPECT_EQ(0, encoder_->Encode(input_frame_, NULL, &frame_types));
@@ -464,8 +460,7 @@
void TestPaddingOneStream() {
// We have just enough to send two streams, so padding for one stream.
encoder_->SetRates(kTargetBitrates[0] + kMinBitrates[1], 30);
- std::vector<VideoFrameType> frame_types(kNumberOfSimulcastStreams,
- kDeltaFrame);
+ std::vector<FrameType> frame_types(kNumberOfSimulcastStreams, kDeltaFrame);
ExpectStreams(kKeyFrame, 2);
EXPECT_EQ(0, encoder_->Encode(input_frame_, NULL, &frame_types));
@@ -479,8 +474,7 @@
// first stream's rate maxed out at |targetBitrate|, second at |maxBitrate|.
encoder_->SetRates(kTargetBitrates[0] + kTargetBitrates[1] +
kMinBitrates[2] - 1, 30);
- std::vector<VideoFrameType> frame_types(kNumberOfSimulcastStreams,
- kDeltaFrame);
+ std::vector<FrameType> frame_types(kNumberOfSimulcastStreams, kDeltaFrame);
ExpectStreams(kKeyFrame, 2);
EXPECT_EQ(0, encoder_->Encode(input_frame_, NULL, &frame_types));
@@ -493,8 +487,7 @@
// We have just enough to send all streams.
encoder_->SetRates(kTargetBitrates[0] + kTargetBitrates[1] +
kMinBitrates[2], 30);
- std::vector<VideoFrameType> frame_types(kNumberOfSimulcastStreams,
- kDeltaFrame);
+ std::vector<FrameType> frame_types(kNumberOfSimulcastStreams, kDeltaFrame);
ExpectStreams(kKeyFrame, 3);
EXPECT_EQ(0, encoder_->Encode(input_frame_, NULL, &frame_types));
@@ -507,8 +500,7 @@
// We should get three media streams.
encoder_->SetRates(kMaxBitrates[0] + kMaxBitrates[1] +
kMaxBitrates[2], 30);
- std::vector<VideoFrameType> frame_types(kNumberOfSimulcastStreams,
- kDeltaFrame);
+ std::vector<FrameType> frame_types(kNumberOfSimulcastStreams, kDeltaFrame);
ExpectStreams(kKeyFrame, 3);
EXPECT_EQ(0, encoder_->Encode(input_frame_, NULL, &frame_types));
@@ -589,8 +581,7 @@
// Encode one frame and verify.
encoder_->SetRates(kMaxBitrates[0] + kMaxBitrates[1], 30);
- std::vector<VideoFrameType> frame_types(kNumberOfSimulcastStreams,
- kDeltaFrame);
+ std::vector<FrameType> frame_types(kNumberOfSimulcastStreams, kDeltaFrame);
EXPECT_CALL(encoder_callback_, Encoded(
AllOf(Field(&EncodedImage::_frameType, kKeyFrame),
Field(&EncodedImage::_encodedWidth, width),