Note: We no longer publish the latest version of our code here. We primarily use a kumc-bmi github organization. The heron ETL repository, in particular, is not public. Peers in the informatics community should see MultiSiteDev for details on requesting access.

source: webrtc/webrtc/modules/audio_coding/main/acm2/acm_pcmu.cc @ 0:4bda6873e34c

pub_scrub_3792 tip
Last change on this file since 0:4bda6873e34c was 0:4bda6873e34c, checked in by Michael Prittie <mprittie@…>, 6 years ago

Scrubbed password for publication.

File size: 1.8 KB
Line 
1/*
2 *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
4 *  Use of this source code is governed by a BSD-style license
5 *  that can be found in the LICENSE file in the root of the source
6 *  tree. An additional intellectual property rights grant can be found
7 *  in the file PATENTS.  All contributing project authors may
8 *  be found in the AUTHORS file in the root of the source tree.
9 */
10
11#include "webrtc/modules/audio_coding/main/acm2/acm_pcmu.h"
12
13#include "webrtc/modules/audio_coding/codecs/g711/include/g711_interface.h"
14#include "webrtc/modules/audio_coding/main/acm2/acm_common_defs.h"
15#include "webrtc/system_wrappers/interface/trace.h"
16
17// Codec interface.
18
19namespace webrtc {
20
21namespace acm2 {
22
23ACMPCMU::ACMPCMU(int16_t codec_id) { codec_id_ = codec_id; }
24
25ACMPCMU::~ACMPCMU() {}
26
27int16_t ACMPCMU::InternalEncode(uint8_t* bitstream,
28                                int16_t* bitstream_len_byte) {
29  *bitstream_len_byte = WebRtcG711_EncodeU(
30      NULL, &in_audio_[in_audio_ix_read_], frame_len_smpl_ * num_channels_,
31      reinterpret_cast<int16_t*>(bitstream));
32
33  // Increment the read index this tell the caller that how far
34  // we have gone forward in reading the audio buffer.
35  in_audio_ix_read_ += frame_len_smpl_ * num_channels_;
36  return *bitstream_len_byte;
37}
38
39int16_t ACMPCMU::InternalInitEncoder(WebRtcACMCodecParams* /* codec_params */) {
40  // This codec does not need initialization, PCM has no instance.
41  return 0;
42}
43
44ACMGenericCodec* ACMPCMU::CreateInstance(void) { return NULL; }
45
46int16_t ACMPCMU::InternalCreateEncoder() {
47  // PCM has no instance.
48  return 0;
49}
50
51void ACMPCMU::InternalDestructEncoderInst(void* /* ptr_inst */) {
52  // PCM has no instance.
53}
54
55void ACMPCMU::DestructEncoderSafe() {
56  // PCM has no instance.
57  encoder_exist_ = false;
58  encoder_initialized_ = false;
59}
60
61}  // namespace acm2
62
63}  // namespace webrtc
Note: See TracBrowser for help on using the repository browser.