public class WOWZBitmap extends java.lang.Object implements WOWZRenderAPI.VideoFrameRenderer
WOWZCameraView
by using
WOWZCameraView.registerFrameListener(WOWZRenderAPI.VideoFrameListener)
to register an instance as a frame listener.Modifier and Type | Field and Description |
---|---|
static int |
BOTTOM
A position specifier to use as the second argument of
setPosition(int, int) to align the bitmap along the bottom of the display. |
static int |
CENTER
A position specifier to use as either argument of
setPosition(int, int) to center the bitmap in the device display. |
static int |
CURRENT_SIZE
A scale specifier to use as the second argument of
setScale(float, int) to scale the bitmap as a factor of the current display size. |
static int |
FRAME_HEIGHT
A scale specifier to use as the second argument of
setScale(float, int) to scale the bitmap as a factor of the video frame height. |
static int |
FRAME_WIDTH
A scale specifier to use as the second argument of
setScale(float, int) to scale the bitmap as a factor of the video frame width. |
static int |
LEFT
A position specifier to use as the first argument of
setPosition(int, int) to align the bitmap along the left side of the display. |
static int |
ORIGINAL_SIZE
A scale specifier to use as the second argument of
setScale(float, int) to scale the bitmap as a factor of the source bitmap size. |
static int |
RIGHT
A position specifier to use as the first argument of
setPosition(int, int) to align the bitmap along the right side of the display. |
static int |
SURFACE_HEIGHT
Deprecated.
Use
FRAME_HEIGHT instead. |
static int |
SURFACE_WIDTH
Deprecated.
Use
FRAME_WIDTH instead. |
static int |
TOP
A position specifier to use as the second argument of
setPosition(int, int) to align the bitmap along the top of the display. |
Constructor and Description |
---|
WOWZBitmap()
The default constructor.
|
WOWZBitmap(Bitmap bitmap)
Creates a bitmap renderer instance using the specified bitmap.
|
Modifier and Type | Method and Description |
---|---|
WOWZSize |
getDisplaySize()
Gets the display size of the bitmap being rendered, accounting for any scale factors that have been applied.
|
WOWZPoint |
getPosition()
Gets the current position, in display pixels.
|
int |
getRotationAngle()
Gets the current rotation angle, from 0 degrees to 360 degrees.
|
float |
getScale()
Gets the scale factor applied by
ORIGINAL_SIZE (default), FRAME_WIDTH , FRAME_HEIGHT , or CURRENT_SIZE . |
int |
getScaleBasis()
Gets the method used to apply the scale factor.
|
WOWZSize |
getSourceSize()
Gets the original size of the bitmap being rendered.
|
boolean |
isVisible()
Checks whether the bitmap is being rendered (displayed).
|
boolean |
isWZVideoFrameRendererActive()
Checks whether the frame renderer is active.
|
void |
onWZVideoFrameRendererDraw(WOWZGLES.EglEnv eglEnv,
WOWZSize frameSize,
int frameRotation)
Called to render a frame of video to the viewport for the current OpenGL ES context.
|
void |
onWZVideoFrameRendererInit(WOWZGLES.EglEnv eglEnv)
Called at the beginning of a rendering cycle.
|
void |
onWZVideoFrameRendererRelease(WOWZGLES.EglEnv eglEnv)
Called at the end of a rendering cycle.
|
void |
setBitmap(Bitmap bitmap) |
void |
setHeight(int height)
Sets the bitmap's display height, in device pixels.
|
void |
setPosition(int xpos,
int ypos)
Sets the bitmap's display position, in display pixels.
|
void |
setPosition(WOWZPoint position)
Sets the bitmap's display position, in display pixels.
|
void |
setRotation(int angle)
Sets the bitmap's display rotation angle, from 0 degrees to 360 degrees.
|
void |
setScale(float scale)
Sets the bitmap's display scale factor based on the bitmap's original size.
|
void |
setScale(float scale,
int scaleBasis)
Sets the bitmap's display scale factor and scaling basis.
|
void |
setVisible(boolean isVisible)
Sets a flag indicating whether the bitmap should be rendered (displayed).
|
void |
setWidth(int width)
Sets the bitmap's display width, in device pixels.
|
public static final int CENTER
setPosition(int, int)
to center the bitmap in the device display.public static final int LEFT
setPosition(int, int)
to align the bitmap along the left side of the display.public static final int RIGHT
setPosition(int, int)
to align the bitmap along the right side of the display.public static final int TOP
setPosition(int, int)
to align the bitmap along the top of the display.public static final int BOTTOM
setPosition(int, int)
to align the bitmap along the bottom of the display.public static final int FRAME_WIDTH
setScale(float, int)
to scale the bitmap as a factor of the video frame width.public static final int FRAME_HEIGHT
setScale(float, int)
to scale the bitmap as a factor of the video frame height.public static final int SURFACE_WIDTH
FRAME_WIDTH
instead.public static final int SURFACE_HEIGHT
FRAME_HEIGHT
instead.public static final int ORIGINAL_SIZE
setScale(float, int)
to scale the bitmap as a factor of the source bitmap size.public static final int CURRENT_SIZE
setScale(float, int)
to scale the bitmap as a factor of the current display size.public WOWZBitmap()
public WOWZBitmap(Bitmap bitmap)
bitmap
- The bitmap you want to render.public void setBitmap(Bitmap bitmap)
public WOWZSize getSourceSize()
public WOWZSize getDisplaySize()
public int getScaleBasis()
ORIGINAL_SIZE
(default), FRAME_WIDTH
, FRAME_HEIGHT
, or CURRENT_SIZE
method.public float getScale()
ORIGINAL_SIZE
(default), FRAME_WIDTH
, FRAME_HEIGHT
, or CURRENT_SIZE
.public WOWZPoint getPosition()
public int getRotationAngle()
public void setWidth(int width)
width
- The display width.public void setHeight(int height)
height
- The display height.public void setScale(float scale)
scale
- The scale factor.public void setScale(float scale, int scaleBasis)
scale
- The scale factor.scaleBasis
- The FRAME_WIDTH
, FRAME_HEIGHT
, ORIGINAL_SIZE
, or CURRENT_SIZE
method.public void setPosition(WOWZPoint position)
position
- The display position.public void setPosition(int xpos, int ypos)
xpos
- The x position.ypos
- The y position.public void setRotation(int angle)
angle
- The display rotation angle.public void setVisible(boolean isVisible)
isVisible
- True if the bitmap should be rendered; false otherwise.public boolean isVisible()
public boolean isWZVideoFrameRendererActive()
WOWZRenderAPI.VideoFrameRenderer
WOWZRenderAPI.VideoFrameRenderer.onWZVideoFrameRendererDraw(WOWZGLES.EglEnv, WOWZSize, int)
will only be called on an active renderer.isWZVideoFrameRendererActive
in interface WOWZRenderAPI.VideoFrameRenderer
public void onWZVideoFrameRendererInit(WOWZGLES.EglEnv eglEnv)
WOWZRenderAPI.VideoFrameRenderer
onWZVideoFrameRendererInit
in interface WOWZRenderAPI.VideoFrameRenderer
eglEnv
- The current OpenGL ES environment, which may be a different EglEnv than the one supplied with
each call to WOWZRenderAPI.VideoFrameRenderer.onWZVideoFrameRendererDraw(WOWZGLES.EglEnv, WOWZSize, int)
. See for WOWZRenderAPI.VideoFrameRenderer.onWZVideoFrameRendererDraw(WOWZGLES.EglEnv, WOWZSize, int)
for details.public void onWZVideoFrameRendererDraw(WOWZGLES.EglEnv eglEnv, WOWZSize frameSize, int frameRotation)
WOWZRenderAPI.VideoFrameRenderer
WOWZRenderAPI.VideoFrameRenderer.onWZVideoFrameRendererInit(WOWZGLES.EglEnv)
and WOWZRenderAPI.VideoFrameRenderer.onWZVideoFrameRendererRelease(WOWZGLES.EglEnv eglEnv)
are shared contexts and can access the same EGL resources.onWZVideoFrameRendererDraw
in interface WOWZRenderAPI.VideoFrameRenderer
eglEnv
- The current OpenGL ES environment.frameSize
- The size of the video frame, in pixels.frameRotation
- The angle to apply when rendering, in degrees (usually 0).public void onWZVideoFrameRendererRelease(WOWZGLES.EglEnv eglEnv)
WOWZRenderAPI.VideoFrameRenderer
onWZVideoFrameRendererRelease
in interface WOWZRenderAPI.VideoFrameRenderer
eglEnv
- The current OpenGL ES environment.© 2016 - 2018 Wowza Media Systems, LLC. All rights reserved. Terms | Privacy | Trademarks | Legal