summaryrefslogtreecommitdiff
path: root/chromium/media/base/audio_codecs.h
blob: 5eb5ddcb1a4b0a6972dacc69f11d2f79ad7da16b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// 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.

#ifndef MEDIA_BASE_AUDIO_CODECS_H_
#define MEDIA_BASE_AUDIO_CODECS_H_

#include <string>
#include "media/base/media_export.h"

namespace media {

enum AudioCodec {
  // These values are histogrammed over time; do not change their ordinal
  // values.  When deleting a codec replace it with a dummy value; when adding a
  // codec, do so at the bottom before kAudioCodecMax, and update the value of
  // kAudioCodecMax to equal the new codec.
  kUnknownAudioCodec = 0,
  kCodecAAC = 1,
  kCodecMP3 = 2,
  kCodecPCM = 3,
  kCodecVorbis = 4,
  kCodecFLAC = 5,
  kCodecAMR_NB = 6,
  kCodecAMR_WB = 7,
  kCodecPCM_MULAW = 8,
  kCodecGSM_MS = 9,
  kCodecPCM_S16BE = 10,
  kCodecPCM_S24BE = 11,
  kCodecOpus = 12,
  kCodecEAC3 = 13,
  kCodecPCM_ALAW = 14,
  kCodecALAC = 15,
  kCodecAC3 = 16,
  kCodecMpegHAudio = 17,
  // DO NOT ADD RANDOM AUDIO CODECS!
  //
  // The only acceptable time to add a new codec is if there is production code
  // that uses said codec in the same CL.

  // Must always be equal to the largest entry ever logged.
  kAudioCodecMax = kCodecMpegHAudio,
};

enum class AudioCodecProfile {
  // These values are histogrammed over time; do not change their ordinal
  // values.  When deleting a profile replace it with a dummy value; when adding
  // a profile, do so at the bottom before kMaxValue, and update the value of
  // kMaxValue to equal the new codec.
  kUnknown = 0,
  kXHE_AAC = 1,
  kMaxValue = kXHE_AAC,
};

std::string MEDIA_EXPORT GetCodecName(AudioCodec codec);
std::string MEDIA_EXPORT GetProfileName(AudioCodecProfile profile);

MEDIA_EXPORT AudioCodec StringToAudioCodec(const std::string& codec_id);

}  // namespace media

#endif  // MEDIA_BASE_AUDIO_CODECS_H_