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

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

Issue 1821513003: Rent-A-Codec: Reference count the shared iSAC bandwidth estimation state (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@acm-13
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
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/acm2/rent_a_codec.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 #ifndef WEBRTC_MODULES_AUDIO_CODING_ACM2_RENT_A_CODEC_H_ 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_ACM2_RENT_A_CODEC_H_
12 #define WEBRTC_MODULES_AUDIO_CODING_ACM2_RENT_A_CODEC_H_ 12 #define WEBRTC_MODULES_AUDIO_CODING_ACM2_RENT_A_CODEC_H_
13 13
14 #include <stddef.h> 14 #include <stddef.h>
15 #include <map> 15 #include <map>
16 #include <memory> 16 #include <memory>
17 17
18 #include "webrtc/base/array_view.h" 18 #include "webrtc/base/array_view.h"
19 #include "webrtc/base/constructormagic.h" 19 #include "webrtc/base/constructormagic.h"
20 #include "webrtc/base/optional.h" 20 #include "webrtc/base/optional.h"
21 #include "webrtc/base/scoped_ref_ptr.h"
21 #include "webrtc/modules/audio_coding/codecs/audio_decoder.h" 22 #include "webrtc/modules/audio_coding/codecs/audio_decoder.h"
22 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" 23 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h"
23 #include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h" 24 #include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h"
24 #include "webrtc/typedefs.h" 25 #include "webrtc/typedefs.h"
25 26
26 #if defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)
27 #include "webrtc/modules/audio_coding/codecs/isac/locked_bandwidth_info.h"
28 #else
29 // Dummy implementation, for when we don't have iSAC.
30 namespace webrtc {
31 class LockedIsacBandwidthInfo {};
32 }
33 #endif
34
35 namespace webrtc { 27 namespace webrtc {
36 28
37 struct CodecInst; 29 struct CodecInst;
30 class LockedIsacBandwidthInfo;
38 31
39 namespace acm2 { 32 namespace acm2 {
40 33
41 class RentACodec { 34 class RentACodec {
42 public: 35 public:
43 enum class CodecId { 36 enum class CodecId {
44 #if defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX) 37 #if defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)
45 kISAC, 38 kISAC,
46 #endif 39 #endif
47 #ifdef WEBRTC_CODEC_ISAC 40 #ifdef WEBRTC_CODEC_ISAC
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 // will be stolen. 215 // will be stolen.
223 std::unique_ptr<AudioEncoder> RentEncoderStack(StackParameters* param); 216 std::unique_ptr<AudioEncoder> RentEncoderStack(StackParameters* param);
224 217
225 // Creates and returns an iSAC decoder. 218 // Creates and returns an iSAC decoder.
226 std::unique_ptr<AudioDecoder> RentIsacDecoder(); 219 std::unique_ptr<AudioDecoder> RentIsacDecoder();
227 220
228 private: 221 private:
229 std::unique_ptr<AudioEncoder> speech_encoder_; 222 std::unique_ptr<AudioEncoder> speech_encoder_;
230 std::unique_ptr<AudioEncoder> cng_encoder_; 223 std::unique_ptr<AudioEncoder> cng_encoder_;
231 std::unique_ptr<AudioEncoder> red_encoder_; 224 std::unique_ptr<AudioEncoder> red_encoder_;
232 LockedIsacBandwidthInfo isac_bandwidth_info_; 225 rtc::scoped_refptr<LockedIsacBandwidthInfo> isac_bandwidth_info_;
233 226
234 RTC_DISALLOW_COPY_AND_ASSIGN(RentACodec); 227 RTC_DISALLOW_COPY_AND_ASSIGN(RentACodec);
235 }; 228 };
236 229
237 } // namespace acm2 230 } // namespace acm2
238 } // namespace webrtc 231 } // namespace webrtc
239 232
240 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_RENT_A_CODEC_H_ 233 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_RENT_A_CODEC_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/acm2/rent_a_codec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698