mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 16:49:40 +01:00
Add screen share receive support and improve video calling rotation.
This commit is contained in:
committed by
Greyson Parrelli
parent
513e5b45c5
commit
b9b2924939
@@ -22,6 +22,7 @@ import org.webrtc.CameraVideoCapturer;
|
||||
import org.webrtc.CapturerObserver;
|
||||
import org.webrtc.EglBase;
|
||||
import org.webrtc.SurfaceTextureHelper;
|
||||
import org.webrtc.VideoFrame;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -81,7 +82,7 @@ public class Camera implements CameraControl, CameraVideoCapturer.CameraSwitchHa
|
||||
if (capturer != null) {
|
||||
capturer.initialize(SurfaceTextureHelper.create("WebRTC-SurfaceTextureHelper", eglBase.getEglBaseContext()),
|
||||
context,
|
||||
observer);
|
||||
new CameraCapturerWrapper(observer));
|
||||
capturer.setOrientation(orientation);
|
||||
isInitialized = true;
|
||||
}
|
||||
@@ -297,4 +298,30 @@ public class Camera implements CameraControl, CameraVideoCapturer.CameraSwitchHa
|
||||
return new Camera2Capturer(context, deviceName, eventsHandler, new FilteredCamera2Enumerator(context));
|
||||
}
|
||||
}
|
||||
|
||||
private class CameraCapturerWrapper implements CapturerObserver {
|
||||
private final CapturerObserver observer;
|
||||
|
||||
public CameraCapturerWrapper(@NonNull CapturerObserver observer) {
|
||||
this.observer = observer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCapturerStarted(boolean success) {
|
||||
observer.onCapturerStarted(success);
|
||||
if (success) {
|
||||
cameraEventListener.onFullyInitialized();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCapturerStopped() {
|
||||
observer.onCapturerStopped();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFrameCaptured(VideoFrame videoFrame) {
|
||||
observer.onFrameCaptured(videoFrame);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@ package org.thoughtcrime.securesms.ringrtc;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public interface CameraEventListener {
|
||||
void onFullyInitialized();
|
||||
void onCameraSwitchCompleted(@NonNull CameraState newCameraState);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user