Revert attempts to fix broken camera issue

This commit is contained in:
Miriam Zimmerman
2025-07-17 15:30:06 -04:00
committed by GitHub
parent b0d89ccc97
commit 6553c416f8
5 changed files with 10 additions and 94 deletions

View File

@@ -80,23 +80,4 @@ public abstract class DeviceAwareActionProcessor extends WebRtcActionProcessor {
.cameraState(newCameraState)
.build();
}
@Override
public @NonNull WebRtcServiceState handleCameraSwitchFailure(@NonNull WebRtcServiceState currentState, @NonNull CameraState newCameraState) {
Log.i(tag, "handleCameraSwitchFailure():");
BroadcastVideoSink localSink = currentState.getVideoState().getLocalSink();
if (localSink != null) {
localSink.setRotateToRightSide(false);
}
if (currentState.getVideoState().getCamera() != null) {
// Retry by recreating with the opposite preferred camera
currentState.getVideoState().getCamera().disposeAndFlipCamera();
}
return currentState.builder()
.changeLocalDeviceState()
.cameraState(newCameraState)
.build();
}
}

View File

@@ -69,6 +69,7 @@ import org.thoughtcrime.securesms.service.webrtc.state.WebRtcEphemeralState;
import org.thoughtcrime.securesms.service.webrtc.state.WebRtcServiceState;
import org.thoughtcrime.securesms.util.AppForegroundObserver;
import org.thoughtcrime.securesms.util.RecipientAccessList;
import org.thoughtcrime.securesms.util.RemoteConfig;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
import org.thoughtcrime.securesms.util.Util;
import org.thoughtcrime.securesms.util.rx.RxStore;
@@ -989,11 +990,8 @@ public final class SignalCallManager implements CallManager.Observer, GroupCall.
}
@Override
public void onFullyInitialized(@NonNull final CameraState newCameraState) {
process((s, p) -> {
WebRtcServiceState s1 = p.handleSetCameraDirection(s, newCameraState);
return p.handleOrientationChanged(s1, s.getLocalDeviceState().isLandscapeEnabled(), s.getLocalDeviceState().getDeviceOrientation().getDegrees());
});
public void onFullyInitialized() {
process((s, p) -> p.handleOrientationChanged(s, s.getLocalDeviceState().isLandscapeEnabled(), s.getLocalDeviceState().getDeviceOrientation().getDegrees()));
}
@Override
@@ -1001,11 +999,6 @@ public final class SignalCallManager implements CallManager.Observer, GroupCall.
process((s, p) -> p.handleCameraSwitchCompleted(s, newCameraState));
}
@Override
public void onCameraSwitchFailure(@NonNull final CameraState newCameraState) {
process((s, p) -> p.handleCameraSwitchFailure(s, newCameraState));
}
@Override
public void onCameraStopped() {
Log.i(TAG, "Camera error. Muting video.");

View File

@@ -569,11 +569,6 @@ public abstract class WebRtcActionProcessor {
return currentState;
}
public @NonNull WebRtcServiceState handleCameraSwitchFailure(@NonNull WebRtcServiceState currentState, @NonNull CameraState newCameraState) {
Log.i(tag, "handleCameraSwitchFailure not processed");
return currentState;
}
public @NonNull WebRtcServiceState handleNetworkChanged(@NonNull WebRtcServiceState currentState, boolean available) {
Log.i(tag, "handleNetworkChanged not processed");
return currentState;
@@ -635,18 +630,6 @@ public abstract class WebRtcActionProcessor {
.build();
}
protected @NonNull WebRtcServiceState handleSetCameraDirection(@NonNull WebRtcServiceState currentState, CameraState state) {
BroadcastVideoSink sink = currentState.getVideoState().getLocalSink();
if (sink != null) {
sink.setRotateToRightSide(state.getActiveDirection() == CameraState.Direction.BACK);
}
return currentState.builder()
.changeLocalDeviceState()
.cameraState(state)
.build();
}
//endregion Local device
//region End call