| OLD | NEW |
| 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 Loading... |
| 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(std::shared_ptr<AudioDecoderFactory> decoder_factory); |
| 73 | 73 |
| 74 virtual ~DecoderDatabase(); | 74 virtual ~DecoderDatabase(); |
| 75 | 75 |
| 76 // Returns true if the database is empty. | 76 // Returns true if the database is empty. |
| 77 virtual bool Empty() const; | 77 virtual bool Empty() const; |
| 78 | 78 |
| 79 // Returns the number of decoders registered in the database. | 79 // Returns the number of decoders registered in the database. |
| 80 virtual int Size() const; | 80 virtual int Size() const; |
| 81 | 81 |
| 82 // Resets the database, erasing all registered payload types, and deleting | 82 // Resets the database, erasing all registered payload types, and deleting |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // registered in the database. Otherwise, returns kDecoderNotFound. | 153 // registered in the database. Otherwise, returns kDecoderNotFound. |
| 154 virtual int CheckPayloadTypes(const PacketList& packet_list) const; | 154 virtual int CheckPayloadTypes(const PacketList& packet_list) const; |
| 155 | 155 |
| 156 private: | 156 private: |
| 157 typedef std::map<uint8_t, DecoderInfo> DecoderMap; | 157 typedef std::map<uint8_t, DecoderInfo> DecoderMap; |
| 158 | 158 |
| 159 DecoderMap decoders_; | 159 DecoderMap decoders_; |
| 160 int active_decoder_type_; | 160 int active_decoder_type_; |
| 161 int active_cng_decoder_type_; | 161 int active_cng_decoder_type_; |
| 162 std::unique_ptr<ComfortNoiseDecoder> active_cng_decoder_; | 162 std::unique_ptr<ComfortNoiseDecoder> active_cng_decoder_; |
| 163 const std::unique_ptr<AudioDecoderFactory> decoder_factory_; | 163 std::shared_ptr<AudioDecoderFactory> decoder_factory_; |
| 164 | 164 |
| 165 RTC_DISALLOW_COPY_AND_ASSIGN(DecoderDatabase); | 165 RTC_DISALLOW_COPY_AND_ASSIGN(DecoderDatabase); |
| 166 }; | 166 }; |
| 167 | 167 |
| 168 } // namespace webrtc | 168 } // namespace webrtc |
| 169 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_DECODER_DATABASE_H_ | 169 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_DECODER_DATABASE_H_ |
| OLD | NEW |