Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: media/base/audio_bus.cc

Issue 388563005: Add a ref counted audio bus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/audio_bus.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « media/base/audio_bus.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698