OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 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 |
11 #include <jni.h> | 11 #include <jni.h> |
12 | 12 |
13 #include "libyuv/scale.h" | 13 #include "libyuv/scale.h" |
14 | 14 |
15 #include "webrtc/rtc_base/checks.h" | 15 #include "webrtc/rtc_base/checks.h" |
16 | 16 |
17 namespace webrtc_jni { | 17 namespace webrtc { |
| 18 namespace jni { |
18 | 19 |
19 extern "C" JNIEXPORT void JNICALL | 20 extern "C" JNIEXPORT void JNICALL |
20 Java_org_webrtc_VideoFrame_nativeCropAndScaleI420(JNIEnv* jni, | 21 Java_org_webrtc_VideoFrame_nativeCropAndScaleI420(JNIEnv* jni, |
21 jclass, | 22 jclass, |
22 jobject j_src_y, | 23 jobject j_src_y, |
23 jint src_stride_y, | 24 jint src_stride_y, |
24 jobject j_src_u, | 25 jobject j_src_u, |
25 jint src_stride_u, | 26 jint src_stride_u, |
26 jobject j_src_v, | 27 jobject j_src_v, |
27 jint src_stride_v, | 28 jint src_stride_v, |
(...skipping 24 matching lines...) Expand all Loading... |
52 src_u += crop_x / 2 + crop_y / 2 * src_stride_u; | 53 src_u += crop_x / 2 + crop_y / 2 * src_stride_u; |
53 src_v += crop_x / 2 + crop_y / 2 * src_stride_v; | 54 src_v += crop_x / 2 + crop_y / 2 * src_stride_v; |
54 | 55 |
55 bool ret = libyuv::I420Scale( | 56 bool ret = libyuv::I420Scale( |
56 src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, crop_width, | 57 src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, crop_width, |
57 crop_height, dst_y, dst_stride_y, dst_u, dst_stride_u, dst_v, | 58 crop_height, dst_y, dst_stride_y, dst_u, dst_stride_u, dst_v, |
58 dst_stride_v, scale_width, scale_height, libyuv::kFilterBox); | 59 dst_stride_v, scale_width, scale_height, libyuv::kFilterBox); |
59 RTC_DCHECK_EQ(ret, 0) << "I420Scale failed"; | 60 RTC_DCHECK_EQ(ret, 0) << "I420Scale failed"; |
60 } | 61 } |
61 | 62 |
62 } // namespace webrtc_jni | 63 } // namespace jni |
| 64 } // namespace webrtc |
OLD | NEW |