Skip to content

Commit 298eed4

Browse files
committed
Fixes #105: Remove the video view requirement from SDK
1 parent d96e16e commit 298eed4

File tree

5 files changed

+25
-12
lines changed

5 files changed

+25
-12
lines changed

Examples/restcomm-messenger/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ android {
99
minSdkVersion 17
1010
targetSdkVersion 22
1111
versionCode 1
12-
versionName "1.2.1"
12+
versionName "1.2.2"
1313
}
1414
buildTypes {
1515
release {

Examples/restcomm-messenger/app/src/main/java/com/telestax/restcomm_messenger/CallActivity.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public class CallActivity extends Activity implements RCConnectionListener, View
3737
private static final String TAG = "CallActivity";
3838
private HashMap<String, String> connectParams = new HashMap<String, String>();
3939
private RCDevice device;
40-
private RelativeLayout parentLayout;
40+
// #WEBRTC-VIDEO TODO: uncomment when video is introduced
41+
//private RelativeLayout parentLayout;
4142
MediaPlayer ringingPlayer;
4243
MediaPlayer callingPlayer;
4344
AudioManager audioManager;
@@ -78,7 +79,8 @@ protected void onCreate(Bundle savedInstanceState) {
7879
btnCancel.setOnClickListener(this);
7980
cbMuted = (CheckBox)findViewById(R.id.checkbox_muted);
8081
cbMuted.setOnCheckedChangeListener(this);
81-
parentLayout = (RelativeLayout) findViewById(R.id.layout_video_call);
82+
// #WEBRTC-VIDEO TODO: uncomment when video is introduced
83+
//parentLayout = (RelativeLayout) findViewById(R.id.layout_video_call);
8284

8385
audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
8486
// volume control should be by default 'music' which will control the ringing sounds and 'voice call' when within a call
@@ -280,6 +282,8 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
280282
}
281283
}
282284

285+
// #WEBRTC-VIDEO TODO: uncomment when video is introduced
286+
/*
283287
public void onReceiveLocalVideo(RCConnection connection, GLSurfaceView videoView) {
284288
if (videoView != null) {
285289
//show media on screen
@@ -290,6 +294,7 @@ public void onReceiveLocalVideo(RCConnection connection, GLSurfaceView videoView
290294
parentLayout.addView(videoView, 0);
291295
}
292296
}
297+
*/
293298

294299
// Callbacks for auio focus change events
295300
public void onAudioFocusChange(int focusChange)

restcomm.android.client.sdk/src/main/java/org/mobicents/restcomm/android/client/sdk/PeerConnectionClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ private void createPeerConnectionFactoryInternal(
331331
preferIsac = true;
332332
}
333333
if (!PeerConnectionFactory.initializeAndroidGlobals(
334-
context, true, true,
334+
context, true, /*peerConnectionParameters.videoCallEnabled */ true,
335335
peerConnectionParameters.videoCodecHwAcceleration, renderEGLContext)) {
336336
events.onPeerConnectionError("Failed to initializeAndroidGlobals");
337337
}

restcomm.android.client.sdk/src/main/java/org/mobicents/restcomm/android/client/sdk/RCConnection.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,8 @@ void initializeWebrtc()
484484
signalingParameters = null;
485485
scalingType = VideoRendererGui.ScalingType.SCALE_ASPECT_FILL;
486486

487-
// Uncomment when video is enabled
488-
/**/
487+
// #WEBRTC-VIDEO TODO: Uncomment when video is enabled
488+
/*
489489
videoView = new GLSurfaceView(context);
490490
listener.onReceiveLocalVideo(this, videoView);
491491
@@ -503,8 +503,7 @@ public void run() {
503503
localRender = VideoRendererGui.create(
504504
LOCAL_X_CONNECTING, LOCAL_Y_CONNECTING,
505505
LOCAL_WIDTH_CONNECTING, LOCAL_HEIGHT_CONNECTING, scalingType, true);
506-
/**/
507-
//createPeerConnectionFactory();
506+
*/
508507

509508
// Check for mandatory permissions.
510509
for (String permission : MANDATORY_PERMISSIONS) {
@@ -595,6 +594,9 @@ public void run() {
595594
"OPUS",
596595
false,
597596
true);
597+
598+
// #WEBRTC-VIDEO TODO: remove this
599+
createPeerConnectionFactory();
598600
}
599601

600602
private void startCall(SignalingParameters signalingParameters)
@@ -681,7 +683,11 @@ public void run() {
681683
}
682684
if (signalingParameters != null) {
683685
Log.w(TAG, "EGL context is ready after room connection.");
684-
onConnectedToRoomInternal(signalingParameters);
686+
// #WEBRTC-VIDEO TODO: when I disabled the video view stuff, I also had to comment this out cause it turns out
687+
// that in that case this part of the code was executed (as if signalingParameters was null and now it isn't),
688+
// which resulted in onConnectedToRoomInternal being called twice for the same call! When I reinstate
689+
// video this should probably be uncommented:
690+
//onConnectedToRoomInternal(signalingParameters);
685691
}
686692
}
687693
};
@@ -832,7 +838,7 @@ public void run() {
832838
@Override
833839
public void onPeerConnectionError(final String description) {
834840
//reportError(description);
835-
Log.e(TAG, "PeerConnection error");
841+
Log.e(TAG, "PeerConnection error: " + description);
836842
disconnect();
837843
}
838844

restcomm.android.client.sdk/src/main/java/org/mobicents/restcomm/android/client/sdk/RCConnectionListener.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,15 @@ public interface RCConnectionListener {
7171
* @param connection Connection
7272
* @param videoView View hosting the local video
7373
*/
74-
public void onReceiveLocalVideo(RCConnection connection, GLSurfaceView videoView);
74+
// #WEBRTC-VIDEO TODO uncomment
75+
//public void onReceiveLocalVideo(RCConnection connection, GLSurfaceView videoView);
7576

7677
/**
7778
* Connection just disconnected with an error
7879
* @param connection Connection
7980
* @param videoView View hosting the remote video
8081
*/
81-
//public void onReceiveRemoteVideo(RCConnection connection, GLSurfaceView videoView);
82+
// #WEBRTC-VIDEO TODO uncomment
83+
// public void onReceiveRemoteVideo(RCConnection connection, GLSurfaceView videoView);
8284
}
8385

0 commit comments

Comments
 (0)