Package tvi.webrtc

Class RendererCommon


  • public class RendererCommon
    extends java.lang.Object
    Static helper functions for renderer implementations.
    • Constructor Summary

      Constructors 
      Constructor Description
      RendererCommon()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static float[] convertMatrixFromAndroidGraphicsMatrix​(android.graphics.Matrix matrix)
      Converts android.graphics.Matrix to a float[16] matrix array.
      static android.graphics.Matrix convertMatrixToAndroidGraphicsMatrix​(float[] matrix4x4)
      Converts a float[16] matrix array to android.graphics.Matrix.
      static android.graphics.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 android.graphics.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RendererCommon

        public RendererCommon()
    • Method Detail

      • 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

        public static android.graphics.Matrix convertMatrixToAndroidGraphicsMatrix​(float[] matrix4x4)
        Converts a float[16] matrix array to android.graphics.Matrix.
      • convertMatrixFromAndroidGraphicsMatrix

        public static float[] convertMatrixFromAndroidGraphicsMatrix​(android.graphics.Matrix matrix)
        Converts android.graphics.Matrix to a float[16] matrix array.
      • getDisplaySize

        public static android.graphics.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 android.graphics.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.