| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2017 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2017 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 |
| 11 #include "webrtc/test/gtest.h" | 11 #include "webrtc/test/gtest.h" |
| 12 #include "webrtc/test/gmock.h" | 12 #include "webrtc/test/gmock.h" |
| 13 | 13 |
| 14 #include "webrtc/call/test/mock_rtp_packet_sink_interface.h" |
| 14 #include "webrtc/common_video/h264/h264_common.h" | 15 #include "webrtc/common_video/h264/h264_common.h" |
| 15 #include "webrtc/media/base/mediaconstants.h" | 16 #include "webrtc/media/base/mediaconstants.h" |
| 16 #include "webrtc/modules/pacing/packet_router.h" | 17 #include "webrtc/modules/pacing/packet_router.h" |
| 17 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" | 18 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" |
| 18 #include "webrtc/modules/utility/include/process_thread.h" | 19 #include "webrtc/modules/utility/include/process_thread.h" |
| 19 #include "webrtc/modules/video_coding/frame_object.h" | 20 #include "webrtc/modules/video_coding/frame_object.h" |
| 20 #include "webrtc/modules/video_coding/include/video_coding_defines.h" | 21 #include "webrtc/modules/video_coding/include/video_coding_defines.h" |
| 21 #include "webrtc/modules/video_coding/packet.h" | 22 #include "webrtc/modules/video_coding/packet.h" |
| 22 #include "webrtc/modules/video_coding/rtp_frame_reference_finder.h" | 23 #include "webrtc/modules/video_coding/rtp_frame_reference_finder.h" |
| 23 #include "webrtc/modules/video_coding/timing.h" | 24 #include "webrtc/modules/video_coding/timing.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 } | 89 } |
| 89 DoOnCompleteFrame(frame.get()); | 90 DoOnCompleteFrame(frame.get()); |
| 90 } | 91 } |
| 91 void AppendExpectedBitstream(const uint8_t data[], size_t size_in_bytes) { | 92 void AppendExpectedBitstream(const uint8_t data[], size_t size_in_bytes) { |
| 92 // TODO(Johan): Let rtc::ByteBuffer handle uint8_t* instead of char*. | 93 // TODO(Johan): Let rtc::ByteBuffer handle uint8_t* instead of char*. |
| 93 buffer_.WriteBytes(reinterpret_cast<const char*>(data), size_in_bytes); | 94 buffer_.WriteBytes(reinterpret_cast<const char*>(data), size_in_bytes); |
| 94 } | 95 } |
| 95 rtc::ByteBufferWriter buffer_; | 96 rtc::ByteBufferWriter buffer_; |
| 96 }; | 97 }; |
| 97 | 98 |
| 98 class MockRtpPacketSink : public RtpPacketSinkInterface { | |
| 99 public: | |
| 100 MOCK_METHOD1(OnRtpPacket, void(const RtpPacketReceived&)); | |
| 101 }; | |
| 102 | |
| 103 constexpr uint32_t kSsrc = 111; | 99 constexpr uint32_t kSsrc = 111; |
| 104 constexpr uint16_t kSequenceNumber = 222; | 100 constexpr uint16_t kSequenceNumber = 222; |
| 105 std::unique_ptr<RtpPacketReceived> CreateRtpPacketReceived( | 101 std::unique_ptr<RtpPacketReceived> CreateRtpPacketReceived( |
| 106 uint32_t ssrc = kSsrc, | 102 uint32_t ssrc = kSsrc, |
| 107 uint16_t sequence_number = kSequenceNumber) { | 103 uint16_t sequence_number = kSequenceNumber) { |
| 108 auto packet = rtc::MakeUnique<RtpPacketReceived>(); | 104 auto packet = rtc::MakeUnique<RtpPacketReceived>(); |
| 109 packet->SetSsrc(ssrc); | 105 packet->SetSsrc(ssrc); |
| 110 packet->SetSequenceNumber(sequence_number); | 106 packet->SetSequenceNumber(sequence_number); |
| 111 return packet; | 107 return packet; |
| 112 } | 108 } |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 rtp_video_stream_receiver_->AddSecondarySink(&secondary_sink); | 448 rtp_video_stream_receiver_->AddSecondarySink(&secondary_sink); |
| 453 EXPECT_DEATH(rtp_video_stream_receiver_->AddSecondarySink(&secondary_sink), | 449 EXPECT_DEATH(rtp_video_stream_receiver_->AddSecondarySink(&secondary_sink), |
| 454 ""); | 450 ""); |
| 455 | 451 |
| 456 // Test tear-down. | 452 // Test tear-down. |
| 457 rtp_video_stream_receiver_->RemoveSecondarySink(&secondary_sink); | 453 rtp_video_stream_receiver_->RemoveSecondarySink(&secondary_sink); |
| 458 } | 454 } |
| 459 #endif | 455 #endif |
| 460 | 456 |
| 461 } // namespace webrtc | 457 } // namespace webrtc |
| OLD | NEW |