VideoFrame

tee3.webrtc

## 类 VideoFrame

- java.lang.Object
- - tee3.webrtc.VideoFrame

- 所有已实现的接口:
    RefCounted

      public class VideoFrame
      extends java.lang.Object
      implements RefCounted

  Java version of webrtc::VideoFrame and webrtc::VideoFrameBuffer. A difference from the C++ version is that no explicit tag is used, and clients are expected to use 'instanceof' to find the right subclass of the buffer. This allows clients to create custom VideoFrame.Buffer in arbitrary format in their custom VideoSources, and then cast it back to the correct subclass in their custom VideoSinks. All implementations must also implement the toI420() function, converting from the underlying representation if necessary. I420 is the most widely accepted format and serves as a fallback for video sinks that can only handle I420, e.g. the internal WebRTC software encoders.

- - ### 嵌套类概要

    嵌套类
    限定符和类型 | 类和说明
    --- | ---
    `static interface` | `VideoFrame.Buffer` Implements image storage medium.
    `static interface` | `VideoFrame.I420Buffer` Interface for I420 buffers.
    `static interface` | `VideoFrame.TextureBuffer` Interface for buffers that are stored as a single texture, either in OES or RGB format.

  - ### 构造器概要

    构造器
    构造器和说明
    `VideoFrame(VideoFrame.Buffer buffer, int rotation, long timestampNs)` Constructs a new VideoFrame backed by the given `buffer`.

  - ### 方法概要

    所有方法 静态方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `static VideoFrame.Buffer` | `cropAndScaleI420(VideoFrame.I420Buffer buffer, int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight)`
    `VideoFrame.Buffer` | `getBuffer()`
    `int` | `getRotatedHeight()`
    `int` | `getRotatedWidth()`
    `int` | `getRotation()` Rotation of the frame in degrees.
    `long` | `getTimestampNs()` Timestamp of the frame in nano seconds.
    `void` | `release()` Decreases ref count by one.
    `void` | `retain()` Increases ref count by one.

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

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

- - ### 构造器详细资料

    - #### VideoFrame

          public VideoFrame(VideoFrame.Buffer buffer,
                            int rotation,
                            long timestampNs)

      Constructs a new VideoFrame backed by the given `buffer`.

  - ### 方法详细资料

    - #### getBuffer

          public VideoFrame.Buffer getBuffer()

    - #### getRotation

          public int getRotation()

      Rotation of the frame in degrees.

    - #### getTimestampNs

          public long getTimestampNs()

      Timestamp of the frame in nano seconds.

    - #### getRotatedWidth

          public int getRotatedWidth()

    - #### getRotatedHeight

          public int getRotatedHeight()

    - #### retain

          public void retain()

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

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

    - #### cropAndScaleI420

          public static VideoFrame.Buffer cropAndScaleI420(VideoFrame.I420Buffer buffer,
                                                           int cropX,
                                                           int cropY,
                                                           int cropWidth,
                                                           int cropHeight,
                                                           int scaleWidth,
                                                           int scaleHeight)