OLD | NEW |
---|---|
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 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1258 | 1258 |
1259 JOW(void, PeerConnectionFactory_nativeSetVideoHwAccelerationOptions)( | 1259 JOW(void, PeerConnectionFactory_nativeSetVideoHwAccelerationOptions)( |
1260 JNIEnv* jni, jclass, jlong native_factory, jobject render_egl_context) { | 1260 JNIEnv* jni, jclass, jlong native_factory, jobject render_egl_context) { |
1261 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) | 1261 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) |
1262 OwnedFactoryAndThreads* owned_factory = | 1262 OwnedFactoryAndThreads* owned_factory = |
1263 reinterpret_cast<OwnedFactoryAndThreads*>(native_factory); | 1263 reinterpret_cast<OwnedFactoryAndThreads*>(native_factory); |
1264 MediaCodecVideoDecoderFactory* decoder_factory = | 1264 MediaCodecVideoDecoderFactory* decoder_factory = |
1265 static_cast<MediaCodecVideoDecoderFactory*> | 1265 static_cast<MediaCodecVideoDecoderFactory*> |
1266 (owned_factory->decoder_factory()); | 1266 (owned_factory->decoder_factory()); |
1267 if (decoder_factory) { | 1267 if (decoder_factory) { |
1268 LOG(LS_INFO) << "Set EGL context for HW acceleration."; | 1268 LOG(LS_INFO) << "Set EGL context for HW decoding."; |
1269 decoder_factory->SetEGLContext(jni, render_egl_context); | 1269 decoder_factory->SetEGLContext(jni, render_egl_context); |
1270 } | 1270 } |
1271 | |
1272 MediaCodecVideoEncoderFactory* encoder_factory = | |
1273 static_cast<MediaCodecVideoEncoderFactory*> | |
1274 (owned_factory->encoder_factory()); | |
1275 if (encoder_factory) { | |
AlexG
2015/10/14 23:48:27
May be add a separate egl_context parameters to co
perkj_webrtc
2015/11/16 13:08:51
Done. Added a new method PeerConnectionFactory_nat
| |
1276 LOG(LS_INFO) << "Set EGL context for HW encoding."; | |
1277 encoder_factory->SetEGLContext(jni, render_egl_context); | |
1278 } | |
1271 #endif | 1279 #endif |
1272 } | 1280 } |
1273 | 1281 |
1274 | 1282 |
1275 static std::string | 1283 static std::string |
1276 GetJavaEnumName(JNIEnv* jni, const std::string& className, jobject j_enum) { | 1284 GetJavaEnumName(JNIEnv* jni, const std::string& className, jobject j_enum) { |
1277 jclass enumClass = FindClass(jni, className.c_str()); | 1285 jclass enumClass = FindClass(jni, className.c_str()); |
1278 jmethodID nameMethod = | 1286 jmethodID nameMethod = |
1279 GetMethodID(jni, enumClass, "name", "()Ljava/lang/String;"); | 1287 GetMethodID(jni, enumClass, "name", "()Ljava/lang/String;"); |
1280 jstring name = | 1288 jstring name = |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2011 return JavaStringFromStdString( | 2019 return JavaStringFromStdString( |
2012 jni, | 2020 jni, |
2013 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); | 2021 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); |
2014 } | 2022 } |
2015 | 2023 |
2016 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { | 2024 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { |
2017 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); | 2025 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); |
2018 } | 2026 } |
2019 | 2027 |
2020 } // namespace webrtc_jni | 2028 } // namespace webrtc_jni |
OLD | NEW |