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

Unified Diff: media/base/audio_codecs.cc

Issue 1685683004: Move media::AudioCodec to its own source file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « media/base/audio_codecs.h ('k') | media/base/audio_decoder_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_codecs.cc
diff --git a/media/base/audio_codecs.cc b/media/base/audio_codecs.cc
new file mode 100644
index 0000000000000000000000000000000000000000..46a7b2510fa2f4dc7beed613ca99932acd703aa2
--- /dev/null
+++ b/media/base/audio_codecs.cc
@@ -0,0 +1,51 @@
+// Copyright 2016 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 "media/base/audio_codecs.h"
+
+#include "base/logging.h"
+
+namespace media {
+
+// These names come from src/third_party/ffmpeg/libavcodec/codec_desc.c
+std::string GetCodecName(AudioCodec codec) {
+ switch (codec) {
+ case kUnknownAudioCodec:
+ return "unknown";
+ case kCodecAAC:
+ return "aac";
+ case kCodecMP3:
+ return "mp3";
+ case kCodecPCM:
+ case kCodecPCM_S16BE:
+ case kCodecPCM_S24BE:
+ return "pcm";
+ case kCodecVorbis:
+ return "vorbis";
+ case kCodecFLAC:
+ return "flac";
+ case kCodecAMR_NB:
+ return "amr_nb";
+ case kCodecAMR_WB:
+ return "amr_wb";
+ case kCodecPCM_MULAW:
+ return "pcm_mulaw";
+ case kCodecGSM_MS:
+ return "gsm_ms";
+ case kCodecOpus:
+ return "opus";
+ case kCodecPCM_ALAW:
+ return "pcm_alaw";
+ case kCodecEAC3:
+ return "eac3";
+ case kCodecALAC:
+ return "alac";
+ case kCodecAC3:
+ return "ac3";
+ }
+ NOTREACHED();
+ return "";
+}
+
+} // namespace media
« no previous file with comments | « media/base/audio_codecs.h ('k') | media/base/audio_decoder_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698