OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( | 59 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( |
60 cricket::kRtcpFbParamNack, cricket::kRtcpFbNackParamPli))); | 60 cricket::kRtcpFbParamNack, cricket::kRtcpFbNackParamPli))); |
61 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( | 61 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( |
62 cricket::kRtcpFbParamRemb, cricket::kParamValueEmpty))); | 62 cricket::kRtcpFbParamRemb, cricket::kParamValueEmpty))); |
63 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( | 63 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( |
64 cricket::kRtcpFbParamTransportCc, cricket::kParamValueEmpty))); | 64 cricket::kRtcpFbParamTransportCc, cricket::kParamValueEmpty))); |
65 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( | 65 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( |
66 cricket::kRtcpFbParamCcm, cricket::kRtcpFbCcmParamFir))); | 66 cricket::kRtcpFbParamCcm, cricket::kRtcpFbCcmParamFir))); |
67 } | 67 } |
68 | 68 |
69 static void CreateBlackFrame(webrtc::VideoFrame* video_frame, | 69 static rtc::scoped_refptr<webrtc::VideoFrameBuffer> CreateBlackFrameBuffer( |
70 int width, | 70 int width, |
71 int height) { | 71 int height) { |
72 video_frame->CreateEmptyFrame( | 72 rtc::scoped_refptr<webrtc::I420Buffer> buffer = |
73 width, height, width, (width + 1) / 2, (width + 1) / 2); | 73 webrtc::I420Buffer::Create(width, height); |
74 memset(video_frame->video_frame_buffer()->MutableDataY(), 16, | 74 buffer->SetToBlack(); |
75 video_frame->allocated_size(webrtc::kYPlane)); | 75 return buffer; |
76 memset(video_frame->video_frame_buffer()->MutableDataU(), 128, | |
77 video_frame->allocated_size(webrtc::kUPlane)); | |
78 memset(video_frame->video_frame_buffer()->MutableDataV(), 128, | |
79 video_frame->allocated_size(webrtc::kVPlane)); | |
80 } | 76 } |
81 | 77 |
82 void VerifySendStreamHasRtxTypes(const webrtc::VideoSendStream::Config& config, | 78 void VerifySendStreamHasRtxTypes(const webrtc::VideoSendStream::Config& config, |
83 const std::map<int, int>& rtx_types) { | 79 const std::map<int, int>& rtx_types) { |
84 std::map<int, int>::const_iterator it; | 80 std::map<int, int>::const_iterator it; |
85 it = rtx_types.find(config.encoder_settings.payload_type); | 81 it = rtx_types.find(config.encoder_settings.payload_type); |
86 EXPECT_TRUE(it != rtx_types.end() && | 82 EXPECT_TRUE(it != rtx_types.end() && |
87 it->second == config.rtp.rtx.payload_type); | 83 it->second == config.rtp.rtx.payload_type); |
88 | 84 |
89 if (config.rtp.fec.red_rtx_payload_type != -1) { | 85 if (config.rtp.fec.red_rtx_payload_type != -1) { |
(...skipping 2107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2197 // Start at last timestamp to verify that wraparounds are estimated correctly. | 2193 // Start at last timestamp to verify that wraparounds are estimated correctly. |
2198 static const uint32_t kInitialTimestamp = 0xFFFFFFFFu; | 2194 static const uint32_t kInitialTimestamp = 0xFFFFFFFFu; |
2199 static const int64_t kInitialNtpTimeMs = 1247891230; | 2195 static const int64_t kInitialNtpTimeMs = 1247891230; |
2200 static const int kFrameOffsetMs = 20; | 2196 static const int kFrameOffsetMs = 20; |
2201 EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_)); | 2197 EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_)); |
2202 | 2198 |
2203 FakeVideoReceiveStream* stream = AddRecvStream(); | 2199 FakeVideoReceiveStream* stream = AddRecvStream(); |
2204 cricket::FakeVideoRenderer renderer; | 2200 cricket::FakeVideoRenderer renderer; |
2205 EXPECT_TRUE(channel_->SetSink(last_ssrc_, &renderer)); | 2201 EXPECT_TRUE(channel_->SetSink(last_ssrc_, &renderer)); |
2206 | 2202 |
2207 webrtc::VideoFrame video_frame; | 2203 webrtc::VideoFrame video_frame(CreateBlackFrameBuffer(4, 4), |
2208 CreateBlackFrame(&video_frame, 4, 4); | 2204 kInitialTimestamp, 0, |
2209 video_frame.set_timestamp(kInitialTimestamp); | 2205 webrtc::kVideoRotation_0); |
2210 // Initial NTP time is not available on the first frame, but should still be | 2206 // Initial NTP time is not available on the first frame, but should still be |
2211 // able to be estimated. | 2207 // able to be estimated. |
2212 stream->InjectFrame(video_frame); | 2208 stream->InjectFrame(video_frame); |
2213 | 2209 |
2214 EXPECT_EQ(1, renderer.num_rendered_frames()); | 2210 EXPECT_EQ(1, renderer.num_rendered_frames()); |
2215 | 2211 |
2216 // This timestamp is kInitialTimestamp (-1) + kFrameOffsetMs * 90, which | 2212 // This timestamp is kInitialTimestamp (-1) + kFrameOffsetMs * 90, which |
2217 // triggers a constant-overflow warning, hence we're calculating it explicitly | 2213 // triggers a constant-overflow warning, hence we're calculating it explicitly |
2218 // here. | 2214 // here. |
2219 video_frame.set_timestamp(kFrameOffsetMs * 90 - 1); | 2215 video_frame.set_timestamp(kFrameOffsetMs * 90 - 1); |
(...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3827 } | 3823 } |
3828 | 3824 |
3829 // Test that we normalize send codec format size in simulcast. | 3825 // Test that we normalize send codec format size in simulcast. |
3830 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 3826 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
3831 cricket::VideoCodec codec(kVp8Codec270p); | 3827 cricket::VideoCodec codec(kVp8Codec270p); |
3832 codec.width += 1; | 3828 codec.width += 1; |
3833 codec.height += 1; | 3829 codec.height += 1; |
3834 VerifySimulcastSettings(codec, 2, 2); | 3830 VerifySimulcastSettings(codec, 2, 2); |
3835 } | 3831 } |
3836 } // namespace cricket | 3832 } // namespace cricket |
OLD | NEW |