-
- All Implemented Interfaces:
-
com.twilio.video.VideoCapturer,tvi.webrtc.VideoCapturer
public class ScreenCapturer implements VideoCapturer
The ScreenCapturer class is used to provide video frames for a LocalVideoTrack from a device's screen. The frames are provided via the MediaProjection api. This capturer is only compatible with LOLLIPOP or higher.
This class represents an implementation of a VideoCapturer interface. Although public, these methods are not meant to be invoked directly.
Note: This capturer can be reused, but cannot be shared across multiple s simultaneously.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceScreenCapturer.ListenerInterface that provides events and errors related to ScreenCapturer.
-
Constructor Summary
Constructors Constructor Description ScreenCapturer(Context context, int screenCaptureIntentResult, Intent screenCaptureIntentData, ScreenCapturer.Listener screenCapturerListener, int framesPerSecond)ScreenCapturer(Context context, int screenCaptureIntentResult, Intent screenCaptureIntentData, ScreenCapturer.Listener screenCapturerListener)
-
Method Summary
Modifier and Type Method Description VideoFormatgetCaptureFormat()booleanisScreencast()Indicates that the screen capturer is a screencast. voidinitialize(@NonNull() SurfaceTextureHelper surfaceTextureHelper, @NonNull() Context context, @NonNull() CapturerObserver capturerObserver)voidstartCapture(int width, int height, int framerate)voidstopCapture()Stops all frames being captured. voiddispose()This method provides an optional step to perform a final cleanup. -
Methods inherited from class com.twilio.video.VideoCapturer
changeCaptureFormat -
Methods inherited from class tvi.webrtc.VideoCapturer
changeCaptureFormat, dispose, initialize, isScreencast, startCapture, stopCapture -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ScreenCapturer
ScreenCapturer(Context context, int screenCaptureIntentResult, Intent screenCaptureIntentData, ScreenCapturer.Listener screenCapturerListener, int framesPerSecond)
-
ScreenCapturer
ScreenCapturer(Context context, int screenCaptureIntentResult, Intent screenCaptureIntentData, ScreenCapturer.Listener screenCapturerListener)
-
-
Method Detail
-
getCaptureFormat
VideoFormat getCaptureFormat()
-
isScreencast
boolean isScreencast()
Indicates that the screen capturer is a screencast.
-
initialize
void initialize(@NonNull() SurfaceTextureHelper surfaceTextureHelper, @NonNull() Context context, @NonNull() CapturerObserver capturerObserver)
-
startCapture
void startCapture(int width, int height, int framerate)
-
stopCapture
void stopCapture()
Stops all frames being captured. MediaProjection should be available for use uponcompletion.
Note: This method is not meant to be invoked directly.
-
dispose
void dispose()
This method provides an optional step to perform a final cleanup.
-
-
-
-