Package com.telnyx.webrtc.lib
Class Camera1Capturer
java.lang.Object
com.telnyx.webrtc.lib.Camera1Capturer
- All Implemented Interfaces:
CameraVideoCapturer,VideoCapturer
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.telnyx.webrtc.lib.CameraVideoCapturer
CameraVideoCapturer.CameraEventsHandler, CameraVideoCapturer.CameraStatistics, CameraVideoCapturer.CameraSwitchHandler, CameraVideoCapturer.MediaRecorderHandler -
Constructor Summary
ConstructorsConstructorDescriptionCamera1Capturer(String cameraName, CameraVideoCapturer.CameraEventsHandler eventsHandler, boolean captureToTexture) -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeCaptureFormat(int width, int height, int framerate) voiddispose()Perform any final cleanup here.voidinitialize(SurfaceTextureHelper surfaceTextureHelper, Context applicationContext, CapturerObserver capturerObserver) This function is used to initialize the camera thread, the android application context, and the capture observer.booleanvoidvoidstartCapture(int width, int height, int framerate) Start capturing frames in a format that is as close as possible towidth x heightandframerate.voidStop capturing.voidswitchCamera(CameraVideoCapturer.CameraSwitchHandler switchEventsHandler) Switch camera to the next valid camera id.voidswitchCamera(CameraVideoCapturer.CameraSwitchHandler switchEventsHandler, String cameraName) Switch camera to the specified camera id.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.telnyx.webrtc.lib.CameraVideoCapturer
addMediaRecorderToCamera, removeMediaRecorderFromCamera
-
Constructor Details
-
Camera1Capturer
public Camera1Capturer(String cameraName, CameraVideoCapturer.CameraEventsHandler eventsHandler, boolean captureToTexture)
-
-
Method Details
-
initialize
public void initialize(SurfaceTextureHelper surfaceTextureHelper, Context applicationContext, CapturerObserver capturerObserver) Description copied from interface:VideoCapturerThis function is used to initialize the camera thread, the android application context, and the capture observer. It will be called only once and before any startCapture() request. The camera thread is guaranteed to be valid until dispose() is called. If the VideoCapturer wants to deliver texture frames, it should do this by rendering on the SurfaceTexture insurfaceTextureHelper, register itself as a listener, and forward the frames to CapturerObserver.onFrameCaptured(). The caller still has ownership ofsurfaceTextureHelperand is responsible for making sure surfaceTextureHelper.dispose() is called. This also means that the caller can reuse the SurfaceTextureHelper to initialize a new VideoCapturer once the previous VideoCapturer has been disposed.- Specified by:
initializein interfaceVideoCapturer
-
startCapture
public void startCapture(int width, int height, int framerate) Description copied from interface:VideoCapturerStart capturing frames in a format that is as close as possible towidth x heightandframerate.- Specified by:
startCapturein interfaceVideoCapturer
-
stopCapture
public void stopCapture()Description copied from interface:VideoCapturerStop capturing. This function should block until capture is actually stopped.- Specified by:
stopCapturein interfaceVideoCapturer
-
changeCaptureFormat
public void changeCaptureFormat(int width, int height, int framerate) - Specified by:
changeCaptureFormatin interfaceVideoCapturer
-
dispose
public void dispose()Description copied from interface:VideoCapturerPerform any final cleanup here. No more capturing will be done after this call.- Specified by:
disposein interfaceVideoCapturer
-
switchCamera
Description copied from interface:CameraVideoCapturerSwitch camera to the next valid camera id. This can only be called while the camera is running. This function can be called from any thread.- Specified by:
switchCamerain interfaceCameraVideoCapturer
-
switchCamera
public void switchCamera(CameraVideoCapturer.CameraSwitchHandler switchEventsHandler, String cameraName) Description copied from interface:CameraVideoCapturerSwitch camera to the specified camera id. This can only be called while the camera is running. This function can be called from any thread.- Specified by:
switchCamerain interfaceCameraVideoCapturer
-
isScreencast
public boolean isScreencast()- Specified by:
isScreencastin interfaceVideoCapturer- Returns:
- true if-and-only-if this is a screen capturer.
-
printStackTrace
public void printStackTrace()
-