JavaI420Buffer

tee3.webrtc

## 类 JavaI420Buffer

- java.lang.Object
- - tee3.webrtc.JavaI420Buffer

- 所有已实现的接口:
    RefCounted, VideoFrame.Buffer, VideoFrame.I420Buffer

      public class JavaI420Buffer
      extends java.lang.Object
      implements VideoFrame.I420Buffer

  Implementation of VideoFrame.I420Buffer backed by Java direct byte buffers.

- - ### 方法概要

    所有方法 静态方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `static JavaI420Buffer` | `allocate(int width, int height)` Allocates an empty I420Buffer suitable for an image of the given dimensions.
    `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|.
    `java.nio.ByteBuffer` | `getDataU()` Returns a direct ByteBuffer containing U-plane data.
    `java.nio.ByteBuffer` | `getDataV()` Returns a direct ByteBuffer containing V-plane data.
    `java.nio.ByteBuffer` | `getDataY()` Returns a direct ByteBuffer containing Y-plane data.
    `int` | `getHeight()`
    `int` | `getStrideU()`
    `int` | `getStrideV()`
    `int` | `getStrideY()`
    `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.
    `static JavaI420Buffer` | `wrap(int width, int height, java.nio.ByteBuffer dataY, int strideY, java.nio.ByteBuffer dataU, int strideU, java.nio.ByteBuffer dataV, int strideV, java.lang.Runnable releaseCallback)` Wraps existing ByteBuffers into JavaI420Buffer object without copying the contents.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 方法详细资料

    - #### wrap

          public static JavaI420Buffer wrap(int width,
                                            int height,
                                            java.nio.ByteBuffer dataY,
                                            int strideY,
                                            java.nio.ByteBuffer dataU,
                                            int strideU,
                                            java.nio.ByteBuffer dataV,
                                            int strideV,
                                            java.lang.Runnable releaseCallback)

      Wraps existing ByteBuffers into JavaI420Buffer object without copying the contents.

    - #### allocate

          public static JavaI420Buffer allocate(int width,
                                                int height)

      Allocates an empty I420Buffer suitable for an image of the given dimensions.

    - #### getWidth

          public int getWidth()

      从接口复制的说明: `VideoFrame.Buffer`
      Resolution of the buffer in pixels.
      指定者:
        `getWidth` 在接口中 `VideoFrame.Buffer`

    - #### getHeight

          public int getHeight()

      指定者:
        `getHeight` 在接口中 `VideoFrame.Buffer`

    - #### getDataY

          public java.nio.ByteBuffer getDataY()

      从接口复制的说明: `VideoFrame.I420Buffer`
      Returns a direct ByteBuffer containing Y-plane data. The buffer capacity is at least getStrideY() * getHeight() bytes. The position of the returned buffer is ignored and must be 0. Callers may mutate the ByteBuffer (eg. through relative-read operations), so implementations must return a new ByteBuffer or slice for each call.
      指定者:
        `getDataY` 在接口中 `VideoFrame.I420Buffer`

    - #### getDataU

          public java.nio.ByteBuffer getDataU()

      从接口复制的说明: `VideoFrame.I420Buffer`
      Returns a direct ByteBuffer containing U-plane data. The buffer capacity is at least getStrideU() * ((getHeight() + 1) / 2) bytes. The position of the returned buffer is ignored and must be 0. Callers may mutate the ByteBuffer (eg. through relative-read operations), so implementations must return a new ByteBuffer or slice for each call.
      指定者:
        `getDataU` 在接口中 `VideoFrame.I420Buffer`

    - #### getDataV

          public java.nio.ByteBuffer getDataV()

      从接口复制的说明: `VideoFrame.I420Buffer`
      Returns a direct ByteBuffer containing V-plane data. The buffer capacity is at least getStrideV() * ((getHeight() + 1) / 2) bytes. The position of the returned buffer is ignored and must be 0. Callers may mutate the ByteBuffer (eg. through relative-read operations), so implementations must return a new ByteBuffer or slice for each call.
      指定者:
        `getDataV` 在接口中 `VideoFrame.I420Buffer`

    - #### getStrideY

          public int getStrideY()

      指定者:
        `getStrideY` 在接口中 `VideoFrame.I420Buffer`

    - #### getStrideU

          public int getStrideU()

      指定者:
        `getStrideU` 在接口中 `VideoFrame.I420Buffer`

    - #### getStrideV

          public int getStrideV()

      指定者:
        `getStrideV` 在接口中 `VideoFrame.I420Buffer`

    - #### toI420

          public VideoFrame.I420Buffer toI420()

      从接口复制的说明: `VideoFrame.Buffer`
      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.
      指定者:
        `toI420` 在接口中 `VideoFrame.Buffer`

    - #### retain

          public void retain()

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

    - #### release

          public void release()

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

    - #### cropAndScale

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

      从接口复制的说明: `VideoFrame.Buffer`
      Crops a region defined by |cropx|, |cropY|, |cropWidth| and |cropHeight|. Scales it to size |scaleWidth| x |scaleHeight|.
      指定者:
        `cropAndScale` 在接口中 `VideoFrame.Buffer`