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 "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 private: | 89 private: |
90 RtpReceiver* rtp_receiver_; | 90 RtpReceiver* rtp_receiver_; |
91 }; | 91 }; |
92 | 92 |
93 AudioReceiver::AudioReceiver(scoped_refptr<CastEnvironment> cast_environment, | 93 AudioReceiver::AudioReceiver(scoped_refptr<CastEnvironment> cast_environment, |
94 const AudioReceiverConfig& audio_config, | 94 const AudioReceiverConfig& audio_config, |
95 transport::PacedPacketSender* const packet_sender) | 95 transport::PacedPacketSender* const packet_sender) |
96 : cast_environment_(cast_environment), | 96 : cast_environment_(cast_environment), |
97 event_subscriber_( | 97 event_subscriber_( |
98 cast_environment->GetMessageSingleThreadTaskRunnerForThread( | |
99 CastEnvironment::MAIN), | |
100 kMaxEventSubscriberEntries, | 98 kMaxEventSubscriberEntries, |
101 ReceiverRtcpEventSubscriber::kAudioEventSubscriber), | 99 ReceiverRtcpEventSubscriber::kAudioEventSubscriber), |
102 codec_(audio_config.codec), | 100 codec_(audio_config.codec), |
103 frequency_(audio_config.frequency), | 101 frequency_(audio_config.frequency), |
104 audio_buffer_(), | 102 audio_buffer_(), |
105 audio_decoder_(), | 103 audio_decoder_(), |
106 time_offset_(), | 104 time_offset_(), |
107 weak_factory_(this) { | 105 weak_factory_(this) { |
108 target_delay_delta_ = | 106 target_delay_delta_ = |
109 base::TimeDelta::FromMilliseconds(audio_config.rtp_max_delay_ms); | 107 base::TimeDelta::FromMilliseconds(audio_config.rtp_max_delay_ms); |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 } | 498 } |
501 if (audio_decoder_) { | 499 if (audio_decoder_) { |
502 // Will only send a message if it is time. | 500 // Will only send a message if it is time. |
503 audio_decoder_->SendCastMessage(); | 501 audio_decoder_->SendCastMessage(); |
504 } | 502 } |
505 ScheduleNextCastMessage(); | 503 ScheduleNextCastMessage(); |
506 } | 504 } |
507 | 505 |
508 } // namespace cast | 506 } // namespace cast |
509 } // namespace media | 507 } // namespace media |
OLD | NEW |