Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: webrtc/api/java/jni/androidmediaencoder_jni.cc

Issue 1983583002: Revert of Delete webrtc::VideoFrame methods buffer and stride. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/common_video/i420_video_frame_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 bool key_frame, const webrtc::VideoFrame& frame, int input_buffer_index) { 788 bool key_frame, const webrtc::VideoFrame& frame, int input_buffer_index) {
789 RTC_DCHECK(codec_thread_checker_.CalledOnValidThread()); 789 RTC_DCHECK(codec_thread_checker_.CalledOnValidThread());
790 RTC_CHECK(!use_surface_); 790 RTC_CHECK(!use_surface_);
791 791
792 jobject j_input_buffer = input_buffers_[input_buffer_index]; 792 jobject j_input_buffer = input_buffers_[input_buffer_index];
793 uint8_t* yuv_buffer = 793 uint8_t* yuv_buffer =
794 reinterpret_cast<uint8_t*>(jni->GetDirectBufferAddress(j_input_buffer)); 794 reinterpret_cast<uint8_t*>(jni->GetDirectBufferAddress(j_input_buffer));
795 CHECK_EXCEPTION(jni); 795 CHECK_EXCEPTION(jni);
796 RTC_CHECK(yuv_buffer) << "Indirect buffer??"; 796 RTC_CHECK(yuv_buffer) << "Indirect buffer??";
797 RTC_CHECK(!libyuv::ConvertFromI420( 797 RTC_CHECK(!libyuv::ConvertFromI420(
798 frame.video_frame_buffer()->DataY(), 798 frame.buffer(webrtc::kYPlane), frame.stride(webrtc::kYPlane),
799 frame.video_frame_buffer()->StrideY(), 799 frame.buffer(webrtc::kUPlane), frame.stride(webrtc::kUPlane),
800 frame.video_frame_buffer()->DataU(), 800 frame.buffer(webrtc::kVPlane), frame.stride(webrtc::kVPlane),
801 frame.video_frame_buffer()->StrideU(),
802 frame.video_frame_buffer()->DataV(),
803 frame.video_frame_buffer()->StrideV(),
804 yuv_buffer, width_, width_, height_, encoder_fourcc_)) 801 yuv_buffer, width_, width_, height_, encoder_fourcc_))
805 << "ConvertFromI420 failed"; 802 << "ConvertFromI420 failed";
806 803
807 bool encode_status = jni->CallBooleanMethod(*j_media_codec_video_encoder_, 804 bool encode_status = jni->CallBooleanMethod(*j_media_codec_video_encoder_,
808 j_encode_buffer_method_, 805 j_encode_buffer_method_,
809 key_frame, 806 key_frame,
810 input_buffer_index, 807 input_buffer_index,
811 yuv_size_, 808 yuv_size_,
812 current_timestamp_us_); 809 current_timestamp_us_);
813 CHECK_EXCEPTION(jni); 810 CHECK_EXCEPTION(jni);
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 return supported_codecs_; 1269 return supported_codecs_;
1273 } 1270 }
1274 1271
1275 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( 1272 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder(
1276 webrtc::VideoEncoder* encoder) { 1273 webrtc::VideoEncoder* encoder) {
1277 ALOGD << "Destroy video encoder."; 1274 ALOGD << "Destroy video encoder.";
1278 delete encoder; 1275 delete encoder;
1279 } 1276 }
1280 1277
1281 } // namespace webrtc_jni 1278 } // namespace webrtc_jni
OLDNEW
« no previous file with comments | « no previous file | webrtc/common_video/i420_video_frame_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698