Package com.telnyx.webrtc.lib
Interface VideoCapturer
- All Known Subinterfaces:
CameraVideoCapturer
- All Known Implementing Classes:
Camera1Capturer,Camera2Capturer,FileVideoCapturer,ScreenCapturerAndroid
public interface VideoCapturer
-
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.booleanvoidstartCapture(int width, int height, int framerate) Start capturing frames in a format that is as close as possible towidth x heightandframerate.voidStop capturing.
-
Method Details
-
initialize
void initialize(SurfaceTextureHelper surfaceTextureHelper, Context applicationContext, CapturerObserver capturerObserver) This 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. -
startCapture
void startCapture(int width, int height, int framerate) Start capturing frames in a format that is as close as possible towidth x heightandframerate. -
stopCapture
Stop capturing. This function should block until capture is actually stopped.- Throws:
InterruptedException
-
changeCaptureFormat
void changeCaptureFormat(int width, int height, int framerate) -
dispose
void dispose()Perform any final cleanup here. No more capturing will be done after this call. -
isScreencast
boolean isScreencast()- Returns:
- true if-and-only-if this is a screen capturer.
-