fix video deadlock and double instanciation of VideoActivity
This commit is contained in:
parent
4a34869d3a
commit
f502245650
7 changed files with 18 additions and 14 deletions
Binary file not shown.
Binary file not shown.
|
@ -1,5 +1,5 @@
|
|||
[net]
|
||||
download_bw=128
|
||||
download_bw=384
|
||||
upload_bw=128
|
||||
firewall_policy=0
|
||||
mtu=0
|
||||
|
|
|
@ -422,6 +422,13 @@ public class DialerActivity extends Activity implements LinphoneCoreListener {
|
|||
callPending();
|
||||
} else if (state == LinphoneCall.State.Connected) {
|
||||
enterIncalMode(lc);
|
||||
if (LinphoneService.instance().getLinphoneCore().isVideoEnabled()) {
|
||||
//start video view
|
||||
Intent lIntent = new Intent();
|
||||
lIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
lIntent.setClass(this, VideoCallActivity.class);
|
||||
startActivityForResult(lIntent,VIDEO_VIEW_ACTIVITY);
|
||||
}
|
||||
} else if (state == LinphoneCall.State.Error) {
|
||||
if (mWakeLock.isHeld()) mWakeLock.release();
|
||||
Toast toast = Toast.makeText(this
|
||||
|
@ -464,13 +471,6 @@ public class DialerActivity extends Activity implements LinphoneCoreListener {
|
|||
routeAudioToReceiver();
|
||||
}
|
||||
setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
|
||||
if (LinphoneService.instance().getLinphoneCore().isVideoEnabled()) {
|
||||
//start video view
|
||||
Intent lIntent = new Intent();
|
||||
lIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
lIntent.setClass(this, VideoCallActivity.class);
|
||||
startActivityForResult(lIntent,VIDEO_VIEW_ACTIVITY);
|
||||
}
|
||||
}
|
||||
private void exitCallMode() {
|
||||
mCallControlRow.setVisibility(View.VISIBLE);
|
||||
|
@ -611,3 +611,4 @@ public class DialerActivity extends Activity implements LinphoneCoreListener {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.linphone.core;
|
|||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Bitmap.Config;
|
||||
import android.util.Log;
|
||||
import android.view.Surface;
|
||||
import android.view.SurfaceHolder;
|
||||
import android.view.SurfaceView;
|
||||
|
@ -14,6 +15,7 @@ public class AndroidVideoWindowImpl {
|
|||
private SurfaceView mView;
|
||||
private Surface mSurface;
|
||||
private VideoWindowListener mListener;
|
||||
static private String TAG = "Linphone";
|
||||
public static interface VideoWindowListener{
|
||||
void onSurfaceReady(AndroidVideoWindowImpl vw);
|
||||
void onSurfaceDestroyed(AndroidVideoWindowImpl vw);
|
||||
|
@ -26,12 +28,12 @@ public class AndroidVideoWindowImpl {
|
|||
view.getHolder().addCallback(new Callback(){
|
||||
public void surfaceChanged(SurfaceHolder holder, int format,
|
||||
int width, int height) {
|
||||
Log.i(TAG,"Surface is being changed.");
|
||||
synchronized(AndroidVideoWindowImpl.this){
|
||||
mBitmap=Bitmap.createBitmap(width,height,Config.RGB_565);
|
||||
mSurface=holder.getSurface();
|
||||
if (mListener!=null) mListener.onSurfaceReady(AndroidVideoWindowImpl.this);
|
||||
|
||||
}
|
||||
if (mListener!=null) mListener.onSurfaceReady(AndroidVideoWindowImpl.this);
|
||||
}
|
||||
|
||||
public void surfaceCreated(SurfaceHolder holder) {
|
||||
|
@ -39,11 +41,11 @@ public class AndroidVideoWindowImpl {
|
|||
|
||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||
synchronized(AndroidVideoWindowImpl.this){
|
||||
if (mListener!=null)
|
||||
mListener.onSurfaceDestroyed(AndroidVideoWindowImpl.this);
|
||||
mSurface=null;
|
||||
mBitmap=null;
|
||||
}
|
||||
if (mListener!=null)
|
||||
mListener.onSurfaceDestroyed(AndroidVideoWindowImpl.this);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -74,3 +76,4 @@ public class AndroidVideoWindowImpl {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
private native long createChatRoom(long nativePtr,String to);
|
||||
private native void enableVideo(long nativePtr,boolean vcap_enabled,boolean display_enabled);
|
||||
private native boolean isVideoEnabled(long nativePtr);
|
||||
|
||||
private static String TAG = "LinphoneCore";
|
||||
|
||||
LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object userdata) throws IOException {
|
||||
mListener=listener;
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 4bb9fbefa30be99fdd6f6758ba169b482fe7184f
|
||||
Subproject commit 632c76515682a20e4c62542febcb23f637479efe
|
Loading…
Reference in a new issue