| 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_receiver/audio_receiver.h" | 5 #include "media/cast/audio_receiver/audio_receiver.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 "crypto/encryptor.h" | 10 #include "crypto/encryptor.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 rtp_receiver_->ReceivedPacket(packet, length); | 386 rtp_receiver_->ReceivedPacket(packet, length); |
| 387 } else { | 387 } else { |
| 388 rtcp_->IncomingRtcpPacket(packet, length); | 388 rtcp_->IncomingRtcpPacket(packet, length); |
| 389 } | 389 } |
| 390 cast_environment_->PostTask(CastEnvironment::MAIN, FROM_HERE, callback); | 390 cast_environment_->PostTask(CastEnvironment::MAIN, FROM_HERE, callback); |
| 391 } | 391 } |
| 392 | 392 |
| 393 void AudioReceiver::CastFeedback(const RtcpCastMessage& cast_message) { | 393 void AudioReceiver::CastFeedback(const RtcpCastMessage& cast_message) { |
| 394 RtcpReceiverLogMessage receiver_log; | 394 RtcpReceiverLogMessage receiver_log; |
| 395 AudioRtcpRawMap audio_logs = | 395 AudioRtcpRawMap audio_logs = |
| 396 cast_environment_->Logging()->GetAudioRtcpRawData(); | 396 cast_environment_->Logging()->GetAndResetAudioRtcpRawData(); |
| 397 | 397 |
| 398 while (!audio_logs.empty()) { | 398 while (!audio_logs.empty()) { |
| 399 AudioRtcpRawMap::iterator it = audio_logs.begin(); | 399 AudioRtcpRawMap::iterator it = audio_logs.begin(); |
| 400 uint32 rtp_timestamp = it->first; | 400 uint32 rtp_timestamp = it->first; |
| 401 std::pair<AudioRtcpRawMap::iterator, AudioRtcpRawMap::iterator> | 401 std::pair<AudioRtcpRawMap::iterator, AudioRtcpRawMap::iterator> |
| 402 frame_range = audio_logs.equal_range(rtp_timestamp); | 402 frame_range = audio_logs.equal_range(rtp_timestamp); |
| 403 | 403 |
| 404 RtcpReceiverFrameLogMessage frame_log(rtp_timestamp); | 404 RtcpReceiverFrameLogMessage frame_log(rtp_timestamp); |
| 405 | 405 |
| 406 AudioRtcpRawMap::const_iterator event_it = frame_range.first; | 406 AudioRtcpRawMap::const_iterator event_it = frame_range.first; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 } | 532 } |
| 533 if (audio_decoder_) { | 533 if (audio_decoder_) { |
| 534 // Will only send a message if it is time. | 534 // Will only send a message if it is time. |
| 535 audio_decoder_->SendCastMessage(); | 535 audio_decoder_->SendCastMessage(); |
| 536 } | 536 } |
| 537 ScheduleNextCastMessage(); | 537 ScheduleNextCastMessage(); |
| 538 } | 538 } |
| 539 | 539 |
| 540 } // namespace cast | 540 } // namespace cast |
| 541 } // namespace media | 541 } // namespace media |
| OLD | NEW |