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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 av_frame_.reset(av_frame_alloc()); | 234 av_frame_.reset(av_frame_alloc()); |
235 return WEBRTC_VIDEO_CODEC_OK; | 235 return WEBRTC_VIDEO_CODEC_OK; |
236 } | 236 } |
237 | 237 |
238 int32_t H264DecoderImpl::Release() { | 238 int32_t H264DecoderImpl::Release() { |
239 av_context_.reset(); | 239 av_context_.reset(); |
240 av_frame_.reset(); | 240 av_frame_.reset(); |
241 return WEBRTC_VIDEO_CODEC_OK; | 241 return WEBRTC_VIDEO_CODEC_OK; |
242 } | 242 } |
243 | 243 |
244 int32_t H264DecoderImpl::Reset() { | |
245 if (!IsInitialized()) | |
246 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; | |
247 InitDecode(nullptr, 1); | |
248 return WEBRTC_VIDEO_CODEC_OK; | |
249 } | |
250 | |
251 int32_t H264DecoderImpl::RegisterDecodeCompleteCallback( | 244 int32_t H264DecoderImpl::RegisterDecodeCompleteCallback( |
252 DecodedImageCallback* callback) { | 245 DecodedImageCallback* callback) { |
253 decoded_image_callback_ = callback; | 246 decoded_image_callback_ = callback; |
254 return WEBRTC_VIDEO_CODEC_OK; | 247 return WEBRTC_VIDEO_CODEC_OK; |
255 } | 248 } |
256 | 249 |
257 int32_t H264DecoderImpl::Decode(const EncodedImage& input_image, | 250 int32_t H264DecoderImpl::Decode(const EncodedImage& input_image, |
258 bool /*missing_frames*/, | 251 bool /*missing_frames*/, |
259 const RTPFragmentationHeader* /*fragmentation*/, | 252 const RTPFragmentationHeader* /*fragmentation*/, |
260 const CodecSpecificInfo* codec_specific_info, | 253 const CodecSpecificInfo* codec_specific_info, |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 return ret; | 343 return ret; |
351 } | 344 } |
352 return WEBRTC_VIDEO_CODEC_OK; | 345 return WEBRTC_VIDEO_CODEC_OK; |
353 } | 346 } |
354 | 347 |
355 bool H264DecoderImpl::IsInitialized() const { | 348 bool H264DecoderImpl::IsInitialized() const { |
356 return av_context_ != nullptr; | 349 return av_context_ != nullptr; |
357 } | 350 } |
358 | 351 |
359 } // namespace webrtc | 352 } // namespace webrtc |
OLD | NEW |