L16 implementation of the Audio{En,De}coderFactoryTemplate APIs

BUG=webrtc:7836, webrtc:7842

Review-Url: https://codereview.webrtc.org/2995523002
Cr-Commit-Position: refs/heads/master@{#19354}
This commit is contained in:
kwiberg
2017-08-15 06:30:18 -07:00
committed by Commit Bot
parent cf5d485e14
commit edff94df62
11 changed files with 322 additions and 0 deletions

View File

@ -0,0 +1,25 @@
/*
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b_common.h"
namespace webrtc {
void Pcm16BAppendSupportedCodecSpecs(std::vector<AudioCodecSpec>* specs) {
for (size_t num_channels : {1, 2}) {
for (int sample_rate_hz : {8000, 16000, 32000}) {
specs->push_back(
{{"L16", sample_rate_hz, num_channels},
{sample_rate_hz, num_channels, sample_rate_hz * num_channels * 16}});
}
}
}
} // namespace webrtc

View File

@ -0,0 +1,22 @@
/*
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_PCM16B_PCM16B_COMMON_H_
#define WEBRTC_MODULES_AUDIO_CODING_CODECS_PCM16B_PCM16B_COMMON_H_
#include <vector>
#include "webrtc/api/audio_codecs/audio_decoder_factory.h"
namespace webrtc {
void Pcm16BAppendSupportedCodecSpecs(std::vector<AudioCodecSpec>* specs);
}
#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_PCM16B_PCM16B_COMMON_H_