Chromium Code Reviews| Index: services/media/audio/platform/generic/mixer.cc |
| diff --git a/services/media/audio/platform/generic/mixer.cc b/services/media/audio/platform/generic/mixer.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..82e8a06b9c8b9200288dd849f09705443cdd4740 |
| --- /dev/null |
| +++ b/services/media/audio/platform/generic/mixer.cc |
| @@ -0,0 +1,30 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "services/media/audio/platform/generic/mixer.h" |
| +#include "services/media/audio/platform/generic/mixers/no_op.h" |
| +#include "services/media/audio/platform/generic/mixers/point_sampler.h" |
| + |
| +namespace mojo { |
| +namespace media { |
| +namespace audio { |
| + |
| +Mixer::Mixer() {} |
| +Mixer::~Mixer() {} |
| + |
| +MixerPtr Mixer::Select(const LpcmMediaTypeDetailsPtr& src_format, |
| + const LpcmMediaTypeDetailsPtr& dst_format) { |
| + // We should always have a source format. |
| + 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
|
| + |
| + // If we don't have a destination format, just stick with no-op. This is |
| + // probably the ThrottleOutput we are picking a mixer for. |
| + if (!dst_format) { return MixerPtr(new mixers::NoOp()); } |
| + |
| + return mixers::PointSampler::Select(src_format, dst_format); |
| +} |
| + |
| +} // namespace audio |
| +} // namespace media |
| +} // namespace mojo |