diff options
author | ihf@chromium.org <ihf@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-05 22:14:32 +0000 |
---|---|---|
committer | ihf@chromium.org <ihf@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-05 22:14:32 +0000 |
commit | 854369509d5094717c0b2aa0022a4313cbbc13b0 (patch) | |
tree | b8b82b1b67dc509c2282ba8219aef9d442264d01 | |
parent | 93129a6460213e44651fa4c4653ec242982784fd (diff) | |
download | chromium_src-854369509d5094717c0b2aa0022a4313cbbc13b0.zip chromium_src-854369509d5094717c0b2aa0022a4313cbbc13b0.tar.gz chromium_src-854369509d5094717c0b2aa0022a4313cbbc13b0.tar.bz2 |
Add alaw codec for .wav files.
Also add corresponding test. (The test media is already there.)
BUG=chromium:217772
TEST=Played 2 test files on Pixel.
Review URL: https://codereview.chromium.org/25660014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233101 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/browser/media/media_browsertest.cc | 12 | ||||
-rw-r--r-- | media/base/audio_decoder_config.h | 1 | ||||
-rw-r--r-- | media/ffmpeg/ffmpeg_common.cc | 4 |
3 files changed, 13 insertions, 4 deletions
diff --git a/content/browser/media/media_browsertest.cc b/content/browser/media/media_browsertest.cc index 13a85f6..215b3e7 100644 --- a/content/browser/media/media_browsertest.cc +++ b/content/browser/media/media_browsertest.cc @@ -168,16 +168,20 @@ IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearWavGsmms) { PlayAudio("bear_gsm_ms.wav", GetParam()); } -IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearWavMulaw) { - PlayAudio("bear_mulaw.wav", GetParam()); -} - IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearFlac) { PlayAudio("bear.flac", GetParam()); } #endif #endif +IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearWavAlaw) { + PlayAudio("bear_alaw.wav", GetParam()); +} + +IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearWavMulaw) { + PlayAudio("bear_mulaw.wav", GetParam()); +} + IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearWavPcm) { PlayAudio("bear_pcm.wav", GetParam()); } diff --git a/media/base/audio_decoder_config.h b/media/base/audio_decoder_config.h index a17d221..53705cc 100644 --- a/media/base/audio_decoder_config.h +++ b/media/base/audio_decoder_config.h @@ -33,6 +33,7 @@ enum AudioCodec { kCodecPCM_S24BE, kCodecOpus, kCodecEAC3, + kCodecPCM_ALAW, // DO NOT ADD RANDOM AUDIO CODECS! // // The only acceptable time to add a new codec is if there is production code diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc index 1a45134..905e8d9 100644 --- a/media/ffmpeg/ffmpeg_common.cc +++ b/media/ffmpeg/ffmpeg_common.cc @@ -85,6 +85,8 @@ static AudioCodec CodecIDToAudioCodec(AVCodecID codec_id) { return kCodecAMR_WB; case AV_CODEC_ID_GSM_MS: return kCodecGSM_MS; + case AV_CODEC_ID_PCM_ALAW: + return kCodecPCM_ALAW; case AV_CODEC_ID_PCM_MULAW: return kCodecPCM_MULAW; case AV_CODEC_ID_OPUS: @@ -130,6 +132,8 @@ static AVCodecID AudioCodecToCodecID(AudioCodec audio_codec, return AV_CODEC_ID_AMR_WB; case kCodecGSM_MS: return AV_CODEC_ID_GSM_MS; + case kCodecPCM_ALAW: + return AV_CODEC_ID_PCM_ALAW; case kCodecPCM_MULAW: return AV_CODEC_ID_PCM_MULAW; case kCodecOpus: |