Java Code Examples for org.webrtc.RendererCommon#GlDrawer

The following examples show how to use org.webrtc.RendererCommon#GlDrawer . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SurfaceTextureEglRenderer.java    From mollyim-android with GNU General Public License v3.0 5 votes vote down vote up
public void init(@Nullable EglBase.Context sharedContext, @Nullable RendererCommon.RendererEvents rendererEvents, @NonNull int[] configAttributes, @NonNull RendererCommon.GlDrawer drawer) {
  ThreadUtils.checkIsOnMainThread();
  this.rendererEvents = rendererEvents;
  synchronized (this.layoutLock) {
    this.isFirstFrameRendered = false;
    this.rotatedFrameWidth    = 0;
    this.rotatedFrameHeight   = 0;
    this.frameRotation        = 0;
  }

  super.init(sharedContext, configAttributes, drawer);
}
 
Example 2
Source File: TextureViewRenderer.java    From mollyim-android with GNU General Public License v3.0 5 votes vote down vote up
public void init(@NonNull EglBase.Context sharedContext, @NonNull RendererCommon.RendererEvents rendererEvents, @NonNull int[] configAttributes, @NonNull RendererCommon.GlDrawer drawer) {
  ThreadUtils.checkIsOnMainThread();

  this.rendererEvents     = rendererEvents;
  this.rotatedFrameWidth  = 0;
  this.rotatedFrameHeight = 0;

  this.eglRenderer.init(sharedContext, this, configAttributes, drawer);
}
 
Example 3
Source File: TextureViewRenderer.java    From VideoCRE with MIT License 5 votes vote down vote up
/**
 * 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.
 */
public void init(final EglBase.Context sharedContext,
    RendererCommon.RendererEvents rendererEvents, final int[] configAttributes,
    RendererCommon.GlDrawer drawer) {
  ThreadUtils.checkIsOnMainThread();
  this.rendererEvents = rendererEvents;
  synchronized (layoutLock) {
    isFirstFrameRendered = false;
    rotatedFrameWidth = 0;
    rotatedFrameHeight = 0;
    frameRotation = 0;
  }
  eglRenderer.init(sharedContext, configAttributes, drawer);
}
 
Example 4
Source File: SurfaceTextureEglRenderer.java    From mollyim-android with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void init(@Nullable EglBase.Context sharedContext, @NonNull int[] configAttributes, @NonNull RendererCommon.GlDrawer drawer) {
  this.init(sharedContext, null, configAttributes, drawer);
}
 
Example 5
Source File: TextureViewRenderer.java    From mollyim-android with GNU General Public License v3.0 4 votes vote down vote up
public void addFrameListener(@NonNull EglRenderer.FrameListener listener, float scale, @NonNull RendererCommon.GlDrawer drawerParam) {
  eglRenderer.addFrameListener(listener, scale, drawerParam);
}
 
Example 6
Source File: TextureViewRenderer.java    From VideoCRE with MIT License 2 votes vote down vote up
/**
 * Register a callback to be invoked when a new video frame has been received.
 *
 * @param listener The callback to be invoked. The callback will be invoked on the render thread.
 *                 It should be lightweight and must not call removeFrameListener.
 * @param scale    The scale of the Bitmap passed to the callback, or 0 if no Bitmap is
 *                 required.
 * @param drawer   Custom drawer to use for this frame listener.
 */
public void addFrameListener(
    EglRenderer.FrameListener listener, float scale, RendererCommon.GlDrawer drawerParam) {
  eglRenderer.addFrameListener(listener, scale, drawerParam);
}