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

Unified Diff: webrtc/modules/audio_coding/codecs/audio_format.cc

Issue 1917163002: New interface (AudioDecoderFactory), with an implementation (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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: webrtc/modules/audio_coding/codecs/audio_format.cc
diff --git a/webrtc/modules/audio_coding/codecs/audio_format.cc b/webrtc/modules/audio_coding/codecs/audio_format.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b2acf09de6c3a29d108f9f60b174f15252f6ce54
--- /dev/null
+++ b/webrtc/modules/audio_coding/codecs/audio_format.cc
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "webrtc/modules/audio_coding/codecs/audio_format.h"
+
+namespace webrtc {
+
+SdpAudioFormat::SdpAudioFormat() = default;
+SdpAudioFormat::SdpAudioFormat(const SdpAudioFormat&) = default;
+SdpAudioFormat::SdpAudioFormat(SdpAudioFormat&&) = default;
+
+SdpAudioFormat::SdpAudioFormat(const char* name,
+ int clockrate_hz,
+ int num_channels)
+ : name(name), clockrate_hz(clockrate_hz), num_channels(num_channels) {}
+
+SdpAudioFormat::~SdpAudioFormat() = default;
+SdpAudioFormat& SdpAudioFormat::operator=(const SdpAudioFormat&) = default;
+SdpAudioFormat& SdpAudioFormat::operator=(SdpAudioFormat&&) = default;
+
+void swap(SdpAudioFormat& a, SdpAudioFormat& b) {
+ using std::swap;
+ swap(a.name, b.name);
+ swap(a.clockrate_hz, b.clockrate_hz);
+ swap(a.num_channels, b.num_channels);
+ swap(a.parameters, b.parameters);
+}
+
+std::ostream& operator<<(std::ostream& os, const SdpAudioFormat& saf) {
+ os << "{name: " << saf.name;
+ os << ", clockrate_hz: " << saf.clockrate_hz;
+ os << ", num_channels: " << saf.num_channels;
+ os << ", parameters: {";
+ const char* sep = "";
hlundin-webrtc 2016/04/27 14:35:56 I think the const qualifier is confusing here, sin
ossu 2016/04/28 08:35:53 Well, it's still correct - the char * can't point
hlundin-webrtc 2016/04/28 09:04:18 Oh. Yes. Well... eeh... [voice tapering off as Sha
+ for (const auto& kv : saf.parameters) {
+ os << sep << kv.first << ": " << kv.second;
+ sep = ", ";
+ }
+ os << "}}";
+ return os;
+}
+
+} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698