webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | List of all members
org.webrtc.ScreenCapturerAndroid Class Reference
Inheritance diagram for org.webrtc.ScreenCapturerAndroid:
org.webrtc.VideoCapturer org.webrtc.SurfaceTextureHelper.OnTextureFrameAvailableListener

Public Member Functions

 ScreenCapturerAndroid (Intent mediaProjectionPermissionResultData, MediaProjection.Callback mediaProjectionCallback)
 
synchronized void initialize (final SurfaceTextureHelper surfaceTextureHelper, final Context applicationContext, final VideoCapturer.CapturerObserver capturerObserver)
 
synchronized void startCapture (final int width, final int height, final int ignoredFramerate)
 
synchronized void stopCapture ()
 
synchronized void dispose ()
 
synchronized void changeCaptureFormat (final int width, final int height, final int ignoredFramerate)
 
void onTextureFrameAvailable (int oesTextureId, float[] transformMatrix, long timestampNs)
 
boolean isScreencast ()
 
long getNumCapturedFrames ()
 
- Public Member Functions inherited from org.webrtc.VideoCapturer
void initialize (SurfaceTextureHelper surfaceTextureHelper, Context applicationContext, CapturerObserver capturerObserver)
 

Detailed Description

An implementation of VideoCapturer to capture the screen content as a video stream. Capturing is done by

MediaProjection

on a

SurfaceTexture

. We interact with this

SurfaceTexture

using a

SurfaceTextureHelper

. The

SurfaceTextureHelper

is created by the native code and passed to this capturer in

VideoCapturer.initialize()

. On receiving a new frame, this capturer passes it as a texture to the native code via

CapturerObserver.onTextureFrameCaptured()

. This takes place on the HandlerThread of the given

SurfaceTextureHelper

. When done with each frame, the native code returns the buffer to the

SurfaceTextureHelper

to be used for new frames. At any time, at most one frame is being processed.

Constructor & Destructor Documentation

◆ ScreenCapturerAndroid()

org.webrtc.ScreenCapturerAndroid.ScreenCapturerAndroid ( Intent  mediaProjectionPermissionResultData,
MediaProjection.Callback  mediaProjectionCallback 
)
inline

Constructs a new Screen Capturer.

Parameters
mediaProjectionPermissionResultDatathe result data of MediaProjection permission activity; the calling app must validate that result code is Activity.RESULT_OK before calling this method.
mediaProjectionCallbackMediaProjection callback to implement application specific logic in events such as when the user revokes a previously granted capture permission.

Member Function Documentation

◆ changeCaptureFormat()

synchronized void org.webrtc.ScreenCapturerAndroid.changeCaptureFormat ( final int  width,
final int  height,
final int  ignoredFramerate 
)
inline

Changes output video format. This method can be used to scale the output video, or to change orientation when the captured screen is rotated for example.

Parameters
widthnew output video width
heightnew output video height
ignoredFramerateignored

Implements org.webrtc.VideoCapturer.

◆ dispose()

synchronized void org.webrtc.ScreenCapturerAndroid.dispose ( )
inline

Perform any final cleanup here. No more capturing will be done after this call.

Implements org.webrtc.VideoCapturer.

◆ getNumCapturedFrames()

long org.webrtc.ScreenCapturerAndroid.getNumCapturedFrames ( )
inline

◆ initialize()

synchronized void org.webrtc.ScreenCapturerAndroid.initialize ( final SurfaceTextureHelper  surfaceTextureHelper,
final Context  applicationContext,
final VideoCapturer.CapturerObserver  capturerObserver 
)
inline

◆ isScreencast()

boolean org.webrtc.ScreenCapturerAndroid.isScreencast ( )
inline
Returns
true if-and-only-if this is a screen capturer.

Implements org.webrtc.VideoCapturer.

◆ onTextureFrameAvailable()

void org.webrtc.ScreenCapturerAndroid.onTextureFrameAvailable ( int  oesTextureId,
float []  transformMatrix,
long  timestampNs 
)
inline

◆ startCapture()

synchronized void org.webrtc.ScreenCapturerAndroid.startCapture ( final int  width,
final int  height,
final int  framerate 
)
inline

Start capturing frames in a format that is as close as possible to |width| x |height| and |framerate|.

Implements org.webrtc.VideoCapturer.

◆ stopCapture()

synchronized void org.webrtc.ScreenCapturerAndroid.stopCapture ( )
inline

Stop capturing. This function should block until capture is actually stopped.

Implements org.webrtc.VideoCapturer.


The documentation for this class was generated from the following file: