VideoFrame.Buffer

tee3.webrtc

## 接口 VideoFrame.Buffer

- 所有超级接口:
    RefCounted
  所有已知子接口:
    VideoFrame.I420Buffer, VideoFrame.TextureBuffer
  所有已知实现类:
    JavaI420Buffer, NV12Buffer, NV21Buffer, TextureBufferImpl
  封闭类:
    VideoFrame

      public static interface VideoFrame.Buffer
      extends RefCounted

  Implements image storage medium. Might be for example an OpenGL texture or a memory region containing I420-data.

  Reference counting is needed since a video buffer can be shared between multiple VideoSinks, and the buffer needs to be returned to the VideoSource as soon as all references are gone.

- - ### 方法概要

    所有方法 实例方法 抽象方法
    限定符和类型 | 方法和说明
    --- | ---
    `VideoFrame.Buffer` | `cropAndScale(int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight)` Crops a region defined by |cropx|, |cropY|, |cropWidth| and |cropHeight|.
    `int` | `getHeight()`
    `int` | `getWidth()` Resolution of the buffer in pixels.
    `void` | `release()` Decreases ref count by one.
    `void` | `retain()` Increases ref count by one.
    `VideoFrame.I420Buffer` | `toI420()` Returns a memory-backed frame in I420 format.

- - ### 方法详细资料

    - #### getWidth

          int getWidth()

      Resolution of the buffer in pixels.

    - #### getHeight

          int getHeight()

    - #### toI420

          VideoFrame.I420Buffer toI420()

      Returns a memory-backed frame in I420 format. If the pixel data is in another format, a conversion will take place. All implementations must provide a fallback to I420 for compatibility with e.g. the internal WebRTC software encoders.

    - #### retain

          void retain()

      从接口复制的说明: `RefCounted`
      Increases ref count by one.
      指定者:
        `retain` 在接口中 `RefCounted`

    - #### release

          void release()

      从接口复制的说明: `RefCounted`
      Decreases ref count by one. When the ref count reaches zero, resources related to the object will be freed.
      指定者:
        `release` 在接口中 `RefCounted`

    - #### cropAndScale

          VideoFrame.Buffer cropAndScale(int cropX,
                                         int cropY,
                                         int cropWidth,
                                         int cropHeight,
                                         int scaleWidth,
                                         int scaleHeight)

      Crops a region defined by |cropx|, |cropY|, |cropWidth| and |cropHeight|. Scales it to size |scaleWidth| x |scaleHeight|.