Package com.amazonaws.ivs.broadcast
Class ImageDevice
- java.lang.Object
-
- com.amazonaws.ivs.broadcast.Device
-
- com.amazonaws.ivs.broadcast.ImageDevice
-
- Direct Known Subclasses:
SurfaceSource
public abstract class ImageDevice extends Device
Image and video input sources must conform to this interface
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ImageDevice.FrameCallback
static class
ImageDevice.Rotation
Utility enum that defines common rotations by degree in radians.-
Nested classes/interfaces inherited from class com.amazonaws.ivs.broadcast.Device
Device.Descriptor
-
-
Constructor Summary
Constructors Constructor Description ImageDevice()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ImagePreviewSurfaceTarget
getPreviewSurfaceTarget()
Gets aImagePreviewSurfaceTarget
that will display a preview of this device's contents.abstract ImagePreviewSurfaceTarget
getPreviewSurfaceTarget(BroadcastConfiguration.AspectMode aspectMode)
ImagePreviewSurfaceView
getPreviewSurfaceView()
Gets aImagePreviewSurfaceView
that will display a preview of this device's contents.abstract ImagePreviewSurfaceView
getPreviewSurfaceView(BroadcastConfiguration.AspectMode aspectMode)
ImagePreviewView
getPreviewTextureView()
Gets aImagePreviewView
that will display a preview of this device's contents.abstract ImagePreviewView
getPreviewTextureView(BroadcastConfiguration.AspectMode aspectMode)
ImagePreviewView
getPreviewView()
Gets aImagePreviewView
that will display a preview of this device's contents.ImagePreviewView
getPreviewView(BroadcastConfiguration.AspectMode aspectMode)
abstract void
rotateOnConfigurationChanges(boolean enable)
Enables/disables rotations of this ImageDevice when the physical device is rotated.abstract void
setOnFrameCallback(ImageDevice.FrameCallback callback)
Set a callback to receive information about image frames as they move through this device.abstract void
setRotation(float rotation)
Sets the rotation of the ImageDevice.void
setRotation(ImageDevice.Rotation rotation)
Sets the rotation of the ImageDevice.abstract boolean
willRotateOnConfigurationChanges()
-
Methods inherited from class com.amazonaws.ivs.broadcast.Device
getDescriptor, getTag, isValid
-
-
-
-
Method Detail
-
setRotation
public abstract void setRotation(float rotation)
Sets the rotation of the ImageDevice.- Parameters:
rotation
- Rotation in radians
-
setRotation
public void setRotation(ImageDevice.Rotation rotation)
Sets the rotation of the ImageDevice.- Parameters:
rotation
- Rotation enum
-
getPreviewView
public ImagePreviewView getPreviewView()
Gets aImagePreviewView
that will display a preview of this device's contents. Warning: Using manyImagePreviewViews
at once may result in performance degradation. Please usegetPreviewSurfaceView()
if you can, it has better performance- Throws:
BroadcastException
- If unable to get preview view.
-
getPreviewTextureView
public ImagePreviewView getPreviewTextureView()
Gets aImagePreviewView
that will display a preview of this device's contents. Warning: Using many previews at once may result in performance degradation. Please usegetPreviewSurfaceView()
if you can, it has better performance- Throws:
BroadcastException
- If unable to get preview view.
-
getPreviewSurfaceView
public ImagePreviewSurfaceView getPreviewSurfaceView()
Gets aImagePreviewSurfaceView
that will display a preview of this device's contents. Warning: Using many previews at once may result in performance degradation.- Throws:
BroadcastException
- If unable to get preview view.
-
getPreviewSurfaceTarget
public ImagePreviewSurfaceTarget getPreviewSurfaceTarget()
Gets aImagePreviewSurfaceTarget
that will display a preview of this device's contents. Warning: Using many previews at once may result in performance degradation.- Throws:
BroadcastException
- If unable to get preview view.
-
rotateOnConfigurationChanges
public abstract void rotateOnConfigurationChanges(boolean enable)
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.- Parameters:
enable
- Whether this device should rotate on configuration changes (e.g. when the physical device is rotated).
-
willRotateOnConfigurationChanges
public abstract boolean willRotateOnConfigurationChanges()
- Returns:
- Whether this ImageDevice will rotate on configuration changes.
-
getPreviewView
public ImagePreviewView getPreviewView(BroadcastConfiguration.AspectMode aspectMode)
-
getPreviewTextureView
public abstract ImagePreviewView getPreviewTextureView(BroadcastConfiguration.AspectMode aspectMode)
-
getPreviewSurfaceView
public abstract ImagePreviewSurfaceView getPreviewSurfaceView(BroadcastConfiguration.AspectMode aspectMode)
-
getPreviewSurfaceTarget
public abstract ImagePreviewSurfaceTarget getPreviewSurfaceTarget(BroadcastConfiguration.AspectMode aspectMode)
-
setOnFrameCallback
public abstract void setOnFrameCallback(@Nullable ImageDevice.FrameCallback callback)
Set a callback to receive information about image frames as they move through this device. This will be called on the main thread.- Parameters:
callback
- A callback lambda that takes aImageDeviceFrame
.
-
-