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

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

Issue 1403713002: MediaCodecVideoEncoder add support to encode from textures (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed tests Created 5 years, 1 month 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 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 1293
1294 JOW(void, PeerConnectionFactory_nativeSetVideoHwAccelerationOptions)( 1294 JOW(void, PeerConnectionFactory_nativeSetVideoHwAccelerationOptions)(
1295 JNIEnv* jni, jclass, jlong native_factory, jobject render_egl_context) { 1295 JNIEnv* jni, jclass, jlong native_factory, jobject render_egl_context) {
1296 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) 1296 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD)
1297 OwnedFactoryAndThreads* owned_factory = 1297 OwnedFactoryAndThreads* owned_factory =
1298 reinterpret_cast<OwnedFactoryAndThreads*>(native_factory); 1298 reinterpret_cast<OwnedFactoryAndThreads*>(native_factory);
1299 MediaCodecVideoDecoderFactory* decoder_factory = 1299 MediaCodecVideoDecoderFactory* decoder_factory =
1300 static_cast<MediaCodecVideoDecoderFactory*> 1300 static_cast<MediaCodecVideoDecoderFactory*>
1301 (owned_factory->decoder_factory()); 1301 (owned_factory->decoder_factory());
1302 if (decoder_factory) { 1302 if (decoder_factory) {
1303 LOG(LS_INFO) << "Set EGL context for HW acceleration."; 1303 LOG(LS_INFO) << "Set EGL context for HW decoding.";
1304 decoder_factory->SetEGLContext(jni, render_egl_context); 1304 decoder_factory->SetEGLContext(jni, render_egl_context);
1305 } 1305 }
1306 #endif 1306 #endif
1307 } 1307 }
1308 1308
1309 JOW(void, PeerConnectionFactory_nativeSetVideoHwAccelerationOptions2)(
magjed_webrtc 2015/11/18 13:12:52 Why do we need two versions of nativeSetVideoHwAcc
perkj_webrtc 2015/11/18 14:51:21 This is on request by glaznew. We can then have se
magjed_webrtc 2015/11/18 15:38:12 The purpose with separate contexts is still unclea
1310 JNIEnv* jni, jclass, jlong native_factory, jobject local_egl_context,
1311 jobject remote_egl_context) {
1312 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD)
1313 OwnedFactoryAndThreads* owned_factory =
1314 reinterpret_cast<OwnedFactoryAndThreads*>(native_factory);
1315
1316 MediaCodecVideoEncoderFactory* encoder_factory =
1317 static_cast<MediaCodecVideoEncoderFactory*>
1318 (owned_factory->encoder_factory());
1319 if (encoder_factory) {
1320 LOG(LS_INFO) << "Set EGL context for HW encoding.";
1321 encoder_factory->SetEGLContext(jni, local_egl_context);
1322 }
1323
1324 MediaCodecVideoDecoderFactory* decoder_factory =
1325 static_cast<MediaCodecVideoDecoderFactory*>
1326 (owned_factory->decoder_factory());
1327 if (decoder_factory) {
1328 LOG(LS_INFO) << "Set EGL context for HW decoding.";
1329 decoder_factory->SetEGLContext(jni, remote_egl_context);
1330 }
1331 #endif
1332 }
1309 1333
1310 static std::string 1334 static std::string
1311 GetJavaEnumName(JNIEnv* jni, const std::string& className, jobject j_enum) { 1335 GetJavaEnumName(JNIEnv* jni, const std::string& className, jobject j_enum) {
1312 jclass enumClass = FindClass(jni, className.c_str()); 1336 jclass enumClass = FindClass(jni, className.c_str());
1313 jmethodID nameMethod = 1337 jmethodID nameMethod =
1314 GetMethodID(jni, enumClass, "name", "()Ljava/lang/String;"); 1338 GetMethodID(jni, enumClass, "name", "()Ljava/lang/String;");
1315 jstring name = 1339 jstring name =
1316 reinterpret_cast<jstring>(jni->CallObjectMethod(j_enum, nameMethod)); 1340 reinterpret_cast<jstring>(jni->CallObjectMethod(j_enum, nameMethod));
1317 CHECK_EXCEPTION(jni) << "error during CallObjectMethod for " 1341 CHECK_EXCEPTION(jni) << "error during CallObjectMethod for "
1318 << className << ".name"; 1342 << className << ".name";
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
2046 return JavaStringFromStdString( 2070 return JavaStringFromStdString(
2047 jni, 2071 jni,
2048 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); 2072 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id());
2049 } 2073 }
2050 2074
2051 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { 2075 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) {
2052 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); 2076 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release();
2053 } 2077 }
2054 2078
2055 } // namespace webrtc_jni 2079 } // namespace webrtc_jni
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698