| 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 "media/base/audio_bus.h" | 5 #include "media/base/audio_bus.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "media/audio/audio_parameters.h" | 10 #include "media/audio/audio_parameters.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 ToInterleavedInternal<int32, int64>(this, frames, dest); | 283 ToInterleavedInternal<int32, int64>(this, frames, dest); |
| 284 break; | 284 break; |
| 285 default: | 285 default: |
| 286 NOTREACHED() << "Unsupported bytes per sample encountered."; | 286 NOTREACHED() << "Unsupported bytes per sample encountered."; |
| 287 memset(dest, 0, frames * bytes_per_sample); | 287 memset(dest, 0, frames * bytes_per_sample); |
| 288 return; | 288 return; |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 | 291 |
| 292 void AudioBus::CopyTo(AudioBus* dest) const { | 292 void AudioBus::CopyTo(AudioBus* dest) const { |
| 293 DCHECK_EQ(channels(), dest->channels()); | 293 CHECK_EQ(channels(), dest->channels()); |
| 294 DCHECK_EQ(frames(), dest->frames()); | 294 CHECK_EQ(frames(), dest->frames()); |
| 295 | 295 |
| 296 // Since we don't know if the other AudioBus is wrapped or not (and we don't | 296 // Since we don't know if the other AudioBus is wrapped or not (and we don't |
| 297 // want to care), just copy using the public channel() accessors. | 297 // want to care), just copy using the public channel() accessors. |
| 298 for (int i = 0; i < channels(); ++i) | 298 for (int i = 0; i < channels(); ++i) |
| 299 memcpy(dest->channel(i), channel(i), sizeof(*channel(i)) * frames()); | 299 memcpy(dest->channel(i), channel(i), sizeof(*channel(i)) * frames()); |
| 300 } | 300 } |
| 301 | 301 |
| 302 } // namespace media | 302 } // namespace media |
| OLD | NEW |