| 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 "media/cast/audio_sender/audio_sender.h" | 5 #include "media/cast/audio_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/audio_sender/audio_encoder.h" | 10 #include "media/cast/audio_sender/audio_encoder.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 void AudioSender::InsertAudio(scoped_ptr<AudioBus> audio_bus, | 93 void AudioSender::InsertAudio(scoped_ptr<AudioBus> audio_bus, |
| 94 const base::TimeTicks& recorded_time) { | 94 const base::TimeTicks& recorded_time) { |
| 95 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 95 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 96 DCHECK(audio_encoder_.get()) << "Invalid internal state"; | 96 DCHECK(audio_encoder_.get()) << "Invalid internal state"; |
| 97 audio_encoder_->InsertAudio(audio_bus.Pass(), recorded_time); | 97 audio_encoder_->InsertAudio(audio_bus.Pass(), recorded_time); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void AudioSender::SendEncodedAudioFrame( | 100 void AudioSender::SendEncodedAudioFrame( |
| 101 scoped_ptr<transport::EncodedAudioFrame> audio_frame, | 101 scoped_ptr<transport::EncodedFrame> audio_frame) { |
| 102 const base::TimeTicks& recorded_time) { | |
| 103 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 102 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 104 InitializeTimers(); | 103 InitializeTimers(); |
| 105 transport_sender_->InsertCodedAudioFrame(audio_frame.get(), recorded_time); | 104 transport_sender_->InsertCodedAudioFrame(*audio_frame); |
| 106 } | 105 } |
| 107 | 106 |
| 108 void AudioSender::ResendPackets( | 107 void AudioSender::ResendPackets( |
| 109 const MissingFramesAndPacketsMap& missing_frames_and_packets) { | 108 const MissingFramesAndPacketsMap& missing_frames_and_packets) { |
| 110 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 109 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 111 transport_sender_->ResendPackets(true, missing_frames_and_packets); | 110 transport_sender_->ResendPackets(true, missing_frames_and_packets); |
| 112 } | 111 } |
| 113 | 112 |
| 114 void AudioSender::IncomingRtcpPacket(scoped_ptr<Packet> packet) { | 113 void AudioSender::IncomingRtcpPacket(scoped_ptr<Packet> packet) { |
| 115 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 114 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 142 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 141 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 143 // We don't send audio logging messages since all captured audio frames will | 142 // We don't send audio logging messages since all captured audio frames will |
| 144 // be sent. | 143 // be sent. |
| 145 rtp_stats_.UpdateInfo(cast_environment_->Clock()->NowTicks()); | 144 rtp_stats_.UpdateInfo(cast_environment_->Clock()->NowTicks()); |
| 146 rtcp_.SendRtcpFromRtpSender(rtp_stats_.sender_info()); | 145 rtcp_.SendRtcpFromRtpSender(rtp_stats_.sender_info()); |
| 147 ScheduleNextRtcpReport(); | 146 ScheduleNextRtcpReport(); |
| 148 } | 147 } |
| 149 | 148 |
| 150 } // namespace cast | 149 } // namespace cast |
| 151 } // namespace media | 150 } // namespace media |
| OLD | NEW |