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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/numerics/safe_conversions.h" | 8 #include "base/numerics/safe_conversions.h" |
9 #include "media/audio/audio_parameters.h" | 9 #include "media/audio/audio_parameters.h" |
10 #include "media/base/limits.h" | 10 #include "media/base/limits.h" |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 } | 333 } |
334 } | 334 } |
335 | 335 |
336 void AudioBus::SwapChannels(int a, int b) { | 336 void AudioBus::SwapChannels(int a, int b) { |
337 DCHECK(a < channels() && a >= 0); | 337 DCHECK(a < channels() && a >= 0); |
338 DCHECK(b < channels() && b >= 0); | 338 DCHECK(b < channels() && b >= 0); |
339 DCHECK_NE(a, b); | 339 DCHECK_NE(a, b); |
340 std::swap(channel_data_[a], channel_data_[b]); | 340 std::swap(channel_data_[a], channel_data_[b]); |
341 } | 341 } |
342 | 342 |
| 343 scoped_refptr<AudioBusRefCounted> AudioBusRefCounted::Create( |
| 344 int channels, int frames) { |
| 345 return scoped_refptr<AudioBusRefCounted>( |
| 346 new AudioBusRefCounted(channels, frames)); |
| 347 } |
| 348 |
| 349 AudioBusRefCounted::AudioBusRefCounted(int channels, int frames) |
| 350 : AudioBus(channels, frames) {} |
| 351 |
| 352 AudioBusRefCounted::~AudioBusRefCounted() {} |
| 353 |
343 } // namespace media | 354 } // namespace media |
OLD | NEW |