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