OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2013 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 jobject u_buffer = jni()->NewDirectByteBuffer( | 776 jobject u_buffer = jni()->NewDirectByteBuffer( |
777 const_cast<uint8_t*>(frame->GetUPlane()), chroma_size); | 777 const_cast<uint8_t*>(frame->GetUPlane()), chroma_size); |
778 jobject v_buffer = jni()->NewDirectByteBuffer( | 778 jobject v_buffer = jni()->NewDirectByteBuffer( |
779 const_cast<uint8_t*>(frame->GetVPlane()), chroma_size); | 779 const_cast<uint8_t*>(frame->GetVPlane()), chroma_size); |
780 jni()->SetObjectArrayElement(planes, 0, y_buffer); | 780 jni()->SetObjectArrayElement(planes, 0, y_buffer); |
781 jni()->SetObjectArrayElement(planes, 1, u_buffer); | 781 jni()->SetObjectArrayElement(planes, 1, u_buffer); |
782 jni()->SetObjectArrayElement(planes, 2, v_buffer); | 782 jni()->SetObjectArrayElement(planes, 2, v_buffer); |
783 return jni()->NewObject( | 783 return jni()->NewObject( |
784 *j_frame_class_, j_i420_frame_ctor_id_, | 784 *j_frame_class_, j_i420_frame_ctor_id_, |
785 frame->width(), frame->height(), | 785 frame->width(), frame->height(), |
786 static_cast<int>(frame->GetVideoRotation()), | 786 static_cast<int>(frame->rotation()), |
787 strides, planes, javaShallowCopy(frame)); | 787 strides, planes, javaShallowCopy(frame)); |
788 } | 788 } |
789 | 789 |
790 // Return a VideoRenderer.I420Frame referring texture object in |frame|. | 790 // Return a VideoRenderer.I420Frame referring texture object in |frame|. |
791 jobject CricketToJavaTextureFrame(const cricket::VideoFrame* frame) { | 791 jobject CricketToJavaTextureFrame(const cricket::VideoFrame* frame) { |
792 NativeHandleImpl* handle = | 792 NativeHandleImpl* handle = |
793 reinterpret_cast<NativeHandleImpl*>(frame->GetNativeHandle()); | 793 reinterpret_cast<NativeHandleImpl*>(frame->GetNativeHandle()); |
794 jfloatArray sampling_matrix = jni()->NewFloatArray(16); | 794 jfloatArray sampling_matrix = jni()->NewFloatArray(16); |
795 jni()->SetFloatArrayRegion(sampling_matrix, 0, 16, handle->sampling_matrix); | 795 jni()->SetFloatArrayRegion(sampling_matrix, 0, 16, handle->sampling_matrix); |
796 return jni()->NewObject( | 796 return jni()->NewObject( |
797 *j_frame_class_, j_texture_frame_ctor_id_, | 797 *j_frame_class_, j_texture_frame_ctor_id_, |
798 frame->width(), frame->height(), | 798 frame->width(), frame->height(), |
799 static_cast<int>(frame->GetVideoRotation()), | 799 static_cast<int>(frame->rotation()), |
800 handle->oes_texture_id, sampling_matrix, javaShallowCopy(frame)); | 800 handle->oes_texture_id, sampling_matrix, javaShallowCopy(frame)); |
801 } | 801 } |
802 | 802 |
803 JNIEnv* jni() { | 803 JNIEnv* jni() { |
804 return AttachCurrentThreadIfNeeded(); | 804 return AttachCurrentThreadIfNeeded(); |
805 } | 805 } |
806 | 806 |
807 ScopedGlobalRef<jobject> j_callbacks_; | 807 ScopedGlobalRef<jobject> j_callbacks_; |
808 jmethodID j_render_frame_id_; | 808 jmethodID j_render_frame_id_; |
809 ScopedGlobalRef<jclass> j_frame_class_; | 809 ScopedGlobalRef<jclass> j_frame_class_; |
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2148 return JavaStringFromStdString( | 2148 return JavaStringFromStdString( |
2149 jni, | 2149 jni, |
2150 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); | 2150 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); |
2151 } | 2151 } |
2152 | 2152 |
2153 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { | 2153 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { |
2154 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); | 2154 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); |
2155 } | 2155 } |
2156 | 2156 |
2157 } // namespace webrtc_jni | 2157 } // namespace webrtc_jni |
OLD | NEW |