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

Side by Side Diff: talk/app/webrtc/java/jni/peerconnection_jni.cc

Issue 1523843006: MediaCodecVideoEncoder, set timestamp on the encoder surface when drawing a texture. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years 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 * libjingle 2 * libjingle
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after
1351 OwnedFactoryAndThreads* owner = 1351 OwnedFactoryAndThreads* owner =
1352 reinterpret_cast<OwnedFactoryAndThreads*>(native_factory); 1352 reinterpret_cast<OwnedFactoryAndThreads*>(native_factory);
1353 if (owner->network_monitor_factory()) { 1353 if (owner->network_monitor_factory()) {
1354 rtc::NetworkMonitorFactory::ReleaseFactory( 1354 rtc::NetworkMonitorFactory::ReleaseFactory(
1355 owner->network_monitor_factory()); 1355 owner->network_monitor_factory());
1356 owner->clear_network_monitor_factory(); 1356 owner->clear_network_monitor_factory();
1357 } 1357 }
1358 } 1358 }
1359 } 1359 }
1360 1360
1361 JOW(void, PeerConnectionFactory_nativeSetVideoHwAccelerationOptions)( 1361 JOW(void, PeerConnectionFactory_nativeSetVideoHwAccelerationOptions)(
magjed_webrtc 2015/12/17 12:20:02 Will this function be called even when HW encoder
perkj_webrtc 2015/12/17 14:11:12 It is a public methods so we don't know what the A
1362 JNIEnv* jni, jclass, jlong native_factory, jobject local_egl_context, 1362 JNIEnv* jni, jclass, jlong native_factory, jobject local_egl_context,
1363 jobject remote_egl_context) { 1363 jobject remote_egl_context) {
1364 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) 1364 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD)
1365 OwnedFactoryAndThreads* owned_factory = 1365 OwnedFactoryAndThreads* owned_factory =
1366 reinterpret_cast<OwnedFactoryAndThreads*>(native_factory); 1366 reinterpret_cast<OwnedFactoryAndThreads*>(native_factory);
1367 1367
1368 jclass j_eglbase14_context_class =
1369 FindClass(jni, "org/webrtc/EglBase14$Context");
1370
1368 MediaCodecVideoEncoderFactory* encoder_factory = 1371 MediaCodecVideoEncoderFactory* encoder_factory =
1369 static_cast<MediaCodecVideoEncoderFactory*> 1372 static_cast<MediaCodecVideoEncoderFactory*>
1370 (owned_factory->encoder_factory()); 1373 (owned_factory->encoder_factory());
1371 if (encoder_factory) { 1374 if (encoder_factory &&
1375 jni->IsInstanceOf(local_egl_context, j_eglbase14_context_class)) {
1372 LOG(LS_INFO) << "Set EGL context for HW encoding."; 1376 LOG(LS_INFO) << "Set EGL context for HW encoding.";
1373 encoder_factory->SetEGLContext(jni, local_egl_context); 1377 encoder_factory->SetEGLContext(jni, local_egl_context);
1374 } 1378 }
1375 1379
1376 MediaCodecVideoDecoderFactory* decoder_factory = 1380 MediaCodecVideoDecoderFactory* decoder_factory =
1377 static_cast<MediaCodecVideoDecoderFactory*> 1381 static_cast<MediaCodecVideoDecoderFactory*>
1378 (owned_factory->decoder_factory()); 1382 (owned_factory->decoder_factory());
1379 if (decoder_factory) { 1383 if (decoder_factory &&
1384 jni->IsInstanceOf(remote_egl_context, j_eglbase14_context_class)) {
1380 LOG(LS_INFO) << "Set EGL context for HW decoding."; 1385 LOG(LS_INFO) << "Set EGL context for HW decoding.";
1381 decoder_factory->SetEGLContext(jni, remote_egl_context); 1386 decoder_factory->SetEGLContext(jni, remote_egl_context);
1382 } 1387 }
1383 #endif 1388 #endif
1384 } 1389 }
1385 1390
1386 static std::string 1391 static std::string
1387 GetJavaEnumName(JNIEnv* jni, const std::string& className, jobject j_enum) { 1392 GetJavaEnumName(JNIEnv* jni, const std::string& className, jobject j_enum) {
1388 jclass enumClass = FindClass(jni, className.c_str()); 1393 jclass enumClass = FindClass(jni, className.c_str());
1389 jmethodID nameMethod = 1394 jmethodID nameMethod =
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
2156 return JavaStringFromStdString( 2161 return JavaStringFromStdString(
2157 jni, 2162 jni,
2158 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); 2163 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id());
2159 } 2164 }
2160 2165
2161 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { 2166 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) {
2162 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); 2167 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release();
2163 } 2168 }
2164 2169
2165 } // namespace webrtc_jni 2170 } // namespace webrtc_jni
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698