| OLD | NEW |
| 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 #include <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/test/simple_test_tick_clock.h" | 10 #include "base/test/simple_test_tick_clock.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 task_runner_, | 62 task_runner_, |
| 63 task_runner_, | 63 task_runner_, |
| 64 task_runner_); | 64 task_runner_); |
| 65 audio_config_.codec = transport::kOpus; | 65 audio_config_.codec = transport::kOpus; |
| 66 audio_config_.use_external_encoder = false; | 66 audio_config_.use_external_encoder = false; |
| 67 audio_config_.frequency = kDefaultAudioSamplingRate; | 67 audio_config_.frequency = kDefaultAudioSamplingRate; |
| 68 audio_config_.channels = 2; | 68 audio_config_.channels = 2; |
| 69 audio_config_.bitrate = kDefaultAudioEncoderBitrate; | 69 audio_config_.bitrate = kDefaultAudioEncoderBitrate; |
| 70 audio_config_.rtp_config.payload_type = 127; | 70 audio_config_.rtp_config.payload_type = 127; |
| 71 | 71 |
| 72 transport::CastTransportAudioConfig transport_config; | |
| 73 transport_config.base.rtp_config.payload_type = 127; | |
| 74 transport_config.channels = 2; | |
| 75 net::IPEndPoint dummy_endpoint; | 72 net::IPEndPoint dummy_endpoint; |
| 76 | 73 |
| 77 transport_sender_.reset(new transport::CastTransportSenderImpl( | 74 transport_sender_.reset(new transport::CastTransportSenderImpl( |
| 78 NULL, | 75 NULL, |
| 79 testing_clock_, | 76 testing_clock_, |
| 80 dummy_endpoint, | 77 dummy_endpoint, |
| 81 base::Bind(&UpdateCastTransportStatus), | 78 base::Bind(&UpdateCastTransportStatus), |
| 82 transport::BulkRawEventsCallback(), | 79 transport::BulkRawEventsCallback(), |
| 83 base::TimeDelta(), | 80 base::TimeDelta(), |
| 84 task_runner_, | 81 task_runner_, |
| 85 &transport_)); | 82 &transport_)); |
| 86 transport_sender_->InitializeAudio(transport_config); | |
| 87 audio_sender_.reset(new AudioSender( | 83 audio_sender_.reset(new AudioSender( |
| 88 cast_environment_, audio_config_, transport_sender_.get())); | 84 cast_environment_, audio_config_, transport_sender_.get())); |
| 89 task_runner_->RunTasks(); | 85 task_runner_->RunTasks(); |
| 90 } | 86 } |
| 91 | 87 |
| 92 virtual ~AudioSenderTest() {} | 88 virtual ~AudioSenderTest() {} |
| 93 | 89 |
| 94 static void UpdateCastTransportStatus(transport::CastTransportStatus status) { | 90 static void UpdateCastTransportStatus(transport::CastTransportStatus status) { |
| 95 EXPECT_EQ(status, transport::TRANSPORT_AUDIO_INITIALIZED); | 91 EXPECT_EQ(status, transport::TRANSPORT_AUDIO_INITIALIZED); |
| 96 } | 92 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 base::TimeDelta max_rtcp_timeout = | 132 base::TimeDelta max_rtcp_timeout = |
| 137 base::TimeDelta::FromMilliseconds(1 + kDefaultRtcpIntervalMs * 3 / 2); | 133 base::TimeDelta::FromMilliseconds(1 + kDefaultRtcpIntervalMs * 3 / 2); |
| 138 testing_clock_->Advance(max_rtcp_timeout); | 134 testing_clock_->Advance(max_rtcp_timeout); |
| 139 task_runner_->RunTasks(); | 135 task_runner_->RunTasks(); |
| 140 EXPECT_GE(transport_.number_of_rtp_packets(), 1); | 136 EXPECT_GE(transport_.number_of_rtp_packets(), 1); |
| 141 EXPECT_EQ(transport_.number_of_rtcp_packets(), 1); | 137 EXPECT_EQ(transport_.number_of_rtcp_packets(), 1); |
| 142 } | 138 } |
| 143 | 139 |
| 144 } // namespace cast | 140 } // namespace cast |
| 145 } // namespace media | 141 } // namespace media |
| OLD | NEW |