| OLD | NEW |
| 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 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 } | 80 } |
| 81 | 81 |
| 82 int32_t VideoDecoderSoftwareFallbackWrapper::Decode( | 82 int32_t VideoDecoderSoftwareFallbackWrapper::Decode( |
| 83 const EncodedImage& input_image, | 83 const EncodedImage& input_image, |
| 84 bool missing_frames, | 84 bool missing_frames, |
| 85 const RTPFragmentationHeader* fragmentation, | 85 const RTPFragmentationHeader* fragmentation, |
| 86 const CodecSpecificInfo* codec_specific_info, | 86 const CodecSpecificInfo* codec_specific_info, |
| 87 int64_t render_time_ms) { | 87 int64_t render_time_ms) { |
| 88 // Try decoding with the provided decoder on every keyframe or when there's no | 88 // Try decoding with the provided decoder on every keyframe or when there's no |
| 89 // fallback decoder. This is the normal case. | 89 // fallback decoder. This is the normal case. |
| 90 if (!fallback_decoder_ || input_image._frameType == kKeyFrame) { | 90 if (!fallback_decoder_ || input_image._frameType == kVideoFrameKey) { |
| 91 int32_t ret = decoder_->Decode(input_image, missing_frames, fragmentation, | 91 int32_t ret = decoder_->Decode(input_image, missing_frames, fragmentation, |
| 92 codec_specific_info, render_time_ms); | 92 codec_specific_info, render_time_ms); |
| 93 if (ret == WEBRTC_VIDEO_CODEC_OK) { | 93 if (ret == WEBRTC_VIDEO_CODEC_OK) { |
| 94 if (fallback_decoder_) { | 94 if (fallback_decoder_) { |
| 95 // Decode OK -> stop using fallback decoder. | 95 // Decode OK -> stop using fallback decoder. |
| 96 fallback_decoder_->Release(); | 96 fallback_decoder_->Release(); |
| 97 fallback_decoder_.reset(); | 97 fallback_decoder_.reset(); |
| 98 return WEBRTC_VIDEO_CODEC_OK; | 98 return WEBRTC_VIDEO_CODEC_OK; |
| 99 } | 99 } |
| 100 } | 100 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 125 return decoder_->Release(); | 125 return decoder_->Release(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 int32_t VideoDecoderSoftwareFallbackWrapper::Reset() { | 128 int32_t VideoDecoderSoftwareFallbackWrapper::Reset() { |
| 129 if (fallback_decoder_) | 129 if (fallback_decoder_) |
| 130 fallback_decoder_->Reset(); | 130 fallback_decoder_->Reset(); |
| 131 return decoder_->Reset(); | 131 return decoder_->Reset(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace webrtc | 134 } // namespace webrtc |
| OLD | NEW |