Fixed issues with video preview

This commit is contained in:
Sylvain Berfini 2018-01-18 19:02:14 +01:00
parent 02e9c82e94
commit d54696116c
3 changed files with 13 additions and 2 deletions

View file

@ -163,6 +163,10 @@ public class CallVideoFragment extends Fragment implements OnGestureListener, On
int maxHeight = screenHeight / 4; // Let's take at most 1/4 of the screen for the camera preview int maxHeight = screenHeight / 4; // Let's take at most 1/4 of the screen for the camera preview
VideoDefinition videoSize = call.getCurrentParams().getSentVideoDefinition(); // It already takes care of rotation VideoDefinition videoSize = call.getCurrentParams().getSentVideoDefinition(); // It already takes care of rotation
if (videoSize.getWidth() == 0 || videoSize.getHeight() == 0) {
Log.w("Couldn't get sent video definition, using default video definition");
videoSize = lc.getPreferredVideoDefinition();
}
int width = videoSize.getWidth(); int width = videoSize.getWidth();
int height = videoSize.getHeight(); int height = videoSize.getHeight();
@ -170,6 +174,10 @@ public class CallVideoFragment extends Fragment implements OnGestureListener, On
width = width * maxHeight / height; width = width * maxHeight / height;
height = maxHeight; height = maxHeight;
if (mCaptureView == null) {
Log.e("mCaptureView is null !");
return;
}
mCaptureView.getHolder().setFixedSize(width, height); mCaptureView.getHolder().setFixedSize(width, height);
Log.d("Video preview size set to " + width + "x" + height); Log.d("Video preview size set to " + width + "x" + height);
} }
@ -196,8 +204,10 @@ public class CallVideoFragment extends Fragment implements OnGestureListener, On
String newDevice; String newDevice;
if (index == 1) if (index == 1)
newDevice = devices[0]; newDevice = devices[0];
else else if (devices.length > 1)
newDevice = devices[1]; newDevice = devices[1];
else
newDevice = devices[index];
LinphoneManager.getLc().setVideoDevice(newDevice); LinphoneManager.getLc().setVideoDevice(newDevice);
CallManager.getInstance().updateCall(); CallManager.getInstance().updateCall();

View file

@ -183,6 +183,7 @@ public class ChatEventsAdapter extends ListSelectionAdapter implements ChatMessa
if (status == ChatMessage.State.Delivered) { if (status == ChatMessage.State.Delivered) {
holder.imdmLayout.setVisibility(View.VISIBLE); holder.imdmLayout.setVisibility(View.VISIBLE);
holder.imdmLabel.setText(R.string.sent); holder.imdmLabel.setText(R.string.sent);
holder.imdmIcon.setImageResource(R.drawable.chat_delivered);
holder.imdmLabel.setTextColor(mContext.getResources().getColor(R.color.colorD)); holder.imdmLabel.setTextColor(mContext.getResources().getColor(R.color.colorD));
} else if (status == ChatMessage.State.DeliveredToUser) { } else if (status == ChatMessage.State.DeliveredToUser) {
holder.imdmLayout.setVisibility(View.VISIBLE); holder.imdmLayout.setVisibility(View.VISIBLE);

@ -1 +1 @@
Subproject commit 75cbb769457a738ea2f676a37b6957a003ad84f5 Subproject commit 63a16edcadc7b11cd2941ae476586a91b318cbb0