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

Side by Side Diff: services/media/audio/platform/generic/mixer.cc

Issue 1424933002: Add an initial revision of an audio server. (Closed) Base URL: https://github.com/domokit/mojo.git@change4
Patch Set: refactor MixerKernel into a class to prepare for the addition of a linear interpolation sampler Created 5 years, 1 month 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "services/media/audio/platform/generic/mixer.h"
6 #include "services/media/audio/platform/generic/mixers/no_op.h"
7 #include "services/media/audio/platform/generic/mixers/point_sampler.h"
8
9 namespace mojo {
10 namespace media {
11 namespace audio {
12
13 Mixer::Mixer() {}
14 Mixer::~Mixer() {}
15
16 MixerPtr Mixer::Select(const LpcmMediaTypeDetailsPtr& src_format,
17 const LpcmMediaTypeDetailsPtr& dst_format) {
18 // We should always have a source format.
19 if (!src_format) { return nullptr; }
jeffbrown 2015/11/04 23:43:34 Seems worthy of a DCHECK. Otherwise the caller ha
johngro 2015/11/06 02:20:26 which he will immediately DCHECK about :) I'll ad
20
21 // If we don't have a destination format, just stick with no-op. This is
22 // probably the ThrottleOutput we are picking a mixer for.
23 if (!dst_format) { return MixerPtr(new mixers::NoOp()); }
24
25 return mixers::PointSampler::Select(src_format, dst_format);
26 }
27
28 } // namespace audio
29 } // namespace media
30 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698