VideoEncoder

tee3.webrtc

## 接口 VideoEncoder

- 所有已知实现类:
    VideoEncoderFallback

      public interface VideoEncoder

  Interface for a video encoder that can be used with WebRTC. All calls will be made on the encoding thread. The encoder may be constructed on a different thread and changing thread after calling release is allowed.

- - ### 嵌套类概要

    嵌套类
    限定符和类型 | 接口和说明
    --- | ---
    `static class` | `VideoEncoder.BitrateAllocation` Represents bitrate allocated for an encoder to produce frames.
    `static interface` | `VideoEncoder.Callback`
    `static class` | `VideoEncoder.CodecSpecificInfo` Codec specific information about the encoded frame.
    `static class` | `VideoEncoder.CodecSpecificInfoH264`
    `static class` | `VideoEncoder.CodecSpecificInfoVP8`
    `static class` | `VideoEncoder.CodecSpecificInfoVP9`
    `static class` | `VideoEncoder.EncodeInfo` Additional info for encoding.
    `static class` | `VideoEncoder.ScalingSettings` Settings for WebRTC quality based scaling.
    `static class` | `VideoEncoder.Settings` Settings passed to the encoder by WebRTC.

  - ### 方法概要

    所有方法 实例方法 抽象方法
    限定符和类型 | 方法和说明
    --- | ---
    `VideoCodecStatus` | `encode(VideoFrame frame, VideoEncoder.EncodeInfo info)` Requests the encoder to encode a frame.
    `java.lang.String` | `getImplementationName()` Should return a descriptive name for the implementation.
    `VideoEncoder.ScalingSettings` | `getScalingSettings()` Any encoder that wants to use WebRTC provided quality scaler must implement this method.
    `VideoCodecStatus` | `initEncode(VideoEncoder.Settings settings, VideoEncoder.Callback encodeCallback)` Initializes the encoding process.
    `VideoCodecStatus` | `release()` Releases the encoder.
    `VideoCodecStatus` | `setChannelParameters(short packetLoss, long roundTripTimeMs)` Informs the encoder of the packet loss and the round-trip time of the network.
    `VideoCodecStatus` | `setRateAllocation(VideoEncoder.BitrateAllocation allocation, int framerate)` Sets the bitrate allocation and the target framerate for the encoder.

- - ### 方法详细资料

    - #### initEncode

          VideoCodecStatus initEncode(VideoEncoder.Settings settings,
                                      VideoEncoder.Callback encodeCallback)

      Initializes the encoding process. Call before any calls to encode.

    - #### release

          VideoCodecStatus release()

      Releases the encoder. No more calls to encode will be made after this call.

    - #### encode

          VideoCodecStatus encode(VideoFrame frame,
                                  VideoEncoder.EncodeInfo info)

      Requests the encoder to encode a frame.

    - #### setChannelParameters

          VideoCodecStatus setChannelParameters(short packetLoss,
                                                long roundTripTimeMs)

      Informs the encoder of the packet loss and the round-trip time of the network.
      参数:
        `packetLoss` - How many packets are lost on average per 255 packets.
        `roundTripTimeMs` - Round-trip time of the network in milliseconds.

    - #### setRateAllocation

          VideoCodecStatus setRateAllocation(VideoEncoder.BitrateAllocation allocation,
                                             int framerate)

      Sets the bitrate allocation and the target framerate for the encoder.

    - #### getScalingSettings

          VideoEncoder.ScalingSettings getScalingSettings()

      Any encoder that wants to use WebRTC provided quality scaler must implement this method.

    - #### getImplementationName

          java.lang.String getImplementationName()

      Should return a descriptive name for the implementation. Gets called once and cached. May be called from arbitrary thread.