| 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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 RTC_DCHECK_EQ(input_image.height(), static_cast<int>(raw_->d_h)); | 493 RTC_DCHECK_EQ(input_image.height(), static_cast<int>(raw_->d_h)); |
| 494 | 494 |
| 495 // Set input image for use in the callback. | 495 // Set input image for use in the callback. |
| 496 // This was necessary since you need some information from input_image. | 496 // This was necessary since you need some information from input_image. |
| 497 // You can save only the necessary information (such as timestamp) instead of | 497 // You can save only the necessary information (such as timestamp) instead of |
| 498 // doing this. | 498 // doing this. |
| 499 input_image_ = &input_image; | 499 input_image_ = &input_image; |
| 500 | 500 |
| 501 // Image in vpx_image_t format. | 501 // Image in vpx_image_t format. |
| 502 // Input image is const. VPX's raw image is not defined as const. | 502 // Input image is const. VPX's raw image is not defined as const. |
| 503 raw_->planes[VPX_PLANE_Y] = const_cast<uint8_t*>(input_image.buffer(kYPlane)); | 503 raw_->planes[VPX_PLANE_Y] = |
| 504 raw_->planes[VPX_PLANE_U] = const_cast<uint8_t*>(input_image.buffer(kUPlane)); | 504 const_cast<uint8_t*>(input_image.video_frame_buffer()->DataY()); |
| 505 raw_->planes[VPX_PLANE_V] = const_cast<uint8_t*>(input_image.buffer(kVPlane)); | 505 raw_->planes[VPX_PLANE_U] = |
| 506 raw_->stride[VPX_PLANE_Y] = input_image.stride(kYPlane); | 506 const_cast<uint8_t*>(input_image.video_frame_buffer()->DataU()); |
| 507 raw_->stride[VPX_PLANE_U] = input_image.stride(kUPlane); | 507 raw_->planes[VPX_PLANE_V] = |
| 508 raw_->stride[VPX_PLANE_V] = input_image.stride(kVPlane); | 508 const_cast<uint8_t*>(input_image.video_frame_buffer()->DataV()); |
| 509 raw_->stride[VPX_PLANE_Y] = input_image.video_frame_buffer()->StrideY(); |
| 510 raw_->stride[VPX_PLANE_U] = input_image.video_frame_buffer()->StrideU(); |
| 511 raw_->stride[VPX_PLANE_V] = input_image.video_frame_buffer()->StrideV(); |
| 509 | 512 |
| 510 vpx_enc_frame_flags_t flags = 0; | 513 vpx_enc_frame_flags_t flags = 0; |
| 511 bool send_keyframe = (frame_type == kVideoFrameKey); | 514 bool send_keyframe = (frame_type == kVideoFrameKey); |
| 512 if (send_keyframe) { | 515 if (send_keyframe) { |
| 513 // Key frame request from caller. | 516 // Key frame request from caller. |
| 514 flags = VPX_EFLAG_FORCE_KF; | 517 flags = VPX_EFLAG_FORCE_KF; |
| 515 } | 518 } |
| 516 | 519 |
| 517 if (is_flexible_mode_) { | 520 if (is_flexible_mode_) { |
| 518 SuperFrameRefSettings settings; | 521 SuperFrameRefSettings settings; |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 frame_buffer_pool_.ClearPool(); | 983 frame_buffer_pool_.ClearPool(); |
| 981 inited_ = false; | 984 inited_ = false; |
| 982 return WEBRTC_VIDEO_CODEC_OK; | 985 return WEBRTC_VIDEO_CODEC_OK; |
| 983 } | 986 } |
| 984 | 987 |
| 985 const char* VP9DecoderImpl::ImplementationName() const { | 988 const char* VP9DecoderImpl::ImplementationName() const { |
| 986 return "libvpx"; | 989 return "libvpx"; |
| 987 } | 990 } |
| 988 | 991 |
| 989 } // namespace webrtc | 992 } // namespace webrtc |
| OLD | NEW |