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

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

Issue 2048033003: Refactoring: CastTransport InitializeAudio/InitializeVideo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. Rebased. Created 4 years, 5 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 // 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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 462
463 test_receiver_audio_callback_->SetExpectedSamplingFrequency( 463 test_receiver_audio_callback_->SetExpectedSamplingFrequency(
464 audio_receiver_config_.rtp_timebase); 464 audio_receiver_config_.rtp_timebase);
465 465
466 video_sender_config_.sender_ssrc = 3; 466 video_sender_config_.sender_ssrc = 3;
467 video_sender_config_.receiver_ssrc = 4; 467 video_sender_config_.receiver_ssrc = 4;
468 video_sender_config_.max_playout_delay = 468 video_sender_config_.max_playout_delay =
469 base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs); 469 base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs);
470 video_sender_config_.rtp_payload_type = RtpPayloadType::VIDEO_VP8; 470 video_sender_config_.rtp_payload_type = RtpPayloadType::VIDEO_VP8;
471 video_sender_config_.use_external_encoder = false; 471 video_sender_config_.use_external_encoder = false;
472 video_sender_config_.rtp_timebase = kVideoFrequency;
472 video_sender_config_.max_bitrate = 50000; 473 video_sender_config_.max_bitrate = 50000;
473 video_sender_config_.min_bitrate = 10000; 474 video_sender_config_.min_bitrate = 10000;
474 video_sender_config_.start_bitrate = 10000; 475 video_sender_config_.start_bitrate = 10000;
475 video_sender_config_.video_codec_params.max_qp = 30; 476 video_sender_config_.video_codec_params.max_qp = 30;
476 video_sender_config_.video_codec_params.min_qp = 4; 477 video_sender_config_.video_codec_params.min_qp = 4;
477 video_sender_config_.max_frame_rate = 30; 478 video_sender_config_.max_frame_rate = 30;
478 video_sender_config_.codec = video_codec; 479 video_sender_config_.codec = video_codec;
479 video_sender_config_.aes_iv_mask = 480 video_sender_config_.aes_iv_mask =
480 ConvertFromBase16String("1234567890abcdeffedcba0987654321"); 481 ConvertFromBase16String("1234567890abcdeffedcba0987654321");
481 video_sender_config_.aes_key = 482 video_sender_config_.aes_key =
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 888
888 namespace { 889 namespace {
889 890
890 class TransportClient : public CastTransport::Client { 891 class TransportClient : public CastTransport::Client {
891 public: 892 public:
892 TransportClient(LogEventDispatcher* log_event_dispatcher, 893 TransportClient(LogEventDispatcher* log_event_dispatcher,
893 End2EndTest* e2e_test) 894 End2EndTest* e2e_test)
894 : log_event_dispatcher_(log_event_dispatcher), e2e_test_(e2e_test) {} 895 : log_event_dispatcher_(log_event_dispatcher), e2e_test_(e2e_test) {}
895 896
896 void OnStatusChanged(media::cast::CastTransportStatus status) final { 897 void OnStatusChanged(media::cast::CastTransportStatus status) final {
897 bool result = (status == TRANSPORT_AUDIO_INITIALIZED || 898 EXPECT_EQ(TRANSPORT_STREAM_INITIALIZED, status);
898 status == TRANSPORT_VIDEO_INITIALIZED);
899 EXPECT_TRUE(result);
900 }; 899 };
901 void OnLoggingEventsReceived( 900 void OnLoggingEventsReceived(
902 std::unique_ptr<std::vector<FrameEvent>> frame_events, 901 std::unique_ptr<std::vector<FrameEvent>> frame_events,
903 std::unique_ptr<std::vector<PacketEvent>> packet_events) final { 902 std::unique_ptr<std::vector<PacketEvent>> packet_events) final {
904 log_event_dispatcher_->DispatchBatchOfEvents(std::move(frame_events), 903 log_event_dispatcher_->DispatchBatchOfEvents(std::move(frame_events),
905 std::move(packet_events)); 904 std::move(packet_events));
906 }; 905 };
907 void ProcessRtpPacket(std::unique_ptr<Packet> packet) final { 906 void ProcessRtpPacket(std::unique_ptr<Packet> packet) final {
908 if (e2e_test_) 907 if (e2e_test_)
909 e2e_test_->ReceivePacket(std::move(packet)); 908 e2e_test_->ReceivePacket(std::move(packet));
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 EXPECT_EQ(0u, jump); 1270 EXPECT_EQ(0u, jump);
1272 jump = i; 1271 jump = i;
1273 } 1272 }
1274 } 1273 }
1275 EXPECT_GT(jump, 49u); 1274 EXPECT_GT(jump, 49u);
1276 EXPECT_LT(jump, 120u); 1275 EXPECT_LT(jump, 120u);
1277 } 1276 }
1278 1277
1279 } // namespace cast 1278 } // namespace cast
1280 } // namespace media 1279 } // namespace media
OLDNEW
« media/cast/sender/frame_sender.cc ('K') | « media/cast/test/cast_benchmarks.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698