OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #include <algorithm> // max | 10 #include <algorithm> // max |
11 #include <memory> | 11 #include <memory> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "webrtc/call/call.h" | 14 #include "webrtc/call/call.h" |
| 15 #include "webrtc/call/rtp_transport_controller_send.h" |
15 #include "webrtc/common_video/include/frame_callback.h" | 16 #include "webrtc/common_video/include/frame_callback.h" |
16 #include "webrtc/common_video/include/video_frame.h" | 17 #include "webrtc/common_video/include/video_frame.h" |
17 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 18 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
18 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | 19 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |
19 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" | 20 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" |
20 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp9.h" | 21 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp9.h" |
21 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" | 22 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" |
22 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" | 23 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" |
23 #include "webrtc/rtc_base/bind.h" | 24 #include "webrtc/rtc_base/bind.h" |
24 #include "webrtc/rtc_base/checks.h" | 25 #include "webrtc/rtc_base/checks.h" |
(...skipping 3347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3372 RunBaseTest(&test); | 3373 RunBaseTest(&test); |
3373 } | 3374 } |
3374 | 3375 |
3375 TEST_F(VideoSendStreamTest, SendsKeepAlive) { | 3376 TEST_F(VideoSendStreamTest, SendsKeepAlive) { |
3376 const int kTimeoutMs = 50; // Really short timeout for testing. | 3377 const int kTimeoutMs = 50; // Really short timeout for testing. |
3377 | 3378 |
3378 class KeepaliveObserver : public test::SendTest { | 3379 class KeepaliveObserver : public test::SendTest { |
3379 public: | 3380 public: |
3380 KeepaliveObserver() : SendTest(kDefaultTimeoutMs) {} | 3381 KeepaliveObserver() : SendTest(kDefaultTimeoutMs) {} |
3381 | 3382 |
3382 Call::Config GetSenderCallConfig() override { | 3383 void OnRtpTransportControllerSendCreated( |
3383 Call::Config config = SendTest::GetSenderCallConfig(); | 3384 RtpTransportControllerSend* controller) override { |
3384 config.keepalive_config.timeout_interval_ms = kTimeoutMs; | 3385 RtpKeepAliveConfig config; |
3385 config.keepalive_config.payload_type = | 3386 config.timeout_interval_ms = kTimeoutMs; |
3386 CallTest::kDefaultKeepalivePayloadType; | 3387 config.payload_type = CallTest::kDefaultKeepalivePayloadType; |
3387 return config; | 3388 controller->SetKeepAliveConfig(config); |
3388 } | 3389 } |
3389 | 3390 |
3390 private: | 3391 private: |
3391 Action OnSendRtp(const uint8_t* packet, size_t length) override { | 3392 Action OnSendRtp(const uint8_t* packet, size_t length) override { |
3392 RTPHeader header; | 3393 RTPHeader header; |
3393 EXPECT_TRUE(parser_->Parse(packet, length, &header)); | 3394 EXPECT_TRUE(parser_->Parse(packet, length, &header)); |
3394 | 3395 |
3395 if (header.payloadType != CallTest::kDefaultKeepalivePayloadType) { | 3396 if (header.payloadType != CallTest::kDefaultKeepalivePayloadType) { |
3396 // The video stream has started. Stop it now. | 3397 // The video stream has started. Stop it now. |
3397 if (capturer_) | 3398 if (capturer_) |
(...skipping 14 matching lines...) Expand all Loading... |
3412 capturer_ = frame_generator_capturer; | 3413 capturer_ = frame_generator_capturer; |
3413 } | 3414 } |
3414 | 3415 |
3415 test::FrameGeneratorCapturer* capturer_ = nullptr; | 3416 test::FrameGeneratorCapturer* capturer_ = nullptr; |
3416 } test; | 3417 } test; |
3417 | 3418 |
3418 RunBaseTest(&test); | 3419 RunBaseTest(&test); |
3419 } | 3420 } |
3420 | 3421 |
3421 } // namespace webrtc | 3422 } // namespace webrtc |
OLD | NEW |