| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 int num_buffers_in_use = frame_buffer_pool_.GetNumBuffersInUse(); | 833 int num_buffers_in_use = frame_buffer_pool_.GetNumBuffersInUse(); |
| 834 if (num_buffers_in_use > 0) { | 834 if (num_buffers_in_use > 0) { |
| 835 // The frame buffers are reference counted and frames are exposed after | 835 // The frame buffers are reference counted and frames are exposed after |
| 836 // decoding. There may be valid usage cases where previous frames are still | 836 // decoding. There may be valid usage cases where previous frames are still |
| 837 // referenced after ~VP9DecoderImpl that is not a leak. | 837 // referenced after ~VP9DecoderImpl that is not a leak. |
| 838 LOG(LS_INFO) << num_buffers_in_use << " Vp9FrameBuffers are still " | 838 LOG(LS_INFO) << num_buffers_in_use << " Vp9FrameBuffers are still " |
| 839 << "referenced during ~VP9DecoderImpl."; | 839 << "referenced during ~VP9DecoderImpl."; |
| 840 } | 840 } |
| 841 } | 841 } |
| 842 | 842 |
| 843 int VP9DecoderImpl::Reset() { | |
| 844 if (!inited_) { | |
| 845 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; | |
| 846 } | |
| 847 InitDecode(&codec_, 1); | |
| 848 return WEBRTC_VIDEO_CODEC_OK; | |
| 849 } | |
| 850 | |
| 851 int VP9DecoderImpl::InitDecode(const VideoCodec* inst, int number_of_cores) { | 843 int VP9DecoderImpl::InitDecode(const VideoCodec* inst, int number_of_cores) { |
| 852 if (inst == NULL) { | 844 if (inst == NULL) { |
| 853 return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; | 845 return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; |
| 854 } | 846 } |
| 855 int ret_val = Release(); | 847 int ret_val = Release(); |
| 856 if (ret_val < 0) { | 848 if (ret_val < 0) { |
| 857 return ret_val; | 849 return ret_val; |
| 858 } | 850 } |
| 859 if (decoder_ == NULL) { | 851 if (decoder_ == NULL) { |
| 860 decoder_ = new vpx_codec_ctx_t; | 852 decoder_ = new vpx_codec_ctx_t; |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 frame_buffer_pool_.ClearPool(); | 975 frame_buffer_pool_.ClearPool(); |
| 984 inited_ = false; | 976 inited_ = false; |
| 985 return WEBRTC_VIDEO_CODEC_OK; | 977 return WEBRTC_VIDEO_CODEC_OK; |
| 986 } | 978 } |
| 987 | 979 |
| 988 const char* VP9DecoderImpl::ImplementationName() const { | 980 const char* VP9DecoderImpl::ImplementationName() const { |
| 989 return "libvpx"; | 981 return "libvpx"; |
| 990 } | 982 } |
| 991 | 983 |
| 992 } // namespace webrtc | 984 } // namespace webrtc |
| OLD | NEW |