| 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; | 434 return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; |
| 435 } | 435 } |
| 436 if (encoded_complete_callback_ == NULL) { | 436 if (encoded_complete_callback_ == NULL) { |
| 437 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; | 437 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; |
| 438 } | 438 } |
| 439 VideoFrameType frame_type = kDeltaFrame; | 439 VideoFrameType frame_type = kDeltaFrame; |
| 440 // We only support one stream at the moment. | 440 // We only support one stream at the moment. |
| 441 if (frame_types && frame_types->size() > 0) { | 441 if (frame_types && frame_types->size() > 0) { |
| 442 frame_type = (*frame_types)[0]; | 442 frame_type = (*frame_types)[0]; |
| 443 } | 443 } |
| 444 DCHECK_EQ(input_image.width(), static_cast<int>(raw_->d_w)); | 444 RTC_DCHECK_EQ(input_image.width(), static_cast<int>(raw_->d_w)); |
| 445 DCHECK_EQ(input_image.height(), static_cast<int>(raw_->d_h)); | 445 RTC_DCHECK_EQ(input_image.height(), static_cast<int>(raw_->d_h)); |
| 446 | 446 |
| 447 // Set input image for use in the callback. | 447 // Set input image for use in the callback. |
| 448 // This was necessary since you need some information from input_image. | 448 // This was necessary since you need some information from input_image. |
| 449 // You can save only the necessary information (such as timestamp) instead of | 449 // You can save only the necessary information (such as timestamp) instead of |
| 450 // doing this. | 450 // doing this. |
| 451 input_image_ = &input_image; | 451 input_image_ = &input_image; |
| 452 | 452 |
| 453 // Image in vpx_image_t format. | 453 // Image in vpx_image_t format. |
| 454 // Input image is const. VPX's raw image is not defined as const. | 454 // Input image is const. VPX's raw image is not defined as const. |
| 455 raw_->planes[VPX_PLANE_Y] = const_cast<uint8_t*>(input_image.buffer(kYPlane)); | 455 raw_->planes[VPX_PLANE_Y] = const_cast<uint8_t*>(input_image.buffer(kYPlane)); |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 decoder_ = NULL; | 779 decoder_ = NULL; |
| 780 } | 780 } |
| 781 // Releases buffers from the pool. Any buffers not in use are deleted. Buffers | 781 // Releases buffers from the pool. Any buffers not in use are deleted. Buffers |
| 782 // still referenced externally are deleted once fully released, not returning | 782 // still referenced externally are deleted once fully released, not returning |
| 783 // to the pool. | 783 // to the pool. |
| 784 frame_buffer_pool_.ClearPool(); | 784 frame_buffer_pool_.ClearPool(); |
| 785 inited_ = false; | 785 inited_ = false; |
| 786 return WEBRTC_VIDEO_CODEC_OK; | 786 return WEBRTC_VIDEO_CODEC_OK; |
| 787 } | 787 } |
| 788 } // namespace webrtc | 788 } // namespace webrtc |
| OLD | NEW |