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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 void Reset() override; | 70 void Reset() override; |
71 bool SetFec(bool enable) override; | 71 bool SetFec(bool enable) override; |
72 | 72 |
73 // Set Opus DTX. Once enabled, Opus stops transmission, when it detects voice | 73 // Set Opus DTX. Once enabled, Opus stops transmission, when it detects voice |
74 // being inactive. During that, it still sends 2 packets (one for content, one | 74 // being inactive. During that, it still sends 2 packets (one for content, one |
75 // for signaling) about every 400 ms. | 75 // for signaling) about every 400 ms. |
76 bool SetDtx(bool enable) override; | 76 bool SetDtx(bool enable) override; |
77 | 77 |
78 bool SetApplication(Application application) override; | 78 bool SetApplication(Application application) override; |
79 bool SetMaxPlaybackRate(int frequency_hz) override; | 79 void SetMaxPlaybackRate(int frequency_hz) override; |
80 void SetProjectedPacketLossRate(double fraction) override; | 80 void SetProjectedPacketLossRate(double fraction) override; |
81 void SetTargetBitrate(int target_bps) override; | 81 void SetTargetBitrate(int target_bps) override; |
82 | 82 |
83 // Getters for testing. | 83 // Getters for testing. |
84 double packet_loss_rate() const { return packet_loss_rate_; } | 84 double packet_loss_rate() const { return packet_loss_rate_; } |
85 ApplicationMode application() const { return config_.application; } | 85 ApplicationMode application() const { return config_.application; } |
86 bool dtx_enabled() const { return config_.dtx_enabled; } | 86 bool dtx_enabled() const { return config_.dtx_enabled; } |
87 | 87 |
88 private: | 88 private: |
89 int Num10msFramesPerPacket() const; | 89 int Num10msFramesPerPacket() const; |
90 int SamplesPer10msFrame() const; | 90 int SamplesPer10msFrame() const; |
91 bool RecreateEncoderInstance(const Config& config); | 91 bool RecreateEncoderInstance(const Config& config); |
92 | 92 |
93 Config config_; | 93 Config config_; |
94 double packet_loss_rate_; | 94 double packet_loss_rate_; |
95 std::vector<int16_t> input_buffer_; | 95 std::vector<int16_t> input_buffer_; |
96 OpusEncInst* inst_; | 96 OpusEncInst* inst_; |
97 uint32_t first_timestamp_in_buffer_; | 97 uint32_t first_timestamp_in_buffer_; |
98 }; | 98 }; |
99 | 99 |
100 } // namespace webrtc | 100 } // namespace webrtc |
101 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_OPUS_INTERFACE_AUDIO_ENCODER_OPUS_
H_ | 101 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_OPUS_INTERFACE_AUDIO_ENCODER_OPUS_
H_ |
OLD | NEW |