| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 bool key_frame, const webrtc::VideoFrame& frame, int input_buffer_index) { | 786 bool key_frame, const webrtc::VideoFrame& frame, int input_buffer_index) { |
| 787 RTC_DCHECK(codec_thread_checker_.CalledOnValidThread()); | 787 RTC_DCHECK(codec_thread_checker_.CalledOnValidThread()); |
| 788 RTC_CHECK(!use_surface_); | 788 RTC_CHECK(!use_surface_); |
| 789 | 789 |
| 790 jobject j_input_buffer = input_buffers_[input_buffer_index]; | 790 jobject j_input_buffer = input_buffers_[input_buffer_index]; |
| 791 uint8_t* yuv_buffer = | 791 uint8_t* yuv_buffer = |
| 792 reinterpret_cast<uint8_t*>(jni->GetDirectBufferAddress(j_input_buffer)); | 792 reinterpret_cast<uint8_t*>(jni->GetDirectBufferAddress(j_input_buffer)); |
| 793 CHECK_EXCEPTION(jni); | 793 CHECK_EXCEPTION(jni); |
| 794 RTC_CHECK(yuv_buffer) << "Indirect buffer??"; | 794 RTC_CHECK(yuv_buffer) << "Indirect buffer??"; |
| 795 RTC_CHECK(!libyuv::ConvertFromI420( | 795 RTC_CHECK(!libyuv::ConvertFromI420( |
| 796 frame.video_frame_buffer()->DataY(), | 796 frame.buffer(webrtc::kYPlane), frame.stride(webrtc::kYPlane), |
| 797 frame.video_frame_buffer()->StrideY(), | 797 frame.buffer(webrtc::kUPlane), frame.stride(webrtc::kUPlane), |
| 798 frame.video_frame_buffer()->DataU(), | 798 frame.buffer(webrtc::kVPlane), frame.stride(webrtc::kVPlane), |
| 799 frame.video_frame_buffer()->StrideU(), | |
| 800 frame.video_frame_buffer()->DataV(), | |
| 801 frame.video_frame_buffer()->StrideV(), | |
| 802 yuv_buffer, width_, width_, height_, encoder_fourcc_)) | 799 yuv_buffer, width_, width_, height_, encoder_fourcc_)) |
| 803 << "ConvertFromI420 failed"; | 800 << "ConvertFromI420 failed"; |
| 804 | 801 |
| 805 bool encode_status = jni->CallBooleanMethod(*j_media_codec_video_encoder_, | 802 bool encode_status = jni->CallBooleanMethod(*j_media_codec_video_encoder_, |
| 806 j_encode_buffer_method_, | 803 j_encode_buffer_method_, |
| 807 key_frame, | 804 key_frame, |
| 808 input_buffer_index, | 805 input_buffer_index, |
| 809 yuv_size_, | 806 yuv_size_, |
| 810 current_timestamp_us_); | 807 current_timestamp_us_); |
| 811 CHECK_EXCEPTION(jni); | 808 CHECK_EXCEPTION(jni); |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1270 return supported_codecs_; | 1267 return supported_codecs_; |
| 1271 } | 1268 } |
| 1272 | 1269 |
| 1273 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 1270 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
| 1274 webrtc::VideoEncoder* encoder) { | 1271 webrtc::VideoEncoder* encoder) { |
| 1275 ALOGD << "Destroy video encoder."; | 1272 ALOGD << "Destroy video encoder."; |
| 1276 delete encoder; | 1273 delete encoder; |
| 1277 } | 1274 } |
| 1278 | 1275 |
| 1279 } // namespace webrtc_jni | 1276 } // namespace webrtc_jni |
| OLD | NEW |