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

Side by Side Diff: webrtc/video/rtp_stream_receiver_unittest.cc

Issue 2763813003: Allow padding packet in video streams. (Closed)
Patch Set: Added comment. Created 3 years, 9 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
« no previous file with comments | « webrtc/video/rtp_stream_receiver.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 data.insert(data.end(), {1, 2, 3}); 289 data.insert(data.end(), {1, 2, 3});
290 mock_on_complete_frame_callback_.AppendExpectedBitstream( 290 mock_on_complete_frame_callback_.AppendExpectedBitstream(
291 kH264StartCode, sizeof(kH264StartCode)); 291 kH264StartCode, sizeof(kH264StartCode));
292 mock_on_complete_frame_callback_.AppendExpectedBitstream(data.data(), 292 mock_on_complete_frame_callback_.AppendExpectedBitstream(data.data(),
293 data.size()); 293 data.size());
294 EXPECT_CALL(mock_on_complete_frame_callback_, DoOnCompleteFrame(_)); 294 EXPECT_CALL(mock_on_complete_frame_callback_, DoOnCompleteFrame(_));
295 rtp_stream_receiver_->OnReceivedPayloadData(data.data(), data.size(), 295 rtp_stream_receiver_->OnReceivedPayloadData(data.data(), data.size(),
296 &idr_packet); 296 &idr_packet);
297 } 297 }
298 298
299 TEST_F(RtpStreamReceiverTest, PaddingInMediaStream) {
300 WebRtcRTPHeader header = GetDefaultPacket();
301 std::vector<uint8_t> data;
302 data.insert(data.end(), {1, 2, 3});
303 header.header.payloadType = 99;
304 header.type.Video.is_first_packet_in_frame = true;
305 header.header.sequenceNumber = 2;
306 header.header.markerBit = true;
307 header.frameType = kVideoFrameKey;
308 header.type.Video.codec = kRtpVideoGeneric;
309 mock_on_complete_frame_callback_.AppendExpectedBitstream(data.data(),
310 data.size());
311
312 EXPECT_CALL(mock_on_complete_frame_callback_, DoOnCompleteFrame(_));
313 rtp_stream_receiver_->OnReceivedPayloadData(data.data(), data.size(),
314 &header);
315
316 header.header.sequenceNumber = 3;
317 rtp_stream_receiver_->OnReceivedPayloadData(nullptr, 0, &header);
318
319 header.frameType = kVideoFrameDelta;
320 header.header.sequenceNumber = 4;
321 EXPECT_CALL(mock_on_complete_frame_callback_, DoOnCompleteFrame(_));
322 rtp_stream_receiver_->OnReceivedPayloadData(data.data(), data.size(),
323 &header);
324
325 header.header.sequenceNumber = 6;
326 rtp_stream_receiver_->OnReceivedPayloadData(data.data(), data.size(),
327 &header);
328
329 EXPECT_CALL(mock_on_complete_frame_callback_, DoOnCompleteFrame(_));
330 header.header.sequenceNumber = 5;
331 rtp_stream_receiver_->OnReceivedPayloadData(nullptr, 0, &header);
332 }
333
299 } // namespace webrtc 334 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/rtp_stream_receiver.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698