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

Unified Diff: webrtc/api/java/src/org/webrtc/PeerConnectionFactory.java

Issue 1707933003: Change PeerConnectionFactory.setVideoHwAccelerationOptions to be able to replace Egl context. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/java/jni/androidmediaencoder_jni.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/java/src/org/webrtc/PeerConnectionFactory.java
diff --git a/webrtc/api/java/src/org/webrtc/PeerConnectionFactory.java b/webrtc/api/java/src/org/webrtc/PeerConnectionFactory.java
index 51e593e655f9b97a0833ed2191219a9783a942d3..17fc7ab8e86a90786ba919487cc1d0e4df1cbfa8 100644
--- a/webrtc/api/java/src/org/webrtc/PeerConnectionFactory.java
+++ b/webrtc/api/java/src/org/webrtc/PeerConnectionFactory.java
@@ -171,8 +171,13 @@ public class PeerConnectionFactory {
*/
public void setVideoHwAccelerationOptions(EglBase.Context localEglContext,
EglBase.Context remoteEglContext) {
- if (localEglbase != null || remoteEglbase != null) {
- throw new IllegalStateException("Egl context already set.");
+ if (localEglbase != null) {
+ Logging.w(TAG, "Egl context already set.");
+ localEglbase.release();
+ }
+ if (remoteEglbase != null) {
+ Logging.w(TAG, "Egl context already set.");
+ remoteEglbase.release();
}
localEglbase = EglBase.create(localEglContext);
remoteEglbase = EglBase.create(remoteEglContext);
« no previous file with comments | « webrtc/api/java/jni/androidmediaencoder_jni.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698