OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/codec/audio_encoder_opus.h" | 5 #include "remoting/codec/audio_encoder_opus.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/time/time.h" | 9 #include "base/time/time.h" |
10 #include "media/base/audio_bus.h" | 10 #include "media/base/audio_bus.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 DCHECK_LE(leftover_samples_ + samples_in_packet, leftover_buffer_size_); | 228 DCHECK_LE(leftover_samples_ + samples_in_packet, leftover_buffer_size_); |
229 memmove(leftover_buffer_.get() + leftover_samples_ * channels_, | 229 memmove(leftover_buffer_.get() + leftover_samples_ * channels_, |
230 next_sample, samples_in_packet * kBytesPerSample * channels_); | 230 next_sample, samples_in_packet * kBytesPerSample * channels_); |
231 leftover_samples_ += samples_in_packet; | 231 leftover_samples_ += samples_in_packet; |
232 } | 232 } |
233 | 233 |
234 // Return nullptr if there's nothing in the packet. | 234 // Return nullptr if there's nothing in the packet. |
235 if (encoded_packet->data_size() == 0) | 235 if (encoded_packet->data_size() == 0) |
236 return nullptr; | 236 return nullptr; |
237 | 237 |
238 return encoded_packet.Pass(); | 238 return encoded_packet; |
239 } | 239 } |
240 | 240 |
241 } // namespace remoting | 241 } // namespace remoting |
OLD | NEW |