| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 "base/logging.h" |
| 5 #include "services/media/audio/platform/generic/mixer.h" | 6 #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/no_op.h" |
| 7 #include "services/media/audio/platform/generic/mixers/point_sampler.h" | 8 #include "services/media/audio/platform/generic/mixers/point_sampler.h" |
| 8 | 9 |
| 9 namespace mojo { | 10 namespace mojo { |
| 10 namespace media { | 11 namespace media { |
| 11 namespace audio { | 12 namespace audio { |
| 12 | 13 |
| 13 Mixer::Mixer() {} | 14 Mixer::Mixer() {} |
| 14 Mixer::~Mixer() {} | 15 Mixer::~Mixer() {} |
| 15 | 16 |
| 16 MixerPtr Mixer::Select(const LpcmMediaTypeDetailsPtr& src_format, | 17 MixerPtr Mixer::Select(const LpcmMediaTypeDetailsPtr& src_format, |
| 17 const LpcmMediaTypeDetailsPtr& dst_format) { | 18 const LpcmMediaTypeDetailsPtr& dst_format) { |
| 18 // We should always have a source format. | 19 // We should always have a source format. |
| 19 DCHECK(src_format); | 20 DCHECK(src_format); |
| 20 | 21 |
| 21 // If we don't have a destination format, just stick with no-op. This is | 22 // 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 // probably the ThrottleOutput we are picking a mixer for. |
| 23 if (!dst_format) { return MixerPtr(new mixers::NoOp()); } | 24 if (!dst_format) { return MixerPtr(new mixers::NoOp()); } |
| 24 | 25 |
| 25 return mixers::PointSampler::Select(src_format, dst_format); | 26 return mixers::PointSampler::Select(src_format, dst_format); |
| 26 } | 27 } |
| 27 | 28 |
| 28 } // namespace audio | 29 } // namespace audio |
| 29 } // namespace media | 30 } // namespace media |
| 30 } // namespace mojo | 31 } // namespace mojo |
| OLD | NEW |