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

Side by Side Diff: media/base/audio_codecs.cc

Issue 2226443002: Support multiple media tracks in MSE / ChunkDemuxer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed integer overflow Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « media/base/audio_codecs.h ('k') | media/base/media_track.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "media/base/audio_codecs.h" 5 #include "media/base/audio_codecs.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h"
8 9
9 namespace media { 10 namespace media {
10 11
11 // These names come from src/third_party/ffmpeg/libavcodec/codec_desc.c 12 // These names come from src/third_party/ffmpeg/libavcodec/codec_desc.c
12 std::string GetCodecName(AudioCodec codec) { 13 std::string GetCodecName(AudioCodec codec) {
13 switch (codec) { 14 switch (codec) {
14 case kUnknownAudioCodec: 15 case kUnknownAudioCodec:
15 return "unknown"; 16 return "unknown";
16 case kCodecAAC: 17 case kCodecAAC:
17 return "aac"; 18 return "aac";
(...skipping 23 matching lines...) Expand all
41 return "eac3"; 42 return "eac3";
42 case kCodecALAC: 43 case kCodecALAC:
43 return "alac"; 44 return "alac";
44 case kCodecAC3: 45 case kCodecAC3:
45 return "ac3"; 46 return "ac3";
46 } 47 }
47 NOTREACHED(); 48 NOTREACHED();
48 return ""; 49 return "";
49 } 50 }
50 51
52 AudioCodec StringToAudioCodec(const std::string& codec_id) {
53 if (codec_id == "aac")
54 return kCodecAAC;
55 if (codec_id == "ac-3" || codec_id == "mp4a.A5")
56 return kCodecAC3;
57 if (codec_id == "ec-3" || codec_id == "mp4a.A6")
58 return kCodecEAC3;
59 if (codec_id == "mp3")
60 return kCodecMP3;
61 if (codec_id == "alac")
62 return kCodecALAC;
63 if (codec_id == "flac")
64 return kCodecFLAC;
65 if (codec_id == "opus")
66 return kCodecOpus;
67 if (codec_id == "vorbis")
68 return kCodecVorbis;
69 if (base::StartsWith(codec_id, "mp4a.40.", base::CompareCase::SENSITIVE))
70 return kCodecAAC;
71 return kUnknownAudioCodec;
72 }
73
51 } // namespace media 74 } // namespace media
OLDNEW
« no previous file with comments | « media/base/audio_codecs.h ('k') | media/base/media_track.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698