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

Unified Diff: chromecast/media/base/converters.cc

Issue 1105803002: Exposes a shlib interface for media/audio path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment out streaming test until the default implementation is improved. Created 5 years, 5 months 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: chromecast/media/base/converters.cc
diff --git a/chromecast/media/base/converters.cc b/chromecast/media/base/converters.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b3b63ef6b621f2fbd0664772c8671bcb0e5b2d14
--- /dev/null
+++ b/chromecast/media/base/converters.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 "chromecast/media/base/converters.h"
+
+namespace chromecast {
+namespace media {
+
+AudioParameters FromChromiumParams(const ::media::AudioParameters& in_params) {
+ AudioParameters out_params;
+ out_params.sample_rate = in_params.sample_rate();
+ out_params.bits_per_sample = in_params.bits_per_sample();
+ out_params.frames_per_buffer = in_params.frames_per_buffer();
+ out_params.channels = in_params.channels();
+ return out_params;
+}
+
+::media::AudioParameters FromChromecastParams(
+ const AudioParameters& in_params) {
+ return ::media::AudioParameters(
+ ::media::AudioParameters::AUDIO_PCM_LINEAR,
+ ::media::GuessChannelLayout(in_params.channels),
+ in_params.sample_rate,
+ in_params.bits_per_sample,
+ in_params.frames_per_buffer);
+}
+
+} // namespace media
+} // namespace chromecast

Powered by Google App Engine
This is Rietveld 408576698