SurfaceEglRenderer

tee3.webrtc

## 类 SurfaceEglRenderer

- java.lang.Object
- - tee3.webrtc.EglRenderer
  - - tee3.webrtc.SurfaceEglRenderer

- 所有已实现的接口:
    android.view.SurfaceHolder.Callback, VideoRenderer.Callbacks, VideoSink

      public class SurfaceEglRenderer
      extends EglRenderer
      implements android.view.SurfaceHolder.Callback

  Display the video stream on a Surface. renderFrame() is asynchronous to avoid blocking the calling thread. This class is thread safe and handles access from potentially three different threads: Interaction from the main app in init, release and setMirror. Interaction from C++ rtc::VideoSinkInterface in renderFrame. Interaction from SurfaceHolder lifecycle in surfaceCreated, surfaceChanged, and surfaceDestroyed.

- - ### 嵌套类概要

    - ### 从类继承的嵌套类/接口 tee3.webrtc.EglRenderer

      `EglRenderer.FrameListener`

  - ### 字段概要

    - ### 从类继承的字段 tee3.webrtc.EglRenderer

      `name`

  - ### 构造器概要

    构造器
    构造器和说明
    `SurfaceEglRenderer(java.lang.String name)` In order to render something, you must first call init().

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `disableFpsReduction()`
    `void` | `init(EglBase.Context sharedContext, int[] configAttributes, RendererCommon.GlDrawer drawer)` Initialize this class, sharing resources with |sharedContext|.
    `void` | `init(EglBase.Context sharedContext, RendererCommon.RendererEvents rendererEvents, int[] configAttributes, RendererCommon.GlDrawer drawer)` Initialize this class, sharing resources with |sharedContext|.
    `void` | `onFrame(VideoFrame frame)` Implementations should call frame.retain() if they need to hold a reference to the frame after this function returns.
    `void` | `pauseVideo()`
    `void` | `setFpsReduction(float fps)` Limit render framerate.
    `void` | `surfaceChanged(android.view.SurfaceHolder holder, int format, int width, int height)`
    `void` | `surfaceCreated(android.view.SurfaceHolder holder)`
    `void` | `surfaceDestroyed(android.view.SurfaceHolder holder)`

    - ### 从类继承的方法 tee3.webrtc.EglRenderer

      `addFrameListener, addFrameListener, addFrameListener, clearImage, clearImage, createEglSurface, createEglSurface, invalidDrawFrame, printStackTrace, release, releaseEglSurface, removeFrameListener, renderFrame, setLayoutAspectRatio, setMirror`

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

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

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

    - #### SurfaceEglRenderer

          public SurfaceEglRenderer(java.lang.String name)

      In order to render something, you must first call init().

  - ### 方法详细资料

    - #### init

          public void init(EglBase.Context sharedContext,
                           RendererCommon.RendererEvents rendererEvents,
                           int[] configAttributes,
                           RendererCommon.GlDrawer drawer)

      Initialize this class, sharing resources with |sharedContext|. The custom |drawer| will be used for drawing frames on the EGLSurface. This class is responsible for calling release() on |drawer|. It is allowed to call init() to reinitialize the renderer after a previous init()/release() cycle.

    - #### init

          public void init(EglBase.Context sharedContext,
                           int[] configAttributes,
                           RendererCommon.GlDrawer drawer)

      从类复制的说明: `EglRenderer`
      Initialize this class, sharing resources with |sharedContext|. The custom |drawer| will be used for drawing frames on the EGLSurface. This class is responsible for calling release() on |drawer|. It is allowed to call init() to reinitialize the renderer after a previous init()/release() cycle.
      覆盖:
        `init` 在类中 `EglRenderer`

    - #### setFpsReduction

          public void setFpsReduction(float fps)

      Limit render framerate.
      覆盖:
        `setFpsReduction` 在类中 `EglRenderer`
      参数:
        `fps` - Limit render framerate to this value, or use Float.POSITIVE_INFINITY to disable fps reduction.

    - #### disableFpsReduction

          public void disableFpsReduction()

      覆盖:
        `disableFpsReduction` 在类中 `EglRenderer`

    - #### pauseVideo

          public void pauseVideo()

      覆盖:
        `pauseVideo` 在类中 `EglRenderer`

    - #### onFrame

          public void onFrame(VideoFrame frame)

      从接口复制的说明: `VideoSink`
      Implementations should call frame.retain() if they need to hold a reference to the frame after this function returns. Each call to retain() should be followed by a call to frame.release() when the reference is no longer needed.
      指定者:
        `onFrame` 在接口中 `VideoSink`
      覆盖:
        `onFrame` 在类中 `EglRenderer`

    - #### surfaceCreated

          public void surfaceCreated(android.view.SurfaceHolder holder)

      指定者:
        `surfaceCreated` 在接口中 `android.view.SurfaceHolder.Callback`

    - #### surfaceDestroyed

          public void surfaceDestroyed(android.view.SurfaceHolder holder)

      指定者:
        `surfaceDestroyed` 在接口中 `android.view.SurfaceHolder.Callback`

    - #### surfaceChanged

          public void surfaceChanged(android.view.SurfaceHolder holder,
                                     int format,
                                     int width,
                                     int height)

      指定者:
        `surfaceChanged` 在接口中 `android.view.SurfaceHolder.Callback`