public class ScreenCapturer extends java.lang.Object implements VideoCapturer
LocalVideoTrack
from a
device's screen. The frames are provided via the MediaProjection
api. This capturer is
only compatible with Build.VERSION_CODES.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 LocalVideoTrack
s simultaneously.
Modifier and Type | Class and Description |
---|---|
static interface |
ScreenCapturer.Listener
Interface that provides events and errors related to
ScreenCapturer . |
Constructor and Description |
---|
ScreenCapturer(android.content.Context context,
int screenCaptureIntentResult,
android.content.Intent screenCaptureIntentData,
ScreenCapturer.Listener screenCapturerListener) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
This method provides an optional step to perform a final cleanup.
|
VideoFormat |
getCaptureFormat() |
void |
initialize(tvi.webrtc.SurfaceTextureHelper surfaceTextureHelper,
android.content.Context context,
tvi.webrtc.CapturerObserver capturerObserver) |
boolean |
isScreencast()
Indicates that the screen capturer is a screencast.
|
void |
startCapture(int width,
int height,
int framerate) |
void |
stopCapture()
Stops all frames being captured.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
changeCaptureFormat
public ScreenCapturer(@NonNull android.content.Context context, int screenCaptureIntentResult, @NonNull android.content.Intent screenCaptureIntentData, @Nullable ScreenCapturer.Listener screenCapturerListener)
public VideoFormat getCaptureFormat()
public boolean isScreencast()
isScreencast
in interface tvi.webrtc.VideoCapturer
public void initialize(@NonNull tvi.webrtc.SurfaceTextureHelper surfaceTextureHelper, @NonNull android.content.Context context, @NonNull tvi.webrtc.CapturerObserver capturerObserver)
initialize
in interface tvi.webrtc.VideoCapturer
public void startCapture(int width, int height, int framerate)
startCapture
in interface tvi.webrtc.VideoCapturer
public void stopCapture()
MediaProjection
should be available for use upon
completion.
Note: This method is not meant to be invoked directly.
stopCapture
in interface tvi.webrtc.VideoCapturer
public void dispose()
VideoCapturer
dispose
in interface tvi.webrtc.VideoCapturer
6.0.0