Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(642)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_format_vp8_test_helper.cc

Issue 2871173008: Fix packetization logic to leave space for extensions in the last packet (Closed)
Patch Set: Impelement Danilchap@ comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_format_vp8.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_format_vp8_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698