Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |