| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 protected: | 81 protected: |
| 82 size_t EncodeCall(const int16_t* audio, | 82 size_t EncodeCall(const int16_t* audio, |
| 83 size_t input_len, | 83 size_t input_len, |
| 84 uint8_t* encoded) override; | 84 uint8_t* encoded) override; |
| 85 | 85 |
| 86 int BytesPerSample() const override; | 86 int BytesPerSample() const override; |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 static const int kSampleRateHz = 8000; | 89 static const int kSampleRateHz = 8000; |
| 90 RTC_DISALLOW_COPY_AND_ASSIGN(AudioEncoderPcmA); |
| 90 }; | 91 }; |
| 91 | 92 |
| 92 class AudioEncoderPcmU final : public AudioEncoderPcm { | 93 class AudioEncoderPcmU final : public AudioEncoderPcm { |
| 93 public: | 94 public: |
| 94 struct Config : public AudioEncoderPcm::Config { | 95 struct Config : public AudioEncoderPcm::Config { |
| 95 Config() : AudioEncoderPcm::Config(0) {} | 96 Config() : AudioEncoderPcm::Config(0) {} |
| 96 }; | 97 }; |
| 97 | 98 |
| 98 explicit AudioEncoderPcmU(const Config& config) | 99 explicit AudioEncoderPcmU(const Config& config) |
| 99 : AudioEncoderPcm(config, kSampleRateHz) {} | 100 : AudioEncoderPcm(config, kSampleRateHz) {} |
| 100 explicit AudioEncoderPcmU(const CodecInst& codec_inst); | 101 explicit AudioEncoderPcmU(const CodecInst& codec_inst); |
| 101 | 102 |
| 102 protected: | 103 protected: |
| 103 size_t EncodeCall(const int16_t* audio, | 104 size_t EncodeCall(const int16_t* audio, |
| 104 size_t input_len, | 105 size_t input_len, |
| 105 uint8_t* encoded) override; | 106 uint8_t* encoded) override; |
| 106 | 107 |
| 107 int BytesPerSample() const override; | 108 int BytesPerSample() const override; |
| 108 | 109 |
| 109 private: | 110 private: |
| 110 static const int kSampleRateHz = 8000; | 111 static const int kSampleRateHz = 8000; |
| 112 RTC_DISALLOW_COPY_AND_ASSIGN(AudioEncoderPcmU); |
| 111 }; | 113 }; |
| 112 | 114 |
| 113 } // namespace webrtc | 115 } // namespace webrtc |
| 116 |
| 114 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_G711_INCLUDE_AUDIO_ENCODER_PCM_H_ | 117 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_G711_INCLUDE_AUDIO_ENCODER_PCM_H_ |
| OLD | NEW |