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

Side by Side Diff: webrtc/modules/audio_coding/neteq/decoder_database.h

Issue 1990803004: Turned AudioDecoderFactory into a RefCounted thing to use with scoped_refptr. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Removed AudioDecoderFactory destructor declaration. Created 4 years, 7 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 private: 63 private:
64 const rtc::Optional<SdpAudioFormat> audio_format_; 64 const rtc::Optional<SdpAudioFormat> audio_format_;
65 std::unique_ptr<AudioDecoder> decoder_; 65 std::unique_ptr<AudioDecoder> decoder_;
66 }; 66 };
67 67
68 // Maximum value for 8 bits, and an invalid RTP payload type (since it is 68 // Maximum value for 8 bits, and an invalid RTP payload type (since it is
69 // only 7 bits). 69 // only 7 bits).
70 static const uint8_t kRtpPayloadTypeError = 0xFF; 70 static const uint8_t kRtpPayloadTypeError = 0xFF;
71 71
72 DecoderDatabase(std::unique_ptr<AudioDecoderFactory> decoder_factory); 72 DecoderDatabase(
73 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory);
73 74
74 virtual ~DecoderDatabase(); 75 virtual ~DecoderDatabase();
75 76
76 // Returns true if the database is empty. 77 // Returns true if the database is empty.
77 virtual bool Empty() const; 78 virtual bool Empty() const;
78 79
79 // Returns the number of decoders registered in the database. 80 // Returns the number of decoders registered in the database.
80 virtual int Size() const; 81 virtual int Size() const;
81 82
82 // Resets the database, erasing all registered payload types, and deleting 83 // Resets the database, erasing all registered payload types, and deleting
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 // registered in the database. Otherwise, returns kDecoderNotFound. 154 // registered in the database. Otherwise, returns kDecoderNotFound.
154 virtual int CheckPayloadTypes(const PacketList& packet_list) const; 155 virtual int CheckPayloadTypes(const PacketList& packet_list) const;
155 156
156 private: 157 private:
157 typedef std::map<uint8_t, DecoderInfo> DecoderMap; 158 typedef std::map<uint8_t, DecoderInfo> DecoderMap;
158 159
159 DecoderMap decoders_; 160 DecoderMap decoders_;
160 int active_decoder_type_; 161 int active_decoder_type_;
161 int active_cng_decoder_type_; 162 int active_cng_decoder_type_;
162 std::unique_ptr<ComfortNoiseDecoder> active_cng_decoder_; 163 std::unique_ptr<ComfortNoiseDecoder> active_cng_decoder_;
163 const std::unique_ptr<AudioDecoderFactory> decoder_factory_; 164 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_;
164 165
165 RTC_DISALLOW_COPY_AND_ASSIGN(DecoderDatabase); 166 RTC_DISALLOW_COPY_AND_ASSIGN(DecoderDatabase);
166 }; 167 };
167 168
168 } // namespace webrtc 169 } // namespace webrtc
169 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_DECODER_DATABASE_H_ 170 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_DECODER_DATABASE_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/decision_logic_unittest.cc ('k') | webrtc/modules/audio_coding/neteq/decoder_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698