| 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 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1078 propagation_cnt_(-1), | 1078 propagation_cnt_(-1), |
| 1079 last_frame_width_(0), | 1079 last_frame_width_(0), |
| 1080 last_frame_height_(0), | 1080 last_frame_height_(0), |
| 1081 key_frame_required_(true) {} | 1081 key_frame_required_(true) {} |
| 1082 | 1082 |
| 1083 VP8DecoderImpl::~VP8DecoderImpl() { | 1083 VP8DecoderImpl::~VP8DecoderImpl() { |
| 1084 inited_ = true; // in order to do the actual release | 1084 inited_ = true; // in order to do the actual release |
| 1085 Release(); | 1085 Release(); |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 int VP8DecoderImpl::Reset() { | |
| 1089 if (!inited_) { | |
| 1090 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; | |
| 1091 } | |
| 1092 InitDecode(&codec_, 1); | |
| 1093 propagation_cnt_ = -1; | |
| 1094 return WEBRTC_VIDEO_CODEC_OK; | |
| 1095 } | |
| 1096 | |
| 1097 int VP8DecoderImpl::InitDecode(const VideoCodec* inst, int number_of_cores) { | 1088 int VP8DecoderImpl::InitDecode(const VideoCodec* inst, int number_of_cores) { |
| 1098 int ret_val = Release(); | 1089 int ret_val = Release(); |
| 1099 if (ret_val < 0) { | 1090 if (ret_val < 0) { |
| 1100 return ret_val; | 1091 return ret_val; |
| 1101 } | 1092 } |
| 1102 if (decoder_ == NULL) { | 1093 if (decoder_ == NULL) { |
| 1103 decoder_ = new vpx_codec_ctx_t; | 1094 decoder_ = new vpx_codec_ctx_t; |
| 1104 } | 1095 } |
| 1105 if (inst && inst->codecType == kVideoCodecVP8) { | 1096 if (inst && inst->codecType == kVideoCodecVP8) { |
| 1106 feedback_mode_ = inst->codecSpecific.VP8.feedbackModeOn; | 1097 feedback_mode_ = inst->codecSpecific.VP8.feedbackModeOn; |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1409 return -1; | 1400 return -1; |
| 1410 } | 1401 } |
| 1411 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) != | 1402 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) != |
| 1412 VPX_CODEC_OK) { | 1403 VPX_CODEC_OK) { |
| 1413 return -1; | 1404 return -1; |
| 1414 } | 1405 } |
| 1415 return 0; | 1406 return 0; |
| 1416 } | 1407 } |
| 1417 | 1408 |
| 1418 } // namespace webrtc | 1409 } // namespace webrtc |
| OLD | NEW |