OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 return true; | 61 return true; |
62 } | 62 } |
63 | 63 |
64 void RtpFormatVp8TestHelper::GetAllPacketsAndCheck( | 64 void RtpFormatVp8TestHelper::GetAllPacketsAndCheck( |
65 RtpPacketizerVp8* packetizer, | 65 RtpPacketizerVp8* packetizer, |
66 const size_t* expected_sizes, | 66 const size_t* expected_sizes, |
67 const int* expected_part, | 67 const int* expected_part, |
68 const bool* expected_frag_start, | 68 const bool* expected_frag_start, |
69 size_t expected_num_packets) { | 69 size_t expected_num_packets) { |
70 ASSERT_TRUE(inited_); | 70 ASSERT_TRUE(inited_); |
71 bool last = false; | |
72 for (size_t i = 0; i < expected_num_packets; ++i) { | 71 for (size_t i = 0; i < expected_num_packets; ++i) { |
73 std::ostringstream ss; | 72 std::ostringstream ss; |
74 ss << "Checking packet " << i; | 73 ss << "Checking packet " << i; |
75 SCOPED_TRACE(ss.str()); | 74 SCOPED_TRACE(ss.str()); |
76 EXPECT_TRUE(packetizer->NextPacket(&packet_, &last)); | 75 EXPECT_TRUE(packetizer->NextPacket(&packet_)); |
77 CheckPacket(expected_sizes[i], last, expected_frag_start[i]); | 76 CheckPacket(expected_sizes[i], i + 1 == expected_num_packets, |
| 77 expected_frag_start[i]); |
78 } | 78 } |
79 EXPECT_TRUE(last); | |
80 } | 79 } |
81 | 80 |
82 // Payload descriptor | 81 // Payload descriptor |
83 // 0 1 2 3 4 5 6 7 | 82 // 0 1 2 3 4 5 6 7 |
84 // +-+-+-+-+-+-+-+-+ | 83 // +-+-+-+-+-+-+-+-+ |
85 // |X|R|N|S|PartID | (REQUIRED) | 84 // |X|R|N|S|PartID | (REQUIRED) |
86 // +-+-+-+-+-+-+-+-+ | 85 // +-+-+-+-+-+-+-+-+ |
87 // X: |I|L|T|K| RSV | (OPTIONAL) | 86 // X: |I|L|T|K| RSV | (OPTIONAL) |
88 // +-+-+-+-+-+-+-+-+ | 87 // +-+-+-+-+-+-+-+-+ |
89 // I: | PictureID | (OPTIONAL) | 88 // I: | PictureID | (OPTIONAL) |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 bool frag_start) { | 240 bool frag_start) { |
242 EXPECT_EQ(expect_bytes, packet_.payload_size()); | 241 EXPECT_EQ(expect_bytes, packet_.payload_size()); |
243 CheckHeader(frag_start); | 242 CheckHeader(frag_start); |
244 CheckPayload(); | 243 CheckPayload(); |
245 CheckLast(last); | 244 CheckLast(last); |
246 } | 245 } |
247 | 246 |
248 } // namespace test | 247 } // namespace test |
249 | 248 |
250 } // namespace webrtc | 249 } // namespace webrtc |
OLD | NEW |