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

Side by Side Diff: webrtc/modules/video_coding/video_packet_buffer_unittest.cc

Issue 2902743002: Cast sequence number in RtpFrameObject. (Closed)
Patch Set: 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
« no previous file with comments | « webrtc/modules/video_coding/frame_object.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 (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 } 495 }
496 496
497 packet.seqNum = kStartSize - 1; 497 packet.seqNum = kStartSize - 1;
498 packet.markerBit = true; 498 packet.markerBit = true;
499 packet_buffer_->InsertPacket(&packet); 499 packet_buffer_->InsertPacket(&packet);
500 500
501 EXPECT_EQ(1UL, frames_from_callback_.size()); 501 EXPECT_EQ(1UL, frames_from_callback_.size());
502 CheckFrame(0); 502 CheckFrame(0);
503 } 503 }
504 504
505 TEST_F(TestPacketBuffer, OneH264FrameMaxSeqNum) {
506 VCMPacket packet;
507 packet.seqNum = 65534;
508 packet.codec = kVideoCodecH264;
509 packet.dataPtr = nullptr;
510 packet.sizeBytes = 0;
511 packet.is_first_packet_in_frame = true;
512 packet.markerBit = false;
513 packet_buffer_->InsertPacket(&packet);
514
515 packet.is_first_packet_in_frame = false;
516 packet.seqNum = 65535;
517 packet.markerBit = true;
518 packet_buffer_->InsertPacket(&packet);
519
520 EXPECT_EQ(1UL, frames_from_callback_.size());
521 CheckFrame(65534);
522 }
523
505 TEST_F(TestPacketBuffer, PacketTimestamps) { 524 TEST_F(TestPacketBuffer, PacketTimestamps) {
506 rtc::Optional<int64_t> packet_ms; 525 rtc::Optional<int64_t> packet_ms;
507 rtc::Optional<int64_t> packet_keyframe_ms; 526 rtc::Optional<int64_t> packet_keyframe_ms;
508 527
509 packet_ms = packet_buffer_->LastReceivedPacketMs(); 528 packet_ms = packet_buffer_->LastReceivedPacketMs();
510 packet_keyframe_ms = packet_buffer_->LastReceivedKeyframePacketMs(); 529 packet_keyframe_ms = packet_buffer_->LastReceivedKeyframePacketMs();
511 EXPECT_FALSE(packet_ms); 530 EXPECT_FALSE(packet_ms);
512 EXPECT_FALSE(packet_keyframe_ms); 531 EXPECT_FALSE(packet_keyframe_ms);
513 532
514 int64_t keyframe_ms = clock_->TimeInMilliseconds(); 533 int64_t keyframe_ms = clock_->TimeInMilliseconds();
(...skipping 17 matching lines...) Expand all
532 551
533 packet_buffer_->Clear(); 552 packet_buffer_->Clear();
534 packet_ms = packet_buffer_->LastReceivedPacketMs(); 553 packet_ms = packet_buffer_->LastReceivedPacketMs();
535 packet_keyframe_ms = packet_buffer_->LastReceivedKeyframePacketMs(); 554 packet_keyframe_ms = packet_buffer_->LastReceivedKeyframePacketMs();
536 EXPECT_FALSE(packet_ms); 555 EXPECT_FALSE(packet_ms);
537 EXPECT_FALSE(packet_keyframe_ms); 556 EXPECT_FALSE(packet_keyframe_ms);
538 } 557 }
539 558
540 } // namespace video_coding 559 } // namespace video_coding
541 } // namespace webrtc 560 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/frame_object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698