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

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

Issue 1828203002: Android HW encoder: Add support for textures when using EGL 1.0 (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase, add full url to bug, and log a warning when using EGL10 in encoder. Created 4 years, 8 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
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webrtc/api/java/jni/androidmediaencoder_jni.cc ('k') | webrtc/api/java/src/org/webrtc/MediaCodecVideoEncoder.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698