| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 webrtc::VideoFrameBuffer::Type::kNative) { | 52 webrtc::VideoFrameBuffer::Type::kNative) { |
| 53 AndroidVideoFrameBuffer* android_buffer = | 53 AndroidVideoFrameBuffer* android_buffer = |
| 54 static_cast<AndroidVideoFrameBuffer*>( | 54 static_cast<AndroidVideoFrameBuffer*>( |
| 55 video_frame.video_frame_buffer().get()); | 55 video_frame.video_frame_buffer().get()); |
| 56 switch (android_buffer->android_type()) { | 56 switch (android_buffer->android_type()) { |
| 57 case AndroidVideoFrameBuffer::AndroidType::kTextureBuffer: | 57 case AndroidVideoFrameBuffer::AndroidType::kTextureBuffer: |
| 58 j_frame = ToJavaTextureFrame(&video_frame); | 58 j_frame = ToJavaTextureFrame(&video_frame); |
| 59 break; | 59 break; |
| 60 case AndroidVideoFrameBuffer::AndroidType::kJavaBuffer: | 60 case AndroidVideoFrameBuffer::AndroidType::kJavaBuffer: |
| 61 j_frame = static_cast<AndroidVideoBuffer*>(android_buffer) | 61 j_frame = static_cast<AndroidVideoBuffer*>(android_buffer) |
| 62 ->ToJavaI420Frame(jni(), video_frame.width(), | 62 ->ToJavaI420Frame(jni(), video_frame.rotation()); |
| 63 video_frame.height(), | |
| 64 video_frame.rotation()); | |
| 65 break; | 63 break; |
| 66 default: | 64 default: |
| 67 RTC_NOTREACHED(); | 65 RTC_NOTREACHED(); |
| 68 } | 66 } |
| 69 } else { | 67 } else { |
| 70 j_frame = ToJavaI420Frame(&video_frame); | 68 j_frame = ToJavaI420Frame(&video_frame); |
| 71 } | 69 } |
| 72 // |j_callbacks_| is responsible for releasing |j_frame| with | 70 // |j_callbacks_| is responsible for releasing |j_frame| with |
| 73 // VideoRenderer.renderFrameDone(). | 71 // VideoRenderer.renderFrameDone(). |
| 74 jni()->CallVoidMethod(*j_callbacks_, j_render_frame_id_, j_frame); | 72 jni()->CallVoidMethod(*j_callbacks_, j_render_frame_id_, j_frame); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 } else { | 177 } else { |
| 180 for (int i = 0; i < height; i++) { | 178 for (int i = 0; i < height; i++) { |
| 181 memcpy(dst, src, width); | 179 memcpy(dst, src, width); |
| 182 src += src_stride; | 180 src += src_stride; |
| 183 dst += dst_stride; | 181 dst += dst_stride; |
| 184 } | 182 } |
| 185 } | 183 } |
| 186 } | 184 } |
| 187 | 185 |
| 188 } // namespace webrtc_jni | 186 } // namespace webrtc_jni |
| OLD | NEW |