amazon-chime-sdk / com.amazonaws.services.chime.sdk.meetings.audiovideo.video.gl / SurfaceRenderView

# SurfaceRenderView

`open class SurfaceRenderView : SurfaceView, Callback, EglVideoRenderView`

SurfaceRenderView is an implementation of EglVideoRenderView which uses EGL14 and OpenGLES2 to draw any incoming video buffer types to the surface provided by the inherited SurfaceView.

Note that since most SurfaceRenderView objects will not be constructed in code, builders must pass in the Logger directly before initialization by setting logger

### Constructors

#### <init> | SurfaceRenderView is an implementation of EglVideoRenderView which uses EGL14 and OpenGLES2 to draw any incoming video buffer types to the surface provided by the inherited SurfaceView. `SurfaceRenderView(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0)`

### Properties

#### hardwareScaling | Enables fixed size for the surface. This provides better performance but might be buggy on some devices, for example on Galaxy S9, EGL14.eglQuerySurface will not return update values until after the first EGL14.eglSwapBuffers call, and will lead to cropping or black boxing on resolution changes. By default this is turned off. `var hardwareScaling: Boolean`
#### logger | `var logger: Logger`
#### mirror | If true, rendered frames will be mirrored across the vertical axis `var mirror: Boolean`
#### scalingType | VideoScalingType used to render on this view. May impact cropping. `var scalingType: VideoScalingType`

### Functions

#### init | Initialize view with factory to create EglCore objects to hold/share EGL state `open fun init(eglCoreFactory: EglCoreFactory): Unit`
#### onLayout | `open fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int): Unit`
#### onMeasure | `open fun onMeasure(widthSpec: Int, heightSpec: Int): Unit`
#### onVideoFrameReceived | Receive a video frame from some upstream source. The VideoSink may render, store, process, and forward the frame, among other applications. `open fun onVideoFrameReceived(frame: VideoFrame): Unit`
#### release | Deallocate any state or resources held by this object `open fun release(): Unit`
#### surfaceChanged | `open fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int): Unit`
#### surfaceCreated | `open fun surfaceCreated(holder: SurfaceHolder): Unit`
#### surfaceDestroyed | `open fun surfaceDestroyed(holder: SurfaceHolder): Unit`

### Inheritors

#### DefaultVideoRenderView | `class DefaultVideoRenderView : SurfaceRenderView`