@Override
 public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
   if (surface.equals(mCameraPreview.getSurfaceTexture())) {
     if (DBG) log("CameraPreview surface texture destroyed");
     stopRecordingAndPreview();
     closeCamera();
     mCameraSurface = null;
   } else if (surface.equals(mFarEndView.getSurfaceTexture())) {
     if (DBG) log("FarEndView surface texture destroyed");
     mFarEndSurface = null;
     mVideoCallManager.setFarEndSurface(null);
   }
   return true;
 }
 @Override
 public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
   if (surface.equals(mCameraPreview.getSurfaceTexture())) {
     if (DBG) log("Camera surface texture created");
     mCameraSurface = surface;
     if (isCameraInitNeeded()) {
       initializeCamera();
     }
   } else if (surface.equals(mFarEndView.getSurfaceTexture())) {
     if (DBG) log("Video surface texture created");
     mFarEndSurface = surface;
     mVideoCallManager.setFarEndSurface(mFarEndSurface);
   }
 }