Package com.telnyx.webrtc.lib
Class RendererCommon
java.lang.Object
com.telnyx.webrtc.lib.RendererCommon
Static helper functions for renderer implementations.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Interface for rendering frames on an EGLSurface with specified viewport location.static interface
Interface for reporting rendering events.static enum
static class
Helper class for determining layout size based on layout requirements, scaling type, and video aspect ratio. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic float[]
Converts android.graphics.Matrix to a float[16] matrix array.static Matrix
convertMatrixToAndroidGraphicsMatrix
(float[] matrix4x4) Converts a float[16] matrix array to android.graphics.Matrix.static Point
getDisplaySize
(float minVisibleFraction, float videoAspectRatio, int maxDisplayWidth, int maxDisplayHeight) Calculate display size based on minimum fraction of the video that must remain visible, video aspect ratio, and maximum display size.static Point
getDisplaySize
(RendererCommon.ScalingType scalingType, float videoAspectRatio, int maxDisplayWidth, int maxDisplayHeight) Calculate display size based on scaling type, video aspect ratio, and maximum display size.static float[]
getLayoutMatrix
(boolean mirror, float videoAspectRatio, float displayAspectRatio) Returns layout transformation matrix that applies an optional mirror effect and compensates for video vs display aspect ratio.
-
Constructor Details
-
RendererCommon
public RendererCommon()
-
-
Method Details
-
getLayoutMatrix
public static float[] getLayoutMatrix(boolean mirror, float videoAspectRatio, float displayAspectRatio) Returns layout transformation matrix that applies an optional mirror effect and compensates for video vs display aspect ratio. -
convertMatrixToAndroidGraphicsMatrix
Converts a float[16] matrix array to android.graphics.Matrix. -
convertMatrixFromAndroidGraphicsMatrix
Converts android.graphics.Matrix to a float[16] matrix array. -
getDisplaySize
public static Point getDisplaySize(RendererCommon.ScalingType scalingType, float videoAspectRatio, int maxDisplayWidth, int maxDisplayHeight) Calculate display size based on scaling type, video aspect ratio, and maximum display size. -
getDisplaySize
public static Point getDisplaySize(float minVisibleFraction, float videoAspectRatio, int maxDisplayWidth, int maxDisplayHeight) Calculate display size based on minimum fraction of the video that must remain visible, video aspect ratio, and maximum display size.
-