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

Unified Diff: webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java

Issue 1304063011: Move shared EGL context initialization to a separate function. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address comment + fix Linux build. Created 5 years, 4 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
Index: webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
diff --git a/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java b/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
index 6e54ae22626ff9a2d9ca642b3d68f6fb5a5e042d..5202e8bd9bd11fefd9532d71fd13730403365a1d 100644
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
@@ -216,7 +216,6 @@ public class PeerConnectionClient {
public void createPeerConnectionFactory(
final Context context,
- final EGLContext renderEGLContext,
final PeerConnectionParameters peerConnectionParameters,
final PeerConnectionEvents events) {
this.peerConnectionParameters = peerConnectionParameters;
@@ -241,12 +240,13 @@ public class PeerConnectionClient {
executor.execute(new Runnable() {
@Override
public void run() {
- createPeerConnectionFactoryInternal(context, renderEGLContext);
+ createPeerConnectionFactoryInternal(context);
}
});
}
public void createPeerConnection(
+ final EGLContext renderEGLContext,
final VideoRenderer.Callbacks localRender,
final VideoRenderer.Callbacks remoteRender,
final SignalingParameters signalingParameters) {
@@ -261,7 +261,7 @@ public class PeerConnectionClient {
@Override
public void run() {
createMediaConstraintsInternal();
- createPeerConnectionInternal();
+ createPeerConnectionInternal(renderEGLContext);
}
});
}
@@ -279,11 +279,9 @@ public class PeerConnectionClient {
return videoCallEnabled;
}
- private void createPeerConnectionFactoryInternal(
- Context context, EGLContext renderEGLContext) {
- Log.d(TAG, "Create peer connection factory with EGLContext "
- + renderEGLContext + ". Use video: "
- + peerConnectionParameters.videoCallEnabled);
+ private void createPeerConnectionFactoryInternal(Context context) {
+ Log.d(TAG, "Create peer connection factory. Use video: " +
+ peerConnectionParameters.videoCallEnabled);
isError = false;
// Check if VP9 is used by default.
if (videoCallEnabled && peerConnectionParameters.videoCodec != null
@@ -304,9 +302,8 @@ public class PeerConnectionClient {
&& peerConnectionParameters.audioCodec.equals(AUDIO_CODEC_ISAC)) {
preferIsac = true;
}
- if (!PeerConnectionFactory.initializeAndroidGlobals(
- context, true, true,
- peerConnectionParameters.videoCodecHwAcceleration, renderEGLContext)) {
+ if (!PeerConnectionFactory.initializeAndroidGlobals(context, true, true,
+ peerConnectionParameters.videoCodecHwAcceleration)) {
events.onPeerConnectionError("Failed to initializeAndroidGlobals");
}
factory = new PeerConnectionFactory();
@@ -402,18 +399,24 @@ public class PeerConnectionClient {
}
}
- private void createPeerConnectionInternal() {
+ private void createPeerConnectionInternal(EGLContext renderEGLContext) {
if (factory == null || isError) {
Log.e(TAG, "Peerconnection factory is not created");
return;
}
- Log.d(TAG, "Create peer connection");
+ Log.d(TAG, "Create peer connection.");
+
Log.d(TAG, "PCConstraints: " + pcConstraints.toString());
if (videoConstraints != null) {
Log.d(TAG, "VideoConstraints: " + videoConstraints.toString());
}
queuedRemoteCandidates = new LinkedList<IceCandidate>();
+ if (videoCallEnabled) {
+ Log.d(TAG, "EGLContext: " + renderEGLContext);
+ factory.setVideoHwAccelerationOptions(renderEGLContext);
+ }
+
PeerConnection.RTCConfiguration rtcConfig =
new PeerConnection.RTCConfiguration(signalingParameters.iceServers);
// TCP candidates are only useful when connecting to a server that supports

Powered by Google App Engine
This is Rietveld 408576698