public class

SurfaceSource

extends ImageDevice
java.lang.Object
   ↳ com.amazonaws.ivs.broadcast.Device
     ↳ com.amazonaws.ivs.broadcast.ImageDevice
       ↳ com.amazonaws.ivs.broadcast.SurfaceSource
Known Direct Subclasses

Class Overview

An image source backed by an Android Surface. This may be used with inputs such as a Camera2 producer, OpenGL ES or Vulkan, or a MediaProjection. See also createImageInputSource()

Summary

Fields
protected TypedLambda<Boolean> checkThread
protected Context context
protected long handle
Protected Constructors
SurfaceSource(Context context, Surface inputSurface, SurfaceTexture inputSurfaceTexture, String tag, long handle)
Public Methods
Device.Descriptor getDescriptor()
Surface getInputSurface()
Retrieving this Surface can be done from any thread, but API calls on the Surface may not be thread safe.
ImagePreviewView getPreviewView()
Gets a ImagePreviewView that will display a preview of this device's contents.
ImagePreviewView getPreviewView(BroadcastConfiguration.AspectMode aspectMode)
String getTag()
boolean isValid()
void setSize(int width, int height)
Set the size of the surface
Protected Methods
long getHandle()
[Expand]
Inherited Methods
From class com.amazonaws.ivs.broadcast.ImageDevice
From class com.amazonaws.ivs.broadcast.Device
From class java.lang.Object

Fields

protected TypedLambda<Boolean> checkThread

protected Context context

protected long handle

Protected Constructors

protected SurfaceSource (Context context, Surface inputSurface, SurfaceTexture inputSurfaceTexture, String tag, long handle)

Public Methods

public Device.Descriptor getDescriptor ()

public Surface getInputSurface ()

Retrieving this Surface can be done from any thread, but API calls on the Surface may not be thread safe.

Returns
  • The input surface to be attached to some image producer such as a camera or opengl context

public ImagePreviewView getPreviewView ()

Gets a ImagePreviewView that will display a preview of this device's contents. Warning: Using many ImagePreviewViews at once may result in performance degradation.

public ImagePreviewView getPreviewView (BroadcastConfiguration.AspectMode aspectMode)

public String getTag ()

public boolean isValid ()

public void setSize (int width, int height)

Set the size of the surface

Parameters
width width in pixels
height height in pixels

Protected Methods

protected long getHandle ()