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 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 } | 1316 } |
1317 } | 1317 } |
1318 } | 1318 } |
1319 | 1319 |
1320 JOW(void, PeerConnectionFactory_nativeSetVideoHwAccelerationOptions)( | 1320 JOW(void, PeerConnectionFactory_nativeSetVideoHwAccelerationOptions)( |
1321 JNIEnv* jni, jclass, jlong native_factory, jobject local_egl_context, | 1321 JNIEnv* jni, jclass, jlong native_factory, jobject local_egl_context, |
1322 jobject remote_egl_context) { | 1322 jobject remote_egl_context) { |
1323 OwnedFactoryAndThreads* owned_factory = | 1323 OwnedFactoryAndThreads* owned_factory = |
1324 reinterpret_cast<OwnedFactoryAndThreads*>(native_factory); | 1324 reinterpret_cast<OwnedFactoryAndThreads*>(native_factory); |
1325 | 1325 |
1326 jclass j_eglbase14_context_class = | |
1327 FindClass(jni, "org/webrtc/EglBase14$Context"); | |
1328 | |
1329 MediaCodecVideoEncoderFactory* encoder_factory = | 1326 MediaCodecVideoEncoderFactory* encoder_factory = |
1330 static_cast<MediaCodecVideoEncoderFactory*> | 1327 static_cast<MediaCodecVideoEncoderFactory*> |
1331 (owned_factory->encoder_factory()); | 1328 (owned_factory->encoder_factory()); |
1332 if (encoder_factory && | 1329 if (encoder_factory) { |
1333 jni->IsInstanceOf(local_egl_context, j_eglbase14_context_class)) { | |
1334 LOG(LS_INFO) << "Set EGL context for HW encoding."; | 1330 LOG(LS_INFO) << "Set EGL context for HW encoding."; |
1335 encoder_factory->SetEGLContext(jni, local_egl_context); | 1331 encoder_factory->SetEGLContext(jni, local_egl_context); |
1336 } | 1332 } |
1337 | 1333 |
1338 MediaCodecVideoDecoderFactory* decoder_factory = | 1334 MediaCodecVideoDecoderFactory* decoder_factory = |
1339 static_cast<MediaCodecVideoDecoderFactory*> | 1335 static_cast<MediaCodecVideoDecoderFactory*> |
1340 (owned_factory->decoder_factory()); | 1336 (owned_factory->decoder_factory()); |
1341 if (decoder_factory) { | 1337 if (decoder_factory) { |
1342 LOG(LS_INFO) << "Set EGL context for HW decoding."; | 1338 LOG(LS_INFO) << "Set EGL context for HW decoding."; |
1343 decoder_factory->SetEGLContext(jni, remote_egl_context); | 1339 decoder_factory->SetEGLContext(jni, remote_egl_context); |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2145 return JavaStringFromStdString( | 2141 return JavaStringFromStdString( |
2146 jni, | 2142 jni, |
2147 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); | 2143 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); |
2148 } | 2144 } |
2149 | 2145 |
2150 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { | 2146 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { |
2151 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); | 2147 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); |
2152 } | 2148 } |
2153 | 2149 |
2154 } // namespace webrtc_jni | 2150 } // namespace webrtc_jni |
OLD | NEW |