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

Side by Side Diff: media/cast/test/end2end_unittest.cc

Issue 308043006: [Cast] Clean-up: Merge RtpReceiver+AudioReceiver+VideoReceiver-->FrameReceiver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed hclam's comments. Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « media/cast/rtp_receiver/rtp_receiver.cc ('k') | media/cast/test/utility/in_process_receiver.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This test generate synthetic data. For audio it's a sinusoid waveform with 5 // This test generate synthetic data. For audio it's a sinusoid waveform with
6 // frequency kSoundFrequency and different amplitudes. For video it's a pattern 6 // frequency kSoundFrequency and different amplitudes. For video it's a pattern
7 // that is shifting by one pixel per frame, each pixels neighbors right and down 7 // that is shifting by one pixel per frame, each pixels neighbors right and down
8 // is this pixels value +1, since the pixel value is 8 bit it will wrap 8 // is this pixels value +1, since the pixel value is 8 bit it will wrap
9 // frequently within the image. Visually this will create diagonally color bands 9 // frequently within the image. Visually this will create diagonally color bands
10 // that moves across the screen 10 // that moves across the screen
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 test_receiver_audio_callback_->AddExpectedResult( 559 test_receiver_audio_callback_->AddExpectedResult(
560 *audio_bus, 560 *audio_bus,
561 capture_time + delay + 561 capture_time + delay +
562 base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs)); 562 base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs));
563 audio_frame_input_->InsertAudio(audio_bus.Pass(), capture_time); 563 audio_frame_input_->InsertAudio(audio_bus.Pass(), capture_time);
564 } 564 }
565 } 565 }
566 566
567 void RequestAudioFrames(int count, bool with_check) { 567 void RequestAudioFrames(int count, bool with_check) {
568 for (int i = 0; i < count; ++i) { 568 for (int i = 0; i < count; ++i) {
569 frame_receiver_->GetRawAudioFrame( 569 cast_receiver_->RequestDecodedAudioFrame(
570 base::Bind(with_check ? &TestReceiverAudioCallback::CheckAudioFrame : 570 base::Bind(with_check ? &TestReceiverAudioCallback::CheckAudioFrame :
571 &TestReceiverAudioCallback::IgnoreAudioFrame, 571 &TestReceiverAudioCallback::IgnoreAudioFrame,
572 test_receiver_audio_callback_)); 572 test_receiver_audio_callback_));
573 } 573 }
574 } 574 }
575 575
576 void Create() { 576 void Create() {
577 cast_receiver_ = CastReceiver::Create(cast_environment_receiver_, 577 cast_receiver_ = CastReceiver::Create(cast_environment_receiver_,
578 audio_receiver_config_, 578 audio_receiver_config_,
579 video_receiver_config_, 579 video_receiver_config_,
(...skipping 24 matching lines...) Expand all
604 receiver_to_sender_.SetPacketReceiver(cast_sender_->packet_receiver(), 604 receiver_to_sender_.SetPacketReceiver(cast_sender_->packet_receiver(),
605 task_runner_, 605 task_runner_,
606 &testing_clock_); 606 &testing_clock_);
607 sender_to_receiver_.SetPacketReceiver(cast_receiver_->packet_receiver(), 607 sender_to_receiver_.SetPacketReceiver(cast_receiver_->packet_receiver(),
608 task_runner_, 608 task_runner_,
609 &testing_clock_); 609 &testing_clock_);
610 610
611 audio_frame_input_ = cast_sender_->audio_frame_input(); 611 audio_frame_input_ = cast_sender_->audio_frame_input();
612 video_frame_input_ = cast_sender_->video_frame_input(); 612 video_frame_input_ = cast_sender_->video_frame_input();
613 613
614 frame_receiver_ = cast_receiver_->frame_receiver();
615
616 audio_bus_factory_.reset( 614 audio_bus_factory_.reset(
617 new TestAudioBusFactory(audio_sender_config_.channels, 615 new TestAudioBusFactory(audio_sender_config_.channels,
618 audio_sender_config_.frequency, 616 audio_sender_config_.frequency,
619 kSoundFrequency, 617 kSoundFrequency,
620 kSoundVolume)); 618 kSoundVolume));
621 } 619 }
622 620
623 virtual ~End2EndTest() { 621 virtual ~End2EndTest() {
624 cast_environment_sender_->Logging()->RemoveRawEventSubscriber( 622 cast_environment_sender_->Logging()->RemoveRawEventSubscriber(
625 &event_subscriber_sender_); 623 &event_subscriber_sender_);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 EXPECT_GE(max_video_playout_curvature_.InMicroseconds(), 675 EXPECT_GE(max_video_playout_curvature_.InMicroseconds(),
678 abs_curvature.InMicroseconds()); 676 abs_curvature.InMicroseconds());
679 } 677 }
680 last_video_playout_delta_ = delta; 678 last_video_playout_delta_ = delta;
681 } 679 }
682 last_video_playout_time_ = playout_time; 680 last_video_playout_time_ = playout_time;
683 681
684 video_ticks_.push_back(std::make_pair( 682 video_ticks_.push_back(std::make_pair(
685 testing_clock_receiver_->NowTicks(), 683 testing_clock_receiver_->NowTicks(),
686 playout_time)); 684 playout_time));
687 frame_receiver_->GetRawVideoFrame( 685 cast_receiver_->RequestDecodedVideoFrame(
688 base::Bind(&End2EndTest::BasicPlayerGotVideoFrame, 686 base::Bind(&End2EndTest::BasicPlayerGotVideoFrame,
689 base::Unretained(this))); 687 base::Unretained(this)));
690 } 688 }
691 689
692 void BasicPlayerGotAudioFrame(scoped_ptr<AudioBus> audio_bus, 690 void BasicPlayerGotAudioFrame(scoped_ptr<AudioBus> audio_bus,
693 const base::TimeTicks& playout_time, 691 const base::TimeTicks& playout_time,
694 bool is_continuous) { 692 bool is_continuous) {
695 VLOG_IF(1, !last_audio_playout_time_.is_null()) 693 VLOG_IF(1, !last_audio_playout_time_.is_null())
696 << "Audio frame playout time delta (compared to last frame) is " 694 << "Audio frame playout time delta (compared to last frame) is "
697 << (playout_time - last_audio_playout_time_).InMicroseconds() 695 << (playout_time - last_audio_playout_time_).InMicroseconds()
698 << " usec."; 696 << " usec.";
699 last_audio_playout_time_ = playout_time; 697 last_audio_playout_time_ = playout_time;
700 698
701 audio_ticks_.push_back(std::make_pair( 699 audio_ticks_.push_back(std::make_pair(
702 testing_clock_receiver_->NowTicks(), 700 testing_clock_receiver_->NowTicks(),
703 playout_time)); 701 playout_time));
704 frame_receiver_->GetRawAudioFrame( 702 cast_receiver_->RequestDecodedAudioFrame(
705 base::Bind(&End2EndTest::BasicPlayerGotAudioFrame, 703 base::Bind(&End2EndTest::BasicPlayerGotAudioFrame,
706 base::Unretained(this))); 704 base::Unretained(this)));
707 } 705 }
708 706
709 void StartBasicPlayer() { 707 void StartBasicPlayer() {
710 frame_receiver_->GetRawVideoFrame( 708 cast_receiver_->RequestDecodedVideoFrame(
711 base::Bind(&End2EndTest::BasicPlayerGotVideoFrame, 709 base::Bind(&End2EndTest::BasicPlayerGotVideoFrame,
712 base::Unretained(this))); 710 base::Unretained(this)));
713 frame_receiver_->GetRawAudioFrame( 711 cast_receiver_->RequestDecodedAudioFrame(
714 base::Bind(&End2EndTest::BasicPlayerGotAudioFrame, 712 base::Bind(&End2EndTest::BasicPlayerGotAudioFrame,
715 base::Unretained(this))); 713 base::Unretained(this)));
716 } 714 }
717 715
718 void LogRawEvents(const std::vector<PacketEvent>& packet_events) { 716 void LogRawEvents(const std::vector<PacketEvent>& packet_events) {
719 EXPECT_FALSE(packet_events.empty()); 717 EXPECT_FALSE(packet_events.empty());
720 for (std::vector<media::cast::PacketEvent>::const_iterator it = 718 for (std::vector<media::cast::PacketEvent>::const_iterator it =
721 packet_events.begin(); 719 packet_events.begin();
722 it != packet_events.end(); 720 it != packet_events.end();
723 ++it) { 721 ++it) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 scoped_refptr<CastEnvironment> cast_environment_receiver_; 759 scoped_refptr<CastEnvironment> cast_environment_receiver_;
762 760
763 LoopBackTransport receiver_to_sender_; 761 LoopBackTransport receiver_to_sender_;
764 LoopBackTransport sender_to_receiver_; 762 LoopBackTransport sender_to_receiver_;
765 scoped_ptr<transport::CastTransportSenderImpl> transport_sender_; 763 scoped_ptr<transport::CastTransportSenderImpl> transport_sender_;
766 764
767 scoped_ptr<CastReceiver> cast_receiver_; 765 scoped_ptr<CastReceiver> cast_receiver_;
768 scoped_ptr<CastSender> cast_sender_; 766 scoped_ptr<CastSender> cast_sender_;
769 scoped_refptr<AudioFrameInput> audio_frame_input_; 767 scoped_refptr<AudioFrameInput> audio_frame_input_;
770 scoped_refptr<VideoFrameInput> video_frame_input_; 768 scoped_refptr<VideoFrameInput> video_frame_input_;
771 scoped_refptr<FrameReceiver> frame_receiver_;
772 769
773 scoped_refptr<TestReceiverAudioCallback> test_receiver_audio_callback_; 770 scoped_refptr<TestReceiverAudioCallback> test_receiver_audio_callback_;
774 scoped_refptr<TestReceiverVideoCallback> test_receiver_video_callback_; 771 scoped_refptr<TestReceiverVideoCallback> test_receiver_video_callback_;
775 772
776 scoped_ptr<TestAudioBusFactory> audio_bus_factory_; 773 scoped_ptr<TestAudioBusFactory> audio_bus_factory_;
777 774
778 SimpleEventSubscriber event_subscriber_sender_; 775 SimpleEventSubscriber event_subscriber_sender_;
779 std::vector<FrameEvent> frame_events_; 776 std::vector<FrameEvent> frame_events_;
780 std::vector<PacketEvent> packet_events_; 777 std::vector<PacketEvent> packet_events_;
781 std::vector<std::pair<base::TimeTicks, base::TimeTicks> > audio_ticks_; 778 std::vector<std::pair<base::TimeTicks, base::TimeTicks> > audio_ticks_;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 SendVideoFrame(video_start, testing_clock_sender_->NowTicks()); 810 SendVideoFrame(video_start, testing_clock_sender_->NowTicks());
814 811
815 if (num_audio_frames > 0) 812 if (num_audio_frames > 0)
816 RunTasks(kAudioFrameDurationMs); // Advance clock forward. 813 RunTasks(kAudioFrameDurationMs); // Advance clock forward.
817 if (num_audio_frames > 1) 814 if (num_audio_frames > 1)
818 FeedAudioFrames(num_audio_frames - 1, true); 815 FeedAudioFrames(num_audio_frames - 1, true);
819 816
820 RequestAudioFrames(num_audio_frames, true); 817 RequestAudioFrames(num_audio_frames, true);
821 num_audio_frames_requested += num_audio_frames; 818 num_audio_frames_requested += num_audio_frames;
822 819
823 frame_receiver_->GetRawVideoFrame( 820 cast_receiver_->RequestDecodedVideoFrame(
824 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, 821 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame,
825 test_receiver_video_callback_)); 822 test_receiver_video_callback_));
826 823
827 RunTasks(kFrameTimerMs - kAudioFrameDurationMs); 824 RunTasks(kFrameTimerMs - kAudioFrameDurationMs);
828 audio_diff += kFrameTimerMs; 825 audio_diff += kFrameTimerMs;
829 video_start++; 826 video_start++;
830 } 827 }
831 828
832 RunTasks(2 * kFrameTimerMs + 1); // Empty the receiver pipeline. 829 RunTasks(2 * kFrameTimerMs + 1); // Empty the receiver pipeline.
833 EXPECT_EQ(num_audio_frames_requested, 830 EXPECT_EQ(num_audio_frames_requested,
834 test_receiver_audio_callback_->number_times_called()); 831 test_receiver_audio_callback_->number_times_called());
835 EXPECT_EQ(kNumIterations, 832 EXPECT_EQ(kNumIterations,
836 test_receiver_video_callback_->number_times_called()); 833 test_receiver_video_callback_->number_times_called());
837 } 834 }
838 835
839 // This tests our external decoder interface for Audio. 836 // This tests our external decoder interface for Audio.
840 // Audio test without packet loss using raw PCM 16 audio "codec"; 837 // Audio test without packet loss using raw PCM 16 audio "codec";
841 TEST_F(End2EndTest, LoopNoLossPcm16ExternalDecoder) { 838 TEST_F(End2EndTest, LoopNoLossPcm16ExternalDecoder) {
842 Configure(transport::kVp8, transport::kPcm16, 32000, 1); 839 Configure(transport::kVp8, transport::kPcm16, 32000, 1);
843 Create(); 840 Create();
844 841
845 const int kNumIterations = 10; 842 const int kNumIterations = 10;
846 for (int i = 0; i < kNumIterations; ++i) { 843 for (int i = 0; i < kNumIterations; ++i) {
847 FeedAudioFrames(1, true); 844 FeedAudioFrames(1, true);
848 RunTasks(kAudioFrameDurationMs); 845 RunTasks(kAudioFrameDurationMs);
849 frame_receiver_->GetCodedAudioFrame( 846 cast_receiver_->RequestEncodedAudioFrame(
850 base::Bind(&TestReceiverAudioCallback::CheckCodedAudioFrame, 847 base::Bind(&TestReceiverAudioCallback::CheckCodedAudioFrame,
851 test_receiver_audio_callback_)); 848 test_receiver_audio_callback_));
852 } 849 }
853 RunTasks(2 * kFrameTimerMs + 1); // Empty the receiver pipeline. 850 RunTasks(2 * kFrameTimerMs + 1); // Empty the receiver pipeline.
854 EXPECT_EQ(kNumIterations, 851 EXPECT_EQ(kNumIterations,
855 test_receiver_audio_callback_->number_times_called()); 852 test_receiver_audio_callback_->number_times_called());
856 } 853 }
857 854
858 // This tests our Opus audio codec without video. 855 // This tests our Opus audio codec without video.
859 TEST_F(End2EndTest, LoopNoLossOpus) { 856 TEST_F(End2EndTest, LoopNoLossOpus) {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 SendVideoFrame(video_start, testing_clock_sender_->NowTicks()); 944 SendVideoFrame(video_start, testing_clock_sender_->NowTicks());
948 945
949 if (num_audio_frames > 0) 946 if (num_audio_frames > 0)
950 RunTasks(kAudioFrameDurationMs); // Advance clock forward. 947 RunTasks(kAudioFrameDurationMs); // Advance clock forward.
951 if (num_audio_frames > 1) 948 if (num_audio_frames > 1)
952 FeedAudioFrames(num_audio_frames - 1, true); 949 FeedAudioFrames(num_audio_frames - 1, true);
953 950
954 RequestAudioFrames(num_audio_frames, true); 951 RequestAudioFrames(num_audio_frames, true);
955 num_audio_frames_requested += num_audio_frames; 952 num_audio_frames_requested += num_audio_frames;
956 953
957 frame_receiver_->GetRawVideoFrame( 954 cast_receiver_->RequestDecodedVideoFrame(
958 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, 955 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame,
959 test_receiver_video_callback_)); 956 test_receiver_video_callback_));
960 957
961 RunTasks(kFrameTimerMs - kAudioFrameDurationMs); 958 RunTasks(kFrameTimerMs - kAudioFrameDurationMs);
962 audio_diff += kFrameTimerMs; 959 audio_diff += kFrameTimerMs;
963 video_start++; 960 video_start++;
964 } 961 }
965 RunTasks(2 * kFrameTimerMs + 1); // Empty the receiver pipeline. 962 RunTasks(2 * kFrameTimerMs + 1); // Empty the receiver pipeline.
966 EXPECT_EQ(num_audio_frames_requested, 963 EXPECT_EQ(num_audio_frames_requested,
967 test_receiver_audio_callback_->number_times_called()); 964 test_receiver_audio_callback_->number_times_called());
(...skipping 15 matching lines...) Expand all
983 const int frames_before_glitch = 20; 980 const int frames_before_glitch = 20;
984 for (int i = 0; i < frames_before_glitch; ++i) { 981 for (int i = 0; i < frames_before_glitch; ++i) {
985 capture_time = testing_clock_sender_->NowTicks(); 982 capture_time = testing_clock_sender_->NowTicks();
986 SendVideoFrame(video_start, capture_time); 983 SendVideoFrame(video_start, capture_time);
987 test_receiver_video_callback_->AddExpectedResult( 984 test_receiver_video_callback_->AddExpectedResult(
988 video_start, 985 video_start,
989 video_sender_config_.width, 986 video_sender_config_.width,
990 video_sender_config_.height, 987 video_sender_config_.height,
991 capture_time + base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs), 988 capture_time + base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs),
992 true); 989 true);
993 frame_receiver_->GetRawVideoFrame( 990 cast_receiver_->RequestDecodedVideoFrame(
994 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, 991 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame,
995 test_receiver_video_callback_)); 992 test_receiver_video_callback_));
996 RunTasks(kFrameTimerMs); 993 RunTasks(kFrameTimerMs);
997 video_start++; 994 video_start++;
998 } 995 }
999 996
1000 // Introduce a glitch lasting for 10 frames. 997 // Introduce a glitch lasting for 10 frames.
1001 sender_to_receiver_.SetSendPackets(false); 998 sender_to_receiver_.SetSendPackets(false);
1002 for (int i = 0; i < 10; ++i) { 999 for (int i = 0; i < 10; ++i) {
1003 capture_time = testing_clock_sender_->NowTicks(); 1000 capture_time = testing_clock_sender_->NowTicks();
(...skipping 12 matching lines...) Expand all
1016 1013
1017 // Frames 1-3 are old frames by now, and therefore should be decoded, but 1014 // Frames 1-3 are old frames by now, and therefore should be decoded, but
1018 // not rendered. The next frame we expect to render is frame #4. 1015 // not rendered. The next frame we expect to render is frame #4.
1019 test_receiver_video_callback_->AddExpectedResult( 1016 test_receiver_video_callback_->AddExpectedResult(
1020 video_start, 1017 video_start,
1021 video_sender_config_.width, 1018 video_sender_config_.width,
1022 video_sender_config_.height, 1019 video_sender_config_.height,
1023 capture_time + base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs), 1020 capture_time + base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs),
1024 true); 1021 true);
1025 1022
1026 frame_receiver_->GetRawVideoFrame( 1023 cast_receiver_->RequestDecodedVideoFrame(
1027 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, 1024 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame,
1028 test_receiver_video_callback_)); 1025 test_receiver_video_callback_));
1029 1026
1030 RunTasks(2 * kFrameTimerMs + 1); // Empty the receiver pipeline. 1027 RunTasks(2 * kFrameTimerMs + 1); // Empty the receiver pipeline.
1031 EXPECT_EQ(frames_before_glitch + 1, 1028 EXPECT_EQ(frames_before_glitch + 1,
1032 test_receiver_video_callback_->number_times_called()); 1029 test_receiver_video_callback_->number_times_called());
1033 } 1030 }
1034 1031
1035 // Disabled due to flakiness and crashiness. http://crbug.com/360951 1032 // Disabled due to flakiness and crashiness. http://crbug.com/360951
1036 TEST_F(End2EndTest, DISABLED_DropEveryOtherFrame3Buffers) { 1033 TEST_F(End2EndTest, DISABLED_DropEveryOtherFrame3Buffers) {
(...skipping 15 matching lines...) Expand all
1052 test_receiver_video_callback_->AddExpectedResult( 1049 test_receiver_video_callback_->AddExpectedResult(
1053 video_start, 1050 video_start,
1054 video_sender_config_.width, 1051 video_sender_config_.width,
1055 video_sender_config_.height, 1052 video_sender_config_.height,
1056 capture_time + 1053 capture_time +
1057 base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs), 1054 base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs),
1058 i == 0); 1055 i == 0);
1059 1056
1060 // GetRawVideoFrame will not return the frame until we are close in 1057 // GetRawVideoFrame will not return the frame until we are close in
1061 // time before we should render the frame. 1058 // time before we should render the frame.
1062 frame_receiver_->GetRawVideoFrame( 1059 cast_receiver_->RequestDecodedVideoFrame(
1063 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, 1060 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame,
1064 test_receiver_video_callback_)); 1061 test_receiver_video_callback_));
1065 } 1062 }
1066 RunTasks(kFrameTimerMs); 1063 RunTasks(kFrameTimerMs);
1067 video_start++; 1064 video_start++;
1068 } 1065 }
1069 1066
1070 RunTasks(2 * kFrameTimerMs + 1); // Empty the pipeline. 1067 RunTasks(2 * kFrameTimerMs + 1); // Empty the pipeline.
1071 EXPECT_EQ(i / 2, test_receiver_video_callback_->number_times_called()); 1068 EXPECT_EQ(i / 2, test_receiver_video_callback_->number_times_called());
1072 } 1069 }
(...skipping 20 matching lines...) Expand all
1093 1090
1094 test_receiver_video_callback_->AddExpectedResult( 1091 test_receiver_video_callback_->AddExpectedResult(
1095 frames_counter, 1092 frames_counter,
1096 video_sender_config_.width, 1093 video_sender_config_.width,
1097 video_sender_config_.height, 1094 video_sender_config_.height,
1098 capture_time + base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs), 1095 capture_time + base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs),
1099 true); 1096 true);
1100 1097
1101 RunTasks(kFrameTimerMs); 1098 RunTasks(kFrameTimerMs);
1102 1099
1103 frame_receiver_->GetRawVideoFrame( 1100 cast_receiver_->RequestDecodedVideoFrame(
1104 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, 1101 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame,
1105 test_receiver_video_callback_)); 1102 test_receiver_video_callback_));
1106 } 1103 }
1107 RunTasks(2 * kFrameTimerMs + 1); // Empty the pipeline. 1104 RunTasks(2 * kFrameTimerMs + 1); // Empty the pipeline.
1108 EXPECT_EQ(frames_counter, 1105 EXPECT_EQ(frames_counter,
1109 test_receiver_video_callback_->number_times_called()); 1106 test_receiver_video_callback_->number_times_called());
1110 } 1107 }
1111 1108
1112 TEST_F(End2EndTest, CryptoAudio) { 1109 TEST_F(End2EndTest, CryptoAudio) {
1113 Configure(transport::kVp8, transport::kPcm16, 32000, 1); 1110 Configure(transport::kVp8, transport::kPcm16, 32000, 1);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 test_receiver_video_callback_->AddExpectedResult( 1146 test_receiver_video_callback_->AddExpectedResult(
1150 video_start, 1147 video_start,
1151 video_sender_config_.width, 1148 video_sender_config_.width,
1152 video_sender_config_.height, 1149 video_sender_config_.height,
1153 capture_time + base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs), 1150 capture_time + base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs),
1154 true); 1151 true);
1155 1152
1156 SendVideoFrame(video_start, capture_time); 1153 SendVideoFrame(video_start, capture_time);
1157 RunTasks(kFrameTimerMs); 1154 RunTasks(kFrameTimerMs);
1158 1155
1159 frame_receiver_->GetRawVideoFrame( 1156 cast_receiver_->RequestDecodedVideoFrame(
1160 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, 1157 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame,
1161 test_receiver_video_callback_)); 1158 test_receiver_video_callback_));
1162 1159
1163 video_start++; 1160 video_start++;
1164 } 1161 }
1165 1162
1166 // Basic tests. 1163 // Basic tests.
1167 RunTasks(2 * kFrameTimerMs + 1); // Empty the receiver pipeline. 1164 RunTasks(2 * kFrameTimerMs + 1); // Empty the receiver pipeline.
1168 int num_callbacks_called = 1165 int num_callbacks_called =
1169 test_receiver_video_callback_->number_times_called(); 1166 test_receiver_video_callback_->number_times_called();
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
1430 EXPECT_LT((video_ticks_.back().second - test_end).InMilliseconds(), 1000); 1427 EXPECT_LT((video_ticks_.back().second - test_end).InMilliseconds(), 1000);
1431 } 1428 }
1432 1429
1433 // TODO(pwestin): Add repeatable packet loss test. 1430 // TODO(pwestin): Add repeatable packet loss test.
1434 // TODO(pwestin): Add test for misaligned send get calls. 1431 // TODO(pwestin): Add test for misaligned send get calls.
1435 // TODO(pwestin): Add more tests that does not resample. 1432 // TODO(pwestin): Add more tests that does not resample.
1436 // TODO(pwestin): Add test when we have starvation for our RunTask. 1433 // TODO(pwestin): Add test when we have starvation for our RunTask.
1437 1434
1438 } // namespace cast 1435 } // namespace cast
1439 } // namespace media 1436 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/rtp_receiver/rtp_receiver.cc ('k') | media/cast/test/utility/in_process_receiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698