public class ScaleScreenCapturer extends java.lang.Object implements VideoCapturer, SurfaceTextureHelper.OnTextureFrameAvailableListener, ScreenCapturerAndroid.TextureFrameAvailable
限定符和类型 | 类和说明 |
---|---|
static class |
ScaleScreenCapturer.ScaleZone |
VideoCapturer.CapturerObserver
构造器和说明 |
---|
ScaleScreenCapturer() |
限定符和类型 | 方法和说明 |
---|---|
void |
changeCaptureFormat(int width,
int height,
int framerate) |
void |
dispose()
Perform any final cleanup here.
|
static ScaleScreenCapturer.ScaleZone |
getScaleZone() |
void |
initialize(SurfaceTextureHelper surfaceTextureHelper,
Context applicationContext,
VideoCapturer.CapturerObserver capturerObserver)
This function is used to initialize the camera thread, the android application context, and the
capture observer.
|
boolean |
isScreencast() |
void |
onTextureFrameAvailable(int oesTextureId,
float[] transformMatrix,
long timestampNs) |
void |
onTextureFrameAvailable(VideoFrame.I420Buffer i420Buffer,
long timestampNs) |
static void |
setScaleZone(ScaleScreenCapturer.ScaleZone scaleZone) |
void |
startCapture(int width,
int height,
int framerate)
Start capturing frames in a format that is as close as possible to
width x height and
framerate . |
void |
stopCapture()
Stop capturing.
|
public void onTextureFrameAvailable(int oesTextureId, float[] transformMatrix, long timestampNs)
public void initialize(SurfaceTextureHelper surfaceTextureHelper, Context applicationContext, VideoCapturer.CapturerObserver capturerObserver)
VideoCapturer
surfaceTextureHelper
, register itself as a listener, and forward the frames to
CapturerObserver.onFrameCaptured(). The caller still has ownership of surfaceTextureHelper
and 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.initialize
在接口中 VideoCapturer
public void startCapture(int width, int height, int framerate)
VideoCapturer
width x height
and
framerate
.startCapture
在接口中 VideoCapturer
public void stopCapture() throws java.lang.InterruptedException
VideoCapturer
stopCapture
在接口中 VideoCapturer
java.lang.InterruptedException
public void changeCaptureFormat(int width, int height, int framerate)
changeCaptureFormat
在接口中 VideoCapturer
public void dispose()
VideoCapturer
dispose
在接口中 VideoCapturer
public boolean isScreencast()
isScreencast
在接口中 VideoCapturer
public void onTextureFrameAvailable(VideoFrame.I420Buffer i420Buffer, long timestampNs)
public static void setScaleZone(ScaleScreenCapturer.ScaleZone scaleZone)
public static ScaleScreenCapturer.ScaleZone getScaleZone()