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

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 factory. Deprecated setVideoHwAccelerationOptions 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 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 reinterpret_cast<OwnedFactoryAndThreads*>(native_factory); 1285 reinterpret_cast<OwnedFactoryAndThreads*>(native_factory);
1286 if (owner->network_monitor_factory()) { 1286 if (owner->network_monitor_factory()) {
1287 rtc::NetworkMonitorFactory::ReleaseFactory( 1287 rtc::NetworkMonitorFactory::ReleaseFactory(
1288 owner->network_monitor_factory()); 1288 owner->network_monitor_factory());
1289 owner->clear_network_monitor_factory(); 1289 owner->clear_network_monitor_factory();
1290 } 1290 }
1291 } 1291 }
1292 } 1292 }
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 local_egl_context,
1296 jobject remote_egl_context) {
1296 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) 1297 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD)
1297 OwnedFactoryAndThreads* owned_factory = 1298 OwnedFactoryAndThreads* owned_factory =
1298 reinterpret_cast<OwnedFactoryAndThreads*>(native_factory); 1299 reinterpret_cast<OwnedFactoryAndThreads*>(native_factory);
1300
1301 MediaCodecVideoEncoderFactory* encoder_factory =
1302 static_cast<MediaCodecVideoEncoderFactory*>
1303 (owned_factory->encoder_factory());
1304 if (encoder_factory) {
1305 LOG(LS_INFO) << "Set EGL context for HW encoding.";
1306 encoder_factory->SetEGLContext(jni, local_egl_context);
1307 }
1308
1299 MediaCodecVideoDecoderFactory* decoder_factory = 1309 MediaCodecVideoDecoderFactory* decoder_factory =
1300 static_cast<MediaCodecVideoDecoderFactory*> 1310 static_cast<MediaCodecVideoDecoderFactory*>
1301 (owned_factory->decoder_factory()); 1311 (owned_factory->decoder_factory());
1302 if (decoder_factory) { 1312 if (decoder_factory) {
1303 LOG(LS_INFO) << "Set EGL context for HW acceleration."; 1313 LOG(LS_INFO) << "Set EGL context for HW decoding.";
1304 decoder_factory->SetEGLContext(jni, render_egl_context); 1314 decoder_factory->SetEGLContext(jni, remote_egl_context);
1305 } 1315 }
1306 #endif 1316 #endif
1307 } 1317 }
1308 1318
1309
1310 static std::string 1319 static std::string
1311 GetJavaEnumName(JNIEnv* jni, const std::string& className, jobject j_enum) { 1320 GetJavaEnumName(JNIEnv* jni, const std::string& className, jobject j_enum) {
1312 jclass enumClass = FindClass(jni, className.c_str()); 1321 jclass enumClass = FindClass(jni, className.c_str());
1313 jmethodID nameMethod = 1322 jmethodID nameMethod =
1314 GetMethodID(jni, enumClass, "name", "()Ljava/lang/String;"); 1323 GetMethodID(jni, enumClass, "name", "()Ljava/lang/String;");
1315 jstring name = 1324 jstring name =
1316 reinterpret_cast<jstring>(jni->CallObjectMethod(j_enum, nameMethod)); 1325 reinterpret_cast<jstring>(jni->CallObjectMethod(j_enum, nameMethod));
1317 CHECK_EXCEPTION(jni) << "error during CallObjectMethod for " 1326 CHECK_EXCEPTION(jni) << "error during CallObjectMethod for "
1318 << className << ".name"; 1327 << className << ".name";
1319 return JavaToStdString(jni, name); 1328 return JavaToStdString(jni, name);
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
2046 return JavaStringFromStdString( 2055 return JavaStringFromStdString(
2047 jni, 2056 jni,
2048 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); 2057 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id());
2049 } 2058 }
2050 2059
2051 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { 2060 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) {
2052 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); 2061 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release();
2053 } 2062 }
2054 2063
2055 } // namespace webrtc_jni 2064 } // namespace webrtc_jni
OLDNEW
« no previous file with comments | « talk/app/webrtc/java/jni/androidmediaencoder_jni.cc ('k') | talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoEncoder.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698