| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 162 } |
| 163 if (active_decoder_type_ == rtp_payload_type) { | 163 if (active_decoder_type_ == rtp_payload_type) { |
| 164 active_decoder_type_ = -1; // No active decoder. | 164 active_decoder_type_ = -1; // No active decoder. |
| 165 } | 165 } |
| 166 if (active_cng_decoder_type_ == rtp_payload_type) { | 166 if (active_cng_decoder_type_ == rtp_payload_type) { |
| 167 active_cng_decoder_type_ = -1; // No active CNG decoder. | 167 active_cng_decoder_type_ = -1; // No active CNG decoder. |
| 168 } | 168 } |
| 169 return kOK; | 169 return kOK; |
| 170 } | 170 } |
| 171 | 171 |
| 172 void DecoderDatabase::RemoveAll() { |
| 173 decoders_.clear(); |
| 174 active_decoder_type_ = -1; // No active decoder. |
| 175 active_cng_decoder_type_ = -1; // No active CNG decoder. |
| 176 } |
| 177 |
| 172 const DecoderDatabase::DecoderInfo* DecoderDatabase::GetDecoderInfo( | 178 const DecoderDatabase::DecoderInfo* DecoderDatabase::GetDecoderInfo( |
| 173 uint8_t rtp_payload_type) const { | 179 uint8_t rtp_payload_type) const { |
| 174 DecoderMap::const_iterator it = decoders_.find(rtp_payload_type); | 180 DecoderMap::const_iterator it = decoders_.find(rtp_payload_type); |
| 175 if (it == decoders_.end()) { | 181 if (it == decoders_.end()) { |
| 176 // Decoder not found. | 182 // Decoder not found. |
| 177 return NULL; | 183 return NULL; |
| 178 } | 184 } |
| 179 return &(*it).second; | 185 return &(*it).second; |
| 180 } | 186 } |
| 181 | 187 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 LOG(LS_WARNING) << "CheckPayloadTypes: unknown RTP payload type " | 293 LOG(LS_WARNING) << "CheckPayloadTypes: unknown RTP payload type " |
| 288 << static_cast<int>((*it)->header.payloadType); | 294 << static_cast<int>((*it)->header.payloadType); |
| 289 return kDecoderNotFound; | 295 return kDecoderNotFound; |
| 290 } | 296 } |
| 291 } | 297 } |
| 292 return kOK; | 298 return kOK; |
| 293 } | 299 } |
| 294 | 300 |
| 295 | 301 |
| 296 } // namespace webrtc | 302 } // namespace webrtc |
| OLD | NEW |