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

Side by Side Diff: media/base/audio_decoder_config.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, 9 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_decoder_config.h ('k') | media/ffmpeg/ffmpeg_common.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_decoder_config.h" 5 #include "media/base/audio_decoder_config.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "media/base/limits.h" 8 #include "media/base/limits.h"
9 9
10 namespace media { 10 namespace media {
11 11
12 // These names come from src/third_party/ffmpeg/libavcodec/codec_desc.c
13 std::string GetCodecName(AudioCodec codec) {
14 switch (codec) {
15 case kUnknownAudioCodec:
16 return "unknown";
17 case kCodecAAC:
18 return "aac";
19 case kCodecMP3:
20 return "mp3";
21 case kCodecPCM:
22 case kCodecPCM_S16BE:
23 case kCodecPCM_S24BE:
24 return "pcm";
25 case kCodecVorbis:
26 return "vorbis";
27 case kCodecFLAC:
28 return "flac";
29 case kCodecAMR_NB:
30 return "amr_nb";
31 case kCodecAMR_WB:
32 return "amr_wb";
33 case kCodecPCM_MULAW:
34 return "pcm_mulaw";
35 case kCodecGSM_MS:
36 return "gsm_ms";
37 case kCodecOpus:
38 return "opus";
39 case kCodecPCM_ALAW:
40 return "pcm_alaw";
41 case kCodecEAC3:
42 return "eac3";
43 case kCodecALAC:
44 return "alac";
45 case kCodecAC3:
46 return "ac3";
47 }
48 NOTREACHED();
49 return "";
50 }
51
52 AudioDecoderConfig::AudioDecoderConfig() 12 AudioDecoderConfig::AudioDecoderConfig()
53 : codec_(kUnknownAudioCodec), 13 : codec_(kUnknownAudioCodec),
54 sample_format_(kUnknownSampleFormat), 14 sample_format_(kUnknownSampleFormat),
55 bytes_per_channel_(0), 15 bytes_per_channel_(0),
56 channel_layout_(CHANNEL_LAYOUT_UNSUPPORTED), 16 channel_layout_(CHANNEL_LAYOUT_UNSUPPORTED),
57 samples_per_second_(0), 17 samples_per_second_(0),
58 bytes_per_frame_(0), 18 bytes_per_frame_(0),
59 is_encrypted_(false), 19 is_encrypted_(false),
60 codec_delay_(0) { 20 codec_delay_(0) {
61 } 21 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 << " sample_format: " << sample_format() 87 << " sample_format: " << sample_format()
128 << " bytes_per_frame: " << bytes_per_frame() 88 << " bytes_per_frame: " << bytes_per_frame()
129 << " seek_preroll: " << seek_preroll().InMilliseconds() << "ms" 89 << " seek_preroll: " << seek_preroll().InMilliseconds() << "ms"
130 << " codec_delay: " << codec_delay() << " has extra data? " 90 << " codec_delay: " << codec_delay() << " has extra data? "
131 << (extra_data().empty() ? "false" : "true") << " encrypted? " 91 << (extra_data().empty() ? "false" : "true") << " encrypted? "
132 << (is_encrypted() ? "true" : "false"); 92 << (is_encrypted() ? "true" : "false");
133 return s.str(); 93 return s.str();
134 } 94 }
135 95
136 } // namespace media 96 } // namespace media
OLDNEW
« no previous file with comments | « media/base/audio_decoder_config.h ('k') | media/ffmpeg/ffmpeg_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698