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 #ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_RTP_RTCP_OBSERVER_H_ | 10 #ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_RTP_RTCP_OBSERVER_H_ |
11 #define WEBRTC_VIDEO_ENGINE_TEST_COMMON_RTP_RTCP_OBSERVER_H_ | 11 #define WEBRTC_VIDEO_ENGINE_TEST_COMMON_RTP_RTCP_OBSERVER_H_ |
12 | 12 |
13 #include <map> | 13 #include <map> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
18 #include "webrtc/base/criticalsection.h" | 18 #include "webrtc/base/criticalsection.h" |
19 #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" | 19 #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" |
| 20 #include "webrtc/test/constants.h" |
20 #include "webrtc/test/direct_transport.h" | 21 #include "webrtc/test/direct_transport.h" |
21 #include "webrtc/typedefs.h" | 22 #include "webrtc/typedefs.h" |
22 #include "webrtc/video_send_stream.h" | 23 #include "webrtc/video_send_stream.h" |
23 | 24 |
24 namespace webrtc { | 25 namespace webrtc { |
25 namespace test { | 26 namespace test { |
26 | 27 |
27 class PacketTransport; | 28 class PacketTransport; |
28 | 29 |
29 class RtpRtcpObserver { | 30 class RtpRtcpObserver { |
(...skipping 23 matching lines...) Expand all Loading... |
53 } | 54 } |
54 | 55 |
55 virtual Action OnReceiveRtcp(const uint8_t* packet, size_t length) { | 56 virtual Action OnReceiveRtcp(const uint8_t* packet, size_t length) { |
56 return SEND_PACKET; | 57 return SEND_PACKET; |
57 } | 58 } |
58 | 59 |
59 protected: | 60 protected: |
60 explicit RtpRtcpObserver(unsigned int event_timeout_ms) | 61 explicit RtpRtcpObserver(unsigned int event_timeout_ms) |
61 : observation_complete_(EventWrapper::Create()), | 62 : observation_complete_(EventWrapper::Create()), |
62 parser_(RtpHeaderParser::Create()), | 63 parser_(RtpHeaderParser::Create()), |
63 timeout_ms_(event_timeout_ms) {} | 64 timeout_ms_(event_timeout_ms) { |
| 65 parser_->RegisterRtpHeaderExtension(kRtpExtensionTransmissionTimeOffset, |
| 66 kTOffsetExtensionId); |
| 67 parser_->RegisterRtpHeaderExtension(kRtpExtensionAbsoluteSendTime, |
| 68 kAbsSendTimeExtensionId); |
| 69 parser_->RegisterRtpHeaderExtension(kRtpExtensionTransportSequenceNumber, |
| 70 kTransportSequenceNumberExtensionId); |
| 71 } |
64 | 72 |
65 const rtc::scoped_ptr<EventWrapper> observation_complete_; | 73 const rtc::scoped_ptr<EventWrapper> observation_complete_; |
66 const rtc::scoped_ptr<RtpHeaderParser> parser_; | 74 const rtc::scoped_ptr<RtpHeaderParser> parser_; |
67 | 75 |
68 private: | 76 private: |
69 unsigned int timeout_ms_; | 77 unsigned int timeout_ms_; |
70 }; | 78 }; |
71 | 79 |
72 class PacketTransport : public test::DirectTransport { | 80 class PacketTransport : public test::DirectTransport { |
73 public: | 81 public: |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 return true; // Will never happen, makes compiler happy. | 132 return true; // Will never happen, makes compiler happy. |
125 } | 133 } |
126 | 134 |
127 RtpRtcpObserver* const observer_; | 135 RtpRtcpObserver* const observer_; |
128 TransportType transport_type_; | 136 TransportType transport_type_; |
129 }; | 137 }; |
130 } // namespace test | 138 } // namespace test |
131 } // namespace webrtc | 139 } // namespace webrtc |
132 | 140 |
133 #endif // WEBRTC_VIDEO_ENGINE_TEST_COMMON_RTP_RTCP_OBSERVER_H_ | 141 #endif // WEBRTC_VIDEO_ENGINE_TEST_COMMON_RTP_RTCP_OBSERVER_H_ |
OLD | NEW |