OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 return encoder_->RtpTimestampRateHz(); | 75 return encoder_->RtpTimestampRateHz(); |
76 } | 76 } |
77 int Num10MsFramesInNextPacket() const override { | 77 int Num10MsFramesInNextPacket() const override { |
78 CriticalSectionScoped cs(encoder_lock_.get()); | 78 CriticalSectionScoped cs(encoder_lock_.get()); |
79 return encoder_->Num10MsFramesInNextPacket(); | 79 return encoder_->Num10MsFramesInNextPacket(); |
80 } | 80 } |
81 int Max10MsFramesInAPacket() const override { | 81 int Max10MsFramesInAPacket() const override { |
82 CriticalSectionScoped cs(encoder_lock_.get()); | 82 CriticalSectionScoped cs(encoder_lock_.get()); |
83 return encoder_->Max10MsFramesInAPacket(); | 83 return encoder_->Max10MsFramesInAPacket(); |
84 } | 84 } |
85 void SetTargetBitrate(int bits_per_second) override { | 85 int SetTargetBitrate(int bits_per_second) override { |
86 CriticalSectionScoped cs(encoder_lock_.get()); | 86 CriticalSectionScoped cs(encoder_lock_.get()); |
87 encoder_->SetTargetBitrate(bits_per_second); | 87 return encoder_->SetTargetBitrate(bits_per_second); |
88 } | 88 } |
89 void SetProjectedPacketLossRate(double fraction) override { | 89 void SetProjectedPacketLossRate(double fraction) override { |
90 CriticalSectionScoped cs(encoder_lock_.get()); | 90 CriticalSectionScoped cs(encoder_lock_.get()); |
91 encoder_->SetProjectedPacketLossRate(fraction); | 91 encoder_->SetProjectedPacketLossRate(fraction); |
92 } | 92 } |
93 | 93 |
94 protected: | 94 protected: |
95 explicit AudioEncoderMutableImpl(const typename T::Config& config) | 95 explicit AudioEncoderMutableImpl(const typename T::Config& config) |
96 : encoder_lock_(CriticalSectionWrapper::CreateCriticalSection()) { | 96 : encoder_lock_(CriticalSectionWrapper::CreateCriticalSection()) { |
97 Reconstruct(config); | 97 Reconstruct(config); |
(...skipping 22 matching lines...) Expand all Loading... |
120 const rtc::scoped_ptr<CriticalSectionWrapper> encoder_lock_; | 120 const rtc::scoped_ptr<CriticalSectionWrapper> encoder_lock_; |
121 | 121 |
122 private: | 122 private: |
123 rtc::scoped_ptr<T> encoder_ GUARDED_BY(encoder_lock_); | 123 rtc::scoped_ptr<T> encoder_ GUARDED_BY(encoder_lock_); |
124 typename T::Config config_ GUARDED_BY(encoder_lock_); | 124 typename T::Config config_ GUARDED_BY(encoder_lock_); |
125 }; | 125 }; |
126 | 126 |
127 } // namespace webrtc | 127 } // namespace webrtc |
128 | 128 |
129 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_MUTABLE_IMPL_H_ | 129 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_MUTABLE_IMPL_H_ |
OLD | NEW |