| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "media/cast/cast_defines.h" | 10 #include "media/cast/cast_defines.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // TODO(miu): AudioSender needs to be like VideoSender in providing an upper | 64 // TODO(miu): AudioSender needs to be like VideoSender in providing an upper |
| 65 // limit on the number of in-flight frames. | 65 // limit on the number of in-flight frames. |
| 66 transport_config.stored_frames = max_unacked_frames_; | 66 transport_config.stored_frames = max_unacked_frames_; |
| 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, |
| 72 base::Bind(&AudioSender::OnReceivedCastFeedback, | 72 base::Bind(&AudioSender::OnReceivedCastFeedback, |
| 73 weak_factory_.GetWeakPtr()), | 73 weak_factory_.GetWeakPtr()), |
| 74 base::Bind(&AudioSender::OnReceivedRtt, weak_factory_.GetWeakPtr())); | 74 base::Bind(&AudioSender::OnMeasuredRoundTripTime, |
| 75 weak_factory_.GetWeakPtr())); |
| 75 } | 76 } |
| 76 | 77 |
| 77 AudioSender::~AudioSender() {} | 78 AudioSender::~AudioSender() {} |
| 78 | 79 |
| 79 void AudioSender::InsertAudio(scoped_ptr<AudioBus> audio_bus, | 80 void AudioSender::InsertAudio(scoped_ptr<AudioBus> audio_bus, |
| 80 const base::TimeTicks& recorded_time) { | 81 const base::TimeTicks& recorded_time) { |
| 81 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 82 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 82 if (cast_initialization_status_ != STATUS_AUDIO_INITIALIZED) { | 83 if (cast_initialization_status_ != STATUS_AUDIO_INITIALIZED) { |
| 83 NOTREACHED(); | 84 NOTREACHED(); |
| 84 return; | 85 return; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 98 frames_in_encoder_ += new_frames_sent - old_frames_sent; | 99 frames_in_encoder_ += new_frames_sent - old_frames_sent; |
| 99 | 100 |
| 100 audio_encoder_->InsertAudio(audio_bus.Pass(), recorded_time); | 101 audio_encoder_->InsertAudio(audio_bus.Pass(), recorded_time); |
| 101 } | 102 } |
| 102 | 103 |
| 103 void AudioSender::OnAck(uint32 frame_id) { | 104 void AudioSender::OnAck(uint32 frame_id) { |
| 104 } | 105 } |
| 105 | 106 |
| 106 } // namespace cast | 107 } // namespace cast |
| 107 } // namespace media | 108 } // namespace media |
| OLD | NEW |