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

Unified 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: fix issues discovered with initial preflight 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 side-by-side diff with in-line comments
Download patch
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..47b55f9cff500e98c6102a29b4a0503c2dfad394
--- /dev/null
+++ b/services/media/audio/platform/generic/mixer.cc
@@ -0,0 +1,31 @@
+// 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 "base/logging.h"
+#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.
+ DCHECK(src_format);
+
+ // 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
« no previous file with comments | « services/media/audio/platform/generic/mixer.h ('k') | services/media/audio/platform/generic/mixers/mixer_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698