VideoCapturer

tee3.webrtc

## 接口 VideoCapturer

- 所有已知子接口:
    CameraVideoCapturer
  所有已知实现类:
    Camera1Capturer, Camera2Capturer, FileVideoCapturer, ScaleScreenCapturer, ScreenCapturerAndroid, UsbCameraCapturerAndroid

      public interface VideoCapturer

- - ### 嵌套类概要

    嵌套类
    限定符和类型 | 接口和说明
    --- | ---
    `static interface` | `VideoCapturer.CapturerObserver`

  - ### 方法概要

    所有方法 实例方法 抽象方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `changeCaptureFormat(int width, int height, int framerate)`
    `void` | `dispose()` Perform any final cleanup here.
    `void` | `initialize(SurfaceTextureHelper surfaceTextureHelper, android.content.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` | `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.

- - ### 方法详细资料

    - #### initialize

          void initialize(SurfaceTextureHelper surfaceTextureHelper,
                          android.content.Context applicationContext,
                          VideoCapturer.CapturerObserver capturerObserver)

      This function is used to initialize the camera thread, the android application context, and the capture observer. It will be called only once and before any startCapture() request. The camera thread is guaranteed to be valid until dispose() is called. If the VideoCapturer wants to deliver texture frames, it should do this by rendering on the SurfaceTexture in `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.

    - #### startCapture

          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`.

    - #### stopCapture

          void stopCapture()
                    throws java.lang.InterruptedException

      Stop capturing. This function should block until capture is actually stopped.
      抛出:
        `java.lang.InterruptedException`

    - #### changeCaptureFormat

          void changeCaptureFormat(int width,
                                   int height,
                                   int framerate)

    - #### dispose

          void dispose()

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

    - #### isScreencast

          boolean isScreencast()

      返回:
        true if-and-only-if this is a screen capturer.