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

Side by Side Diff: webrtc/modules/audio_coding/codecs/opus/interface/audio_encoder_opus.h

Issue 1176303004: Fix a data race in AudioEncoderMutableImpl and derived classes (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Return config_ by value instead of reference Created 5 years, 6 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 bool SetFec(bool enable) override; 86 bool SetFec(bool enable) override;
87 87
88 // Set Opus DTX. Once enabled, Opus stops transmission, when it detects voice 88 // Set Opus DTX. Once enabled, Opus stops transmission, when it detects voice
89 // being inactive. During that, it still sends 2 packets (one for content, one 89 // being inactive. During that, it still sends 2 packets (one for content, one
90 // for signaling) about every 400 ms. 90 // for signaling) about every 400 ms.
91 bool SetDtx(bool enable) override; 91 bool SetDtx(bool enable) override;
92 92
93 bool SetApplication(Application application) override; 93 bool SetApplication(Application application) override;
94 bool SetMaxPlaybackRate(int frequency_hz) override; 94 bool SetMaxPlaybackRate(int frequency_hz) override;
95 AudioEncoderOpus::ApplicationMode application() const { 95 AudioEncoderOpus::ApplicationMode application() const {
96 CriticalSectionScoped cs(encoder_lock_.get());
96 return encoder()->application(); 97 return encoder()->application();
97 } 98 }
98 double packet_loss_rate() const { return encoder()->packet_loss_rate(); } 99 double packet_loss_rate() const {
99 bool dtx_enabled() const { return encoder()->dtx_enabled(); } 100 CriticalSectionScoped cs(encoder_lock_.get());
101 return encoder()->packet_loss_rate();
102 }
103 bool dtx_enabled() const {
104 CriticalSectionScoped cs(encoder_lock_.get());
105 return encoder()->dtx_enabled();
106 }
100 }; 107 };
101 108
102 } // namespace webrtc 109 } // namespace webrtc
103 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_OPUS_INTERFACE_AUDIO_ENCODER_OPUS_ H_ 110 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_OPUS_INTERFACE_AUDIO_ENCODER_OPUS_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698