blob: d07ce8db27da93412e9f3ad2f5d5fca92ac9d7c8 [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:361/*
kjellander1afca732016-02-08 04:46:452 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved.
henrike@webrtc.org28e20752013-07-10 00:45:363 *
kjellander1afca732016-02-08 04:46:454 * 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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
henrike@webrtc.org28e20752013-07-10 00:45:369 */
10
Yves Gerey3e707812018-11-28 15:47:4911#include <string.h>
12#include <cstdint>
Steve Antone78bcb92017-10-31 16:53:0813#include <vector>
14
Mirko Bonadei92ea95e2017-09-15 04:47:3115#include "media/base/fakertp.h"
Yves Gerey665174f2018-06-19 13:03:0516#include "media/base/rtputils.h"
Mirko Bonadei92ea95e2017-09-15 04:47:3117#include "rtc_base/asyncpacketsocket.h"
Yves Gerey3e707812018-11-28 15:47:4918#include "test/gtest.h"
henrike@webrtc.org28e20752013-07-10 00:45:3619
20namespace cricket {
21
Sergey Ulanovdc305db2016-01-15 01:14:5422static const uint8_t kRtpPacketWithMarker[] = {
Yves Gerey665174f2018-06-19 13:03:0523 0x80, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01};
henrike@webrtc.org28e20752013-07-10 00:45:3624// 3 CSRCs (0x01020304, 0x12345678, 0xAABBCCDD)
25// Extension (0xBEDE, 0x1122334455667788)
Sergey Ulanovdc305db2016-01-15 01:14:5426static const uint8_t kRtpPacketWithMarkerAndCsrcAndExtension[] = {
henrike@webrtc.org28e20752013-07-10 00:45:3627 0x93, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
28 0x01, 0x02, 0x03, 0x04, 0x12, 0x34, 0x56, 0x78, 0xAA, 0xBB, 0xCC, 0xDD,
Yves Gerey665174f2018-06-19 13:03:0529 0xBE, 0xDE, 0x00, 0x02, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88};
30static const uint8_t kInvalidPacket[] = {0x80, 0x00};
Sergey Ulanovdc305db2016-01-15 01:14:5431static const uint8_t kInvalidPacketWithCsrc[] = {
henrike@webrtc.org28e20752013-07-10 00:45:3632 0x83, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
Yves Gerey665174f2018-06-19 13:03:0533 0x01, 0x02, 0x03, 0x04, 0x12, 0x34, 0x56, 0x78, 0xAA, 0xBB, 0xCC};
Sergey Ulanovdc305db2016-01-15 01:14:5434static const uint8_t kInvalidPacketWithCsrcAndExtension1[] = {
Yves Gerey665174f2018-06-19 13:03:0535 0x93, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
36 0x00, 0x00, 0x01, 0x01, 0x02, 0x03, 0x04, 0x12, 0x34,
37 0x56, 0x78, 0xAA, 0xBB, 0xCC, 0xDD, 0xBE, 0xDE, 0x00};
Sergey Ulanovdc305db2016-01-15 01:14:5438static const uint8_t kInvalidPacketWithCsrcAndExtension2[] = {
henrike@webrtc.org28e20752013-07-10 00:45:3639 0x93, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
40 0x01, 0x02, 0x03, 0x04, 0x12, 0x34, 0x56, 0x78, 0xAA, 0xBB, 0xCC, 0xDD,
Yves Gerey665174f2018-06-19 13:03:0541 0xBE, 0xDE, 0x00, 0x02, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77};
henrike@webrtc.org28e20752013-07-10 00:45:3642
43// PT = 206, FMT = 1, Sender SSRC = 0x1111, Media SSRC = 0x1111
44// No FCI information is needed for PLI.
Sergey Ulanovdc305db2016-01-15 01:14:5445static const uint8_t kNonCompoundRtcpPliFeedbackPacket[] = {
Yves Gerey665174f2018-06-19 13:03:0546 0x81, 0xCE, 0x00, 0x0C, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x11, 0x11};
henrike@webrtc.org28e20752013-07-10 00:45:3647
48// Packet has only mandatory fixed RTCP header
49// PT = 204, SSRC = 0x1111
Yves Gerey665174f2018-06-19 13:03:0550static const uint8_t kNonCompoundRtcpAppPacket[] = {0x81, 0xCC, 0x00, 0x0C,
51 0x00, 0x00, 0x11, 0x11};
henrike@webrtc.org28e20752013-07-10 00:45:3652
53// PT = 202, Source count = 0
Yves Gerey665174f2018-06-19 13:03:0554static const uint8_t kNonCompoundRtcpSDESPacket[] = {0x80, 0xCA, 0x00, 0x00};
henrike@webrtc.org28e20752013-07-10 00:45:3655
Yves Gerey665174f2018-06-19 13:03:0556static uint8_t kFakeTag[4] = {0xba, 0xdd, 0xba, 0xdd};
Sergey Ulanovdc305db2016-01-15 01:14:5457static uint8_t kTestKey[] = "12345678901234567890";
Yves Gerey665174f2018-06-19 13:03:0558static uint8_t kTestAstValue[3] = {0xaa, 0xbb, 0xcc};
Sergey Ulanovdc305db2016-01-15 01:14:5459
60// Valid rtp Message with 2 byte header extension.
61static uint8_t kRtpMsgWith2ByteExtnHeader[] = {
Yves Gerey665174f2018-06-19 13:03:0562 // clang-format off
63 // clang formatting doesn't respect inline comments.
Sergey Ulanovdc305db2016-01-15 01:14:5464 0x90, 0x00, 0x00, 0x00,
65 0x00, 0x00, 0x00, 0x00,
66 0xAA, 0xBB, 0xCC, 0XDD, // SSRC
67 0x10, 0x00, 0x00, 0x01, // 2 Byte header extension
68 0x01, 0x00, 0x00, 0x00
Yves Gerey665174f2018-06-19 13:03:0569 // clang-format on
Sergey Ulanovdc305db2016-01-15 01:14:5470};
71
72// RTP packet with single byte extension header of length 4 bytes.
73// Extension id = 3 and length = 3
74static uint8_t kRtpMsgWithAbsSendTimeExtension[] = {
Yves Gerey665174f2018-06-19 13:03:0575 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
76 0xBE, 0xDE, 0x00, 0x02, 0x22, 0x00, 0x02, 0x1c, 0x32, 0xaa, 0xbb, 0xcc,
Sergey Ulanovdc305db2016-01-15 01:14:5477};
78
79// Index of AbsSendTimeExtn data in message |kRtpMsgWithAbsSendTimeExtension|.
80static const int kAstIndexInRtpMsg = 21;
81
henrike@webrtc.org28e20752013-07-10 00:45:3682TEST(RtpUtilsTest, GetRtp) {
pkasting@chromium.org0e81fdf2015-02-02 23:54:0383 EXPECT_TRUE(IsRtpPacket(kPcmuFrame, sizeof(kPcmuFrame)));
henrike@webrtc.org28e20752013-07-10 00:45:3684
85 int pt;
86 EXPECT_TRUE(GetRtpPayloadType(kPcmuFrame, sizeof(kPcmuFrame), &pt));
87 EXPECT_EQ(0, pt);
88 EXPECT_TRUE(GetRtpPayloadType(kRtpPacketWithMarker,
89 sizeof(kRtpPacketWithMarker), &pt));
90 EXPECT_EQ(0, pt);
91
92 int seq_num;
93 EXPECT_TRUE(GetRtpSeqNum(kPcmuFrame, sizeof(kPcmuFrame), &seq_num));
94 EXPECT_EQ(1, seq_num);
95
Peter Boström0c4e06b2015-10-07 10:23:2196 uint32_t ts;
henrike@webrtc.org28e20752013-07-10 00:45:3697 EXPECT_TRUE(GetRtpTimestamp(kPcmuFrame, sizeof(kPcmuFrame), &ts));
98 EXPECT_EQ(0u, ts);
99
Peter Boström0c4e06b2015-10-07 10:23:21100 uint32_t ssrc;
henrike@webrtc.org28e20752013-07-10 00:45:36101 EXPECT_TRUE(GetRtpSsrc(kPcmuFrame, sizeof(kPcmuFrame), &ssrc));
102 EXPECT_EQ(1u, ssrc);
103
104 RtpHeader header;
105 EXPECT_TRUE(GetRtpHeader(kPcmuFrame, sizeof(kPcmuFrame), &header));
106 EXPECT_EQ(0, header.payload_type);
107 EXPECT_EQ(1, header.seq_num);
108 EXPECT_EQ(0u, header.timestamp);
109 EXPECT_EQ(1u, header.ssrc);
110
111 EXPECT_FALSE(GetRtpPayloadType(kInvalidPacket, sizeof(kInvalidPacket), &pt));
112 EXPECT_FALSE(GetRtpSeqNum(kInvalidPacket, sizeof(kInvalidPacket), &seq_num));
113 EXPECT_FALSE(GetRtpTimestamp(kInvalidPacket, sizeof(kInvalidPacket), &ts));
114 EXPECT_FALSE(GetRtpSsrc(kInvalidPacket, sizeof(kInvalidPacket), &ssrc));
115}
116
pkasting@chromium.org0e81fdf2015-02-02 23:54:03117TEST(RtpUtilsTest, SetRtpHeader) {
Yves Gerey665174f2018-06-19 13:03:05118 uint8_t packet[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
119 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
henrike@webrtc.org28e20752013-07-10 00:45:36120
Yves Gerey665174f2018-06-19 13:03:05121 RtpHeader header = {9, 1111, 2222u, 3333u};
pkasting@chromium.org0e81fdf2015-02-02 23:54:03122 EXPECT_TRUE(SetRtpHeader(packet, sizeof(packet), header));
henrike@webrtc.org28e20752013-07-10 00:45:36123
124 // Bits: 10 0 0 0000
125 EXPECT_EQ(128u, packet[0]);
126 size_t len;
127 EXPECT_TRUE(GetRtpHeaderLen(packet, sizeof(packet), &len));
128 EXPECT_EQ(12U, len);
henrike@webrtc.org28e20752013-07-10 00:45:36129 EXPECT_TRUE(GetRtpHeader(packet, sizeof(packet), &header));
130 EXPECT_EQ(9, header.payload_type);
131 EXPECT_EQ(1111, header.seq_num);
132 EXPECT_EQ(2222u, header.timestamp);
133 EXPECT_EQ(3333u, header.ssrc);
henrike@webrtc.org28e20752013-07-10 00:45:36134}
135
136TEST(RtpUtilsTest, GetRtpHeaderLen) {
137 size_t len;
138 EXPECT_TRUE(GetRtpHeaderLen(kPcmuFrame, sizeof(kPcmuFrame), &len));
139 EXPECT_EQ(12U, len);
140
141 EXPECT_TRUE(GetRtpHeaderLen(kRtpPacketWithMarkerAndCsrcAndExtension,
142 sizeof(kRtpPacketWithMarkerAndCsrcAndExtension),
143 &len));
144 EXPECT_EQ(sizeof(kRtpPacketWithMarkerAndCsrcAndExtension), len);
145
146 EXPECT_FALSE(GetRtpHeaderLen(kInvalidPacket, sizeof(kInvalidPacket), &len));
147 EXPECT_FALSE(GetRtpHeaderLen(kInvalidPacketWithCsrc,
148 sizeof(kInvalidPacketWithCsrc), &len));
149 EXPECT_FALSE(GetRtpHeaderLen(kInvalidPacketWithCsrcAndExtension1,
150 sizeof(kInvalidPacketWithCsrcAndExtension1),
151 &len));
152 EXPECT_FALSE(GetRtpHeaderLen(kInvalidPacketWithCsrcAndExtension2,
153 sizeof(kInvalidPacketWithCsrcAndExtension2),
154 &len));
155}
156
157TEST(RtpUtilsTest, GetRtcp) {
158 int pt;
159 EXPECT_TRUE(GetRtcpType(kRtcpReport, sizeof(kRtcpReport), &pt));
160 EXPECT_EQ(0xc9, pt);
161
162 EXPECT_FALSE(GetRtcpType(kInvalidPacket, sizeof(kInvalidPacket), &pt));
163
Peter Boström0c4e06b2015-10-07 10:23:21164 uint32_t ssrc;
henrike@webrtc.org28e20752013-07-10 00:45:36165 EXPECT_TRUE(GetRtcpSsrc(kNonCompoundRtcpPliFeedbackPacket,
Yves Gerey665174f2018-06-19 13:03:05166 sizeof(kNonCompoundRtcpPliFeedbackPacket), &ssrc));
henrike@webrtc.org28e20752013-07-10 00:45:36167 EXPECT_TRUE(GetRtcpSsrc(kNonCompoundRtcpAppPacket,
Yves Gerey665174f2018-06-19 13:03:05168 sizeof(kNonCompoundRtcpAppPacket), &ssrc));
henrike@webrtc.org28e20752013-07-10 00:45:36169 EXPECT_FALSE(GetRtcpSsrc(kNonCompoundRtcpSDESPacket,
Yves Gerey665174f2018-06-19 13:03:05170 sizeof(kNonCompoundRtcpSDESPacket), &ssrc));
henrike@webrtc.org28e20752013-07-10 00:45:36171}
172
Sergey Ulanovdc305db2016-01-15 01:14:54173// Invalid RTP packets.
174TEST(RtpUtilsTest, InvalidRtpHeader) {
175 // Rtp message with invalid length.
176 const uint8_t kRtpMsgWithInvalidLength[] = {
Yves Gerey665174f2018-06-19 13:03:05177 // clang-format off
178 // clang formatting doesn't respect inline comments.
Sergey Ulanovdc305db2016-01-15 01:14:54179 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
180 0xAA, 0xBB, 0xCC, 0XDD, // SSRC
181 0xDD, 0xCC, 0xBB, 0xAA, // Only 1 CSRC, but CC count is 4.
Yves Gerey665174f2018-06-19 13:03:05182 // clang-format on
Sergey Ulanovdc305db2016-01-15 01:14:54183 };
184 EXPECT_FALSE(ValidateRtpHeader(kRtpMsgWithInvalidLength,
185 sizeof(kRtpMsgWithInvalidLength), nullptr));
186
187 // Rtp message with single byte header extension, invalid extension length.
188 const uint8_t kRtpMsgWithInvalidExtnLength[] = {
Yves Gerey665174f2018-06-19 13:03:05189 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
190 0x00, 0x00, 0x00, 0x00, 0xBE, 0xDE, 0x0A, 0x00, // Extn length - 0x0A00
Sergey Ulanovdc305db2016-01-15 01:14:54191 };
192 EXPECT_FALSE(ValidateRtpHeader(kRtpMsgWithInvalidExtnLength,
193 sizeof(kRtpMsgWithInvalidExtnLength),
194 nullptr));
195}
196
197// Valid RTP packet with a 2byte header extension.
198TEST(RtpUtilsTest, Valid2ByteExtnHdrRtpMessage) {
199 EXPECT_TRUE(ValidateRtpHeader(kRtpMsgWith2ByteExtnHeader,
200 sizeof(kRtpMsgWith2ByteExtnHeader), nullptr));
201}
202
203// Valid RTP packet which has 1 byte header AbsSendTime extension in it.
204TEST(RtpUtilsTest, ValidRtpPacketWithAbsSendTimeExtension) {
205 EXPECT_TRUE(ValidateRtpHeader(kRtpMsgWithAbsSendTimeExtension,
206 sizeof(kRtpMsgWithAbsSendTimeExtension),
207 nullptr));
208}
209
210// Verify handling of a 2 byte extension header RTP messsage. Currently these
211// messages are not supported.
212TEST(RtpUtilsTest, UpdateAbsSendTimeExtensionIn2ByteHeaderExtn) {
213 std::vector<uint8_t> data(
214 kRtpMsgWith2ByteExtnHeader,
215 kRtpMsgWith2ByteExtnHeader + sizeof(kRtpMsgWith2ByteExtnHeader));
216 EXPECT_FALSE(UpdateRtpAbsSendTimeExtension(&data[0], data.size(), 3, 0));
217}
218
219// Verify finding an extension ID in the TURN send indication message.
220TEST(RtpUtilsTest, UpdateAbsSendTimeExtensionInTurnSendIndication) {
221 // A valid STUN indication message with a valid RTP header in data attribute
222 // payload field and no extension bit set.
223 uint8_t message_without_extension[] = {
Yves Gerey665174f2018-06-19 13:03:05224 // clang-format off
225 // clang formatting doesn't respect inline comments.
Sergey Ulanovdc305db2016-01-15 01:14:54226 0x00, 0x16, 0x00, 0x18, // length of
227 0x21, 0x12, 0xA4, 0x42, // magic cookie
228 '0', '1', '2', '3', // transaction id
229 '4', '5', '6', '7',
230 '8', '9', 'a', 'b',
231 0x00, 0x20, 0x00, 0x04, // Mapped address.
232 0x00, 0x00, 0x00, 0x00,
233 0x00, 0x13, 0x00, 0x0C, // Data attribute.
234 0x80, 0x00, 0x00, 0x00, // RTP packet.
235 0x00, 0x00, 0x00, 0x00,
236 0x00, 0x00, 0x00, 0x00,
Yves Gerey665174f2018-06-19 13:03:05237 // clang-format on
Sergey Ulanovdc305db2016-01-15 01:14:54238 };
239 EXPECT_TRUE(UpdateRtpAbsSendTimeExtension(
240 message_without_extension, sizeof(message_without_extension), 3, 0));
241
242 // A valid STUN indication message with a valid RTP header and a extension
243 // header.
244 uint8_t message[] = {
Yves Gerey665174f2018-06-19 13:03:05245 // clang-format off
246 // clang formatting doesn't respect inline comments.
Sergey Ulanovdc305db2016-01-15 01:14:54247 0x00, 0x16, 0x00, 0x24, // length of
248 0x21, 0x12, 0xA4, 0x42, // magic cookie
249 '0', '1', '2', '3', // transaction id
250 '4', '5', '6', '7',
251 '8', '9', 'a', 'b',
252 0x00, 0x20, 0x00, 0x04, // Mapped address.
253 0x00, 0x00, 0x00, 0x00,
254 0x00, 0x13, 0x00, 0x18, // Data attribute.
255 0x90, 0x00, 0x00, 0x00, // RTP packet.
256 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBE, 0xDE,
257 0x00, 0x02, 0x22, 0xaa, 0xbb, 0xcc, 0x32, 0xaa, 0xbb, 0xcc,
Yves Gerey665174f2018-06-19 13:03:05258 // clang-format on
Sergey Ulanovdc305db2016-01-15 01:14:54259 };
260 EXPECT_TRUE(UpdateRtpAbsSendTimeExtension(message, sizeof(message), 3, 0));
261}
262
263// Test without any packet options variables set. This method should return
264// without HMAC value in the packet.
265TEST(RtpUtilsTest, ApplyPacketOptionsWithDefaultValues) {
266 rtc::PacketTimeUpdateParams packet_time_params;
267 std::vector<uint8_t> rtp_packet(kRtpMsgWithAbsSendTimeExtension,
268 kRtpMsgWithAbsSendTimeExtension +
269 sizeof(kRtpMsgWithAbsSendTimeExtension));
270 rtp_packet.insert(rtp_packet.end(), kFakeTag, kFakeTag + sizeof(kFakeTag));
271 EXPECT_TRUE(ApplyPacketOptions(&rtp_packet[0], rtp_packet.size(),
272 packet_time_params, 0));
273
274 // Making sure HMAC wasn't updated..
275 EXPECT_EQ(0, memcmp(&rtp_packet[sizeof(kRtpMsgWithAbsSendTimeExtension)],
276 kFakeTag, 4));
277
278 // Verify AbsouluteSendTime extension field wasn't modified.
279 EXPECT_EQ(0, memcmp(&rtp_packet[kAstIndexInRtpMsg], kTestAstValue,
280 sizeof(kTestAstValue)));
281}
282
283// Veirfy HMAC is updated when packet option parameters are set.
284TEST(RtpUtilsTest, ApplyPacketOptionsWithAuthParams) {
285 rtc::PacketTimeUpdateParams packet_time_params;
286 packet_time_params.srtp_auth_key.assign(kTestKey,
287 kTestKey + sizeof(kTestKey));
288 packet_time_params.srtp_auth_tag_len = 4;
289
290 std::vector<uint8_t> rtp_packet(kRtpMsgWithAbsSendTimeExtension,
291 kRtpMsgWithAbsSendTimeExtension +
292 sizeof(kRtpMsgWithAbsSendTimeExtension));
293 rtp_packet.insert(rtp_packet.end(), kFakeTag, kFakeTag + sizeof(kFakeTag));
294 EXPECT_TRUE(ApplyPacketOptions(&rtp_packet[0], rtp_packet.size(),
295 packet_time_params, 0));
296
297 uint8_t kExpectedTag[] = {0xc1, 0x7a, 0x8c, 0xa0};
298 EXPECT_EQ(0, memcmp(&rtp_packet[sizeof(kRtpMsgWithAbsSendTimeExtension)],
299 kExpectedTag, sizeof(kExpectedTag)));
300
301 // Verify AbsouluteSendTime extension field is not modified.
302 EXPECT_EQ(0, memcmp(&rtp_packet[kAstIndexInRtpMsg], kTestAstValue,
303 sizeof(kTestAstValue)));
304}
305
306// Verify finding an extension ID in a raw rtp message.
307TEST(RtpUtilsTest, UpdateAbsSendTimeExtensionInRtpPacket) {
308 std::vector<uint8_t> rtp_packet(kRtpMsgWithAbsSendTimeExtension,
309 kRtpMsgWithAbsSendTimeExtension +
310 sizeof(kRtpMsgWithAbsSendTimeExtension));
311
312 EXPECT_TRUE(UpdateRtpAbsSendTimeExtension(&rtp_packet[0], rtp_packet.size(),
313 3, 51183266));
314
315 // Verify that the timestamp was updated.
316 const uint8_t kExpectedTimestamp[3] = {0xcc, 0xbb, 0xaa};
317 EXPECT_EQ(0, memcmp(&rtp_packet[kAstIndexInRtpMsg], kExpectedTimestamp,
318 sizeof(kExpectedTimestamp)));
319}
320
321// Verify we update both AbsSendTime extension header and HMAC.
322TEST(RtpUtilsTest, ApplyPacketOptionsWithAuthParamsAndAbsSendTime) {
323 rtc::PacketTimeUpdateParams packet_time_params;
324 packet_time_params.srtp_auth_key.assign(kTestKey,
325 kTestKey + sizeof(kTestKey));
326 packet_time_params.srtp_auth_tag_len = 4;
327 packet_time_params.rtp_sendtime_extension_id = 3;
328 // 3 is also present in the test message.
329
330 std::vector<uint8_t> rtp_packet(kRtpMsgWithAbsSendTimeExtension,
331 kRtpMsgWithAbsSendTimeExtension +
332 sizeof(kRtpMsgWithAbsSendTimeExtension));
333 rtp_packet.insert(rtp_packet.end(), kFakeTag, kFakeTag + sizeof(kFakeTag));
334 EXPECT_TRUE(ApplyPacketOptions(&rtp_packet[0], rtp_packet.size(),
335 packet_time_params, 51183266));
336
337 const uint8_t kExpectedTag[] = {0x81, 0xd1, 0x2c, 0x0e};
338 EXPECT_EQ(0, memcmp(&rtp_packet[sizeof(kRtpMsgWithAbsSendTimeExtension)],
339 kExpectedTag, sizeof(kExpectedTag)));
340
341 // Verify that the timestamp was updated.
342 const uint8_t kExpectedTimestamp[3] = {0xcc, 0xbb, 0xaa};
343 EXPECT_EQ(0, memcmp(&rtp_packet[kAstIndexInRtpMsg], kExpectedTimestamp,
344 sizeof(kExpectedTimestamp)));
345}
346
henrike@webrtc.org28e20752013-07-10 00:45:36347} // namespace cricket