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

Side by Side Diff: webrtc/modules/audio_coding/acm2/codec_manager.h

Issue 1702943002: Pass ownership of external encoders to the ACM (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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) 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 23 matching lines...) Expand all
34 34
35 // Parses the given specification. On success, returns true and updates the 35 // Parses the given specification. On success, returns true and updates the
36 // stored CodecInst and stack parameters; on error, returns false. 36 // stored CodecInst and stack parameters; on error, returns false.
37 bool RegisterEncoder(const CodecInst& send_codec); 37 bool RegisterEncoder(const CodecInst& send_codec);
38 38
39 static CodecInst ForgeCodecInst(const AudioEncoder* external_speech_encoder); 39 static CodecInst ForgeCodecInst(const AudioEncoder* external_speech_encoder);
40 40
41 const CodecInst* GetCodecInst() const { 41 const CodecInst* GetCodecInst() const {
42 return send_codec_inst_ ? &*send_codec_inst_ : nullptr; 42 return send_codec_inst_ ? &*send_codec_inst_ : nullptr;
43 } 43 }
44
45 void UnsetCodecInst() { send_codec_inst_ = rtc::Optional<CodecInst>(); }
46
44 const RentACodec::StackParameters* GetStackParams() const { 47 const RentACodec::StackParameters* GetStackParams() const {
45 return &codec_stack_params_; 48 return &codec_stack_params_;
46 } 49 }
47 RentACodec::StackParameters* GetStackParams() { return &codec_stack_params_; } 50 RentACodec::StackParameters* GetStackParams() { return &codec_stack_params_; }
48 51
49 bool SetCopyRed(bool enable); 52 bool SetCopyRed(bool enable);
50 53
51 bool SetVAD(bool enable, ACMVADMode mode); 54 bool SetVAD(bool enable, ACMVADMode mode);
52 55
53 bool SetCodecFEC(bool enable_codec_fec); 56 bool SetCodecFEC(bool enable_codec_fec);
54 57
55 private: 58 private:
56 rtc::ThreadChecker thread_checker_; 59 rtc::ThreadChecker thread_checker_;
57 rtc::Optional<CodecInst> send_codec_inst_; 60 rtc::Optional<CodecInst> send_codec_inst_;
58 RentACodec::StackParameters codec_stack_params_; 61 RentACodec::StackParameters codec_stack_params_;
59 62
60 RTC_DISALLOW_COPY_AND_ASSIGN(CodecManager); 63 RTC_DISALLOW_COPY_AND_ASSIGN(CodecManager);
61 }; 64 };
62 65
63 } // namespace acm2 66 } // namespace acm2
64 } // namespace webrtc 67 } // namespace webrtc
65 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_CODEC_MANAGER_H_ 68 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_CODEC_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698