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 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 bool key_frame, const webrtc::VideoFrame& frame, int input_buffer_index) { | 776 bool key_frame, const webrtc::VideoFrame& frame, int input_buffer_index) { |
777 RTC_DCHECK(codec_thread_checker_.CalledOnValidThread()); | 777 RTC_DCHECK(codec_thread_checker_.CalledOnValidThread()); |
778 RTC_CHECK(!use_surface_); | 778 RTC_CHECK(!use_surface_); |
779 | 779 |
780 jobject j_input_buffer = input_buffers_[input_buffer_index]; | 780 jobject j_input_buffer = input_buffers_[input_buffer_index]; |
781 uint8_t* yuv_buffer = | 781 uint8_t* yuv_buffer = |
782 reinterpret_cast<uint8_t*>(jni->GetDirectBufferAddress(j_input_buffer)); | 782 reinterpret_cast<uint8_t*>(jni->GetDirectBufferAddress(j_input_buffer)); |
783 CHECK_EXCEPTION(jni); | 783 CHECK_EXCEPTION(jni); |
784 RTC_CHECK(yuv_buffer) << "Indirect buffer??"; | 784 RTC_CHECK(yuv_buffer) << "Indirect buffer??"; |
785 RTC_CHECK(!libyuv::ConvertFromI420( | 785 RTC_CHECK(!libyuv::ConvertFromI420( |
786 frame.buffer(webrtc::kYPlane), frame.stride(webrtc::kYPlane), | 786 frame.video_frame_buffer()->DataY(), |
787 frame.buffer(webrtc::kUPlane), frame.stride(webrtc::kUPlane), | 787 frame.video_frame_buffer()->StrideY(), |
788 frame.buffer(webrtc::kVPlane), frame.stride(webrtc::kVPlane), | 788 frame.video_frame_buffer()->DataU(), |
| 789 frame.video_frame_buffer()->StrideU(), |
| 790 frame.video_frame_buffer()->DataV(), |
| 791 frame.video_frame_buffer()->StrideV(), |
789 yuv_buffer, width_, width_, height_, encoder_fourcc_)) | 792 yuv_buffer, width_, width_, height_, encoder_fourcc_)) |
790 << "ConvertFromI420 failed"; | 793 << "ConvertFromI420 failed"; |
791 | 794 |
792 bool encode_status = jni->CallBooleanMethod(*j_media_codec_video_encoder_, | 795 bool encode_status = jni->CallBooleanMethod(*j_media_codec_video_encoder_, |
793 j_encode_buffer_method_, | 796 j_encode_buffer_method_, |
794 key_frame, | 797 key_frame, |
795 input_buffer_index, | 798 input_buffer_index, |
796 yuv_size_, | 799 yuv_size_, |
797 current_timestamp_us_); | 800 current_timestamp_us_); |
798 CHECK_EXCEPTION(jni); | 801 CHECK_EXCEPTION(jni); |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 return supported_codecs_; | 1253 return supported_codecs_; |
1251 } | 1254 } |
1252 | 1255 |
1253 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 1256 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
1254 webrtc::VideoEncoder* encoder) { | 1257 webrtc::VideoEncoder* encoder) { |
1255 ALOGD << "Destroy video encoder."; | 1258 ALOGD << "Destroy video encoder."; |
1256 delete encoder; | 1259 delete encoder; |
1257 } | 1260 } |
1258 | 1261 |
1259 } // namespace webrtc_jni | 1262 } // namespace webrtc_jni |
OLD | NEW |