Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(605)

Side by Side Diff: webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.h

Issue 1967503002: Audio codec usage statistics (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: CL attempt 2. Added/responded to most comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 : AudioEncoderPcm(config, kSampleRateHz) {} 77 : AudioEncoderPcm(config, kSampleRateHz) {}
78 explicit AudioEncoderPcmA(const CodecInst& codec_inst); 78 explicit AudioEncoderPcmA(const CodecInst& codec_inst);
79 79
80 protected: 80 protected:
81 size_t EncodeCall(const int16_t* audio, 81 size_t EncodeCall(const int16_t* audio,
82 size_t input_len, 82 size_t input_len,
83 uint8_t* encoded) override; 83 uint8_t* encoded) override;
84 84
85 size_t BytesPerSample() const override; 85 size_t BytesPerSample() const override;
86 86
87 const char* GetCodecName() const override;
88
87 private: 89 private:
88 static const int kSampleRateHz = 8000; 90 static const int kSampleRateHz = 8000;
89 RTC_DISALLOW_COPY_AND_ASSIGN(AudioEncoderPcmA); 91 RTC_DISALLOW_COPY_AND_ASSIGN(AudioEncoderPcmA);
90 }; 92 };
91 93
92 class AudioEncoderPcmU final : public AudioEncoderPcm { 94 class AudioEncoderPcmU final : public AudioEncoderPcm {
93 public: 95 public:
94 struct Config : public AudioEncoderPcm::Config { 96 struct Config : public AudioEncoderPcm::Config {
95 Config() : AudioEncoderPcm::Config(0) {} 97 Config() : AudioEncoderPcm::Config(0) {}
96 }; 98 };
97 99
98 explicit AudioEncoderPcmU(const Config& config) 100 explicit AudioEncoderPcmU(const Config& config)
99 : AudioEncoderPcm(config, kSampleRateHz) {} 101 : AudioEncoderPcm(config, kSampleRateHz) {}
100 explicit AudioEncoderPcmU(const CodecInst& codec_inst); 102 explicit AudioEncoderPcmU(const CodecInst& codec_inst);
101 103
102 protected: 104 protected:
103 size_t EncodeCall(const int16_t* audio, 105 size_t EncodeCall(const int16_t* audio,
104 size_t input_len, 106 size_t input_len,
105 uint8_t* encoded) override; 107 uint8_t* encoded) override;
106 108
107 size_t BytesPerSample() const override; 109 size_t BytesPerSample() const override;
108 110
111 const char* GetCodecName() const override;
112
109 private: 113 private:
110 static const int kSampleRateHz = 8000; 114 static const int kSampleRateHz = 8000;
111 RTC_DISALLOW_COPY_AND_ASSIGN(AudioEncoderPcmU); 115 RTC_DISALLOW_COPY_AND_ASSIGN(AudioEncoderPcmU);
112 }; 116 };
113 117
114 } // namespace webrtc 118 } // namespace webrtc
115 119
116 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_G711_AUDIO_ENCODER_PCM_H_ 120 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_G711_AUDIO_ENCODER_PCM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698