java.lang.Object | |||
↳ | com.amazonaws.ivs.broadcast.Device | ||
↳ | com.amazonaws.ivs.broadcast.ImageDevice | ||
↳ | com.amazonaws.ivs.broadcast.SurfaceSource |
Known Direct Subclasses |
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()
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected TypedLambda<Boolean> | checkThread | ||||||||||
protected Context | context | ||||||||||
protected long | handle | ||||||||||
protected boolean | shouldRotateOnConfigurationChanges |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SurfaceSource(Context context, Surface inputSurface, SurfaceTexture inputSurfaceTexture, Handler handler, 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() | ||||||||||
synchronized void |
rotateOnConfigurationChanges(boolean enable)
Enables/disables rotations of this ImageDevice when the physical device is rotated.
| ||||||||||
synchronized void |
setRotation(float rotation)
Sets the rotation of the ImageDevice.
| ||||||||||
void |
setSize(int width, int height)
Set the size of the surface
| ||||||||||
synchronized boolean | willRotateOnConfigurationChanges() |
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
|
Retrieving this Surface can be done from any thread, but API calls on the Surface may not be thread safe.
Gets a ImagePreviewView
that will display a preview of this device's contents.
Warning: Using many ImagePreviewViews
at once may result in performance degradation.
Enables/disables rotations of this ImageDevice when the physical device is rotated. When this is enabled, the image source will be rotated to match configuration changes. This is often useful with camera devices, for example. When this is disabled, the image source will not be rotated to match configuration changes. This is often useful for custom image sources or if the camera ought to be locked to a particular orientation to match the application.
enable | Whether this device should rotate on configuration changes (e.g. when the physical device is rotated). |
---|
Sets the rotation of the ImageDevice.
rotation | Rotation in radians |
---|
Set the size of the surface
width | width in pixels |
---|---|
height | height in pixels |