OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "remoting/host/audio_pump.h" | 5 #include "remoting/host/audio_pump.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
14 #include "base/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
15 #include "remoting/codec/audio_encoder.h" | 15 #include "remoting/codec/audio_encoder.h" |
16 #include "remoting/host/audio_capturer.h" | 16 #include "remoting/host/audio_capturer.h" |
17 #include "remoting/proto/audio.pb.h" | 17 #include "remoting/proto/audio.pb.h" |
18 #include "remoting/protocol/audio_stub.h" | 18 #include "remoting/protocol/audio_stub.h" |
19 | 19 |
20 namespace remoting { | 20 namespace remoting { |
21 | 21 |
22 // Limit the data stored in the pending send buffers to 250ms. | 22 // Limit the data stored in the pending send buffers to 250ms. |
23 const int kMaxBufferedIntervalMs = 250; | 23 const int kMaxBufferedIntervalMs = 250; |
24 | 24 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 base::Bind(&AudioPump::OnPacketSent, weak_factory_.GetWeakPtr(), size)); | 155 base::Bind(&AudioPump::OnPacketSent, weak_factory_.GetWeakPtr(), size)); |
156 } | 156 } |
157 | 157 |
158 void AudioPump::OnPacketSent(int size) { | 158 void AudioPump::OnPacketSent(int size) { |
159 audio_task_runner_->PostTask( | 159 audio_task_runner_->PostTask( |
160 FROM_HERE, | 160 FROM_HERE, |
161 base::Bind(&Core::OnPacketSent, base::Unretained(core_.get()), size)); | 161 base::Bind(&Core::OnPacketSent, base::Unretained(core_.get()), size)); |
162 } | 162 } |
163 | 163 |
164 } // namespace remoting | 164 } // namespace remoting |
OLD | NEW |