Package com.amazonaws.ivs.broadcast
Class ImagePreviewSurfaceTarget
- java.lang.Object
-
- com.amazonaws.ivs.broadcast.ImagePreviewSurfaceTarget
-
public class ImagePreviewSurfaceTarget extends java.lang.Object
A special kind of preview which is not an Android View. The application should supply an Android Surface throughsetSurface(Surface, int, int)
and clear throughclearSurface()
. Don't forget to callrelease()
when done.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearSurface()
Clears the surface, previews will not be rendered until {setSurface(Surface, int, int)
} is called againvoid
release()
Release this preview, after calling this method the preview is not valid anymore and you will need a new onevoid
setMirrored(boolean isMirrored)
Flips the preview horizontally.void
setSurface(android.view.Surface surface, int width, int height)
Specifies a new surface for rendering the preview
-
-
-
Method Detail
-
setMirrored
public void setMirrored(boolean isMirrored)
Flips the preview horizontally. This will betrue
by default for the front facing camera, andfalse
for everything else.- Parameters:
isMirrored
- Whether this view should be mirrored horizontally.- Throws:
java.lang.IllegalStateException
- If the preview has already been released.
-
setSurface
public void setSurface(@NonNull android.view.Surface surface, int width, int height)
Specifies a new surface for rendering the preview- Parameters:
surface
- An Android Surface to render towidth
- Surface widthheight
- Surface height- Throws:
java.lang.IllegalStateException
- If the preview has already been released.
-
clearSurface
public void clearSurface()
Clears the surface, previews will not be rendered until {setSurface(Surface, int, int)
} is called again- Throws:
java.lang.IllegalStateException
- If the preview has already been released.
-
release
public void release()
Release this preview, after calling this method the preview is not valid anymore and you will need a new one
-
-