public class UsbCameraCapturerAndroid extends java.lang.Object implements VideoCapturer, SurfaceTextureHelper.OnTextureFrameAvailableListener
限定符和类型 | 类和说明 |
---|---|
static interface |
UsbCameraCapturerAndroid.UsbCameraEvent |
VideoCapturer.CapturerObserver
限定符和类型 | 字段和说明 |
---|---|
boolean |
isAttached |
static java.lang.String |
TAG |
限定符和类型 | 方法和说明 |
---|---|
UsbCameraCapturerAndroid |
addUsbCameraListener(UsbCameraCapturerAndroid.UsbCameraEvent usbCameraEvent) |
void |
changeCaptureFormat(int width,
int height,
int ignoredFramerate) |
void |
dispose()
Perform any final cleanup here.
|
static UsbCameraCapturerAndroid |
getInstance() |
long |
getNumCapturedFrames() |
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 |
isAttached() |
boolean |
isScreencast() |
void |
onTextureFrameAvailable(int oesTextureId,
float[] transformMatrix,
long timestampNs) |
UsbCameraCapturerAndroid |
setupUsbCameraMonitor(Context applicationContext) |
void |
startCapture(int width,
int height,
int ignoredFramerate)
Start capturing frames in a format that is as close as possible to
width x height and
framerate . |
void |
stopCapture()
Stop capturing.
|
UsbCameraCapturerAndroid |
stopUsbCameraMonitor() |
public static UsbCameraCapturerAndroid getInstance()
public UsbCameraCapturerAndroid addUsbCameraListener(UsbCameraCapturerAndroid.UsbCameraEvent usbCameraEvent)
public UsbCameraCapturerAndroid setupUsbCameraMonitor(Context applicationContext)
public UsbCameraCapturerAndroid stopUsbCameraMonitor()
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 ignoredFramerate)
VideoCapturer
width x height
and
framerate
.startCapture
在接口中 VideoCapturer
public void stopCapture()
VideoCapturer
stopCapture
在接口中 VideoCapturer
public void dispose()
VideoCapturer
dispose
在接口中 VideoCapturer
public void changeCaptureFormat(int width, int height, int ignoredFramerate)
changeCaptureFormat
在接口中 VideoCapturer
public void onTextureFrameAvailable(int oesTextureId, float[] transformMatrix, long timestampNs)
public boolean isScreencast()
isScreencast
在接口中 VideoCapturer
public long getNumCapturedFrames()
public boolean isAttached()