| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "media/cast/sender/audio_sender.h" | 5 #include "media/cast/sender/audio_sender.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 audio_config.frequency / audio_encoder_->GetSamplesPerFrame(); | 61 audio_config.frequency / audio_encoder_->GetSamplesPerFrame(); |
| 62 | 62 |
| 63 media::cast::CastTransportRtpConfig transport_config; | 63 media::cast::CastTransportRtpConfig transport_config; |
| 64 transport_config.ssrc = audio_config.ssrc; | 64 transport_config.ssrc = audio_config.ssrc; |
| 65 transport_config.feedback_ssrc = audio_config.receiver_ssrc; | 65 transport_config.feedback_ssrc = audio_config.receiver_ssrc; |
| 66 transport_config.rtp_payload_type = audio_config.rtp_payload_type; | 66 transport_config.rtp_payload_type = audio_config.rtp_payload_type; |
| 67 transport_config.aes_key = audio_config.aes_key; | 67 transport_config.aes_key = audio_config.aes_key; |
| 68 transport_config.aes_iv_mask = audio_config.aes_iv_mask; | 68 transport_config.aes_iv_mask = audio_config.aes_iv_mask; |
| 69 | 69 |
| 70 transport_sender->InitializeAudio( | 70 transport_sender->InitializeAudio( |
| 71 transport_config, | 71 transport_config, base::Bind(&AudioSender::OnReceivedCastFeedback, |
| 72 base::Bind(&AudioSender::OnReceivedCastFeedback, | 72 weak_factory_.GetWeakPtr()), |
| 73 base::Bind(&AudioSender::OnMeasuredRoundTripTime, |
| 73 weak_factory_.GetWeakPtr()), | 74 weak_factory_.GetWeakPtr()), |
| 74 base::Bind(&AudioSender::OnMeasuredRoundTripTime, | 75 base::Bind(&AudioSender::OnReceivedPli, weak_factory_.GetWeakPtr())); |
| 75 weak_factory_.GetWeakPtr())); | |
| 76 } | 76 } |
| 77 | 77 |
| 78 AudioSender::~AudioSender() {} | 78 AudioSender::~AudioSender() {} |
| 79 | 79 |
| 80 void AudioSender::InsertAudio(scoped_ptr<AudioBus> audio_bus, | 80 void AudioSender::InsertAudio(scoped_ptr<AudioBus> audio_bus, |
| 81 const base::TimeTicks& recorded_time) { | 81 const base::TimeTicks& recorded_time) { |
| 82 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 82 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 83 | 83 |
| 84 if (!audio_encoder_) { | 84 if (!audio_encoder_) { |
| 85 NOTREACHED(); | 85 NOTREACHED(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 115 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 115 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 116 | 116 |
| 117 samples_in_encoder_ -= audio_encoder_->GetSamplesPerFrame() + samples_skipped; | 117 samples_in_encoder_ -= audio_encoder_->GetSamplesPerFrame() + samples_skipped; |
| 118 DCHECK_GE(samples_in_encoder_, 0); | 118 DCHECK_GE(samples_in_encoder_, 0); |
| 119 | 119 |
| 120 SendEncodedFrame(encoder_bitrate, std::move(encoded_frame)); | 120 SendEncodedFrame(encoder_bitrate, std::move(encoded_frame)); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace cast | 123 } // namespace cast |
| 124 } // namespace media | 124 } // namespace media |
| OLD | NEW |