public class WOWZCamera
extends java.lang.Object
WOWZCameraView.getDeviceCameras()
method to retrieve a list of all cameras.Modifier and Type | Field and Description |
---|---|
static int |
DIRECTION_BACK
An identifier for a back-facing camera returned by
getDirection() . |
static int |
DIRECTION_FRONT
An identifier for a front-facing camera returned by
getDirection() . |
static int |
DIRECTION_INDETERMINATE
An identifier for a camera with an indeterminate direction or where direction is not applicable.
|
static int |
FOCUS_MODE_AUTO
An identifier used with the
hasCapability(int) method to detect support for auto focus. |
static int |
FOCUS_MODE_CONTINUOUS
An identifier used with the
hasCapability(int) method to detect support for continuous video focus. |
static int |
FOCUS_MODE_OFF
An identifier used with the
setFramerate(int) method to turn off all focus modes. |
static int |
TORCH
An identifier used with the
hasCapability(int) method to detect the presence of a flash. |
Modifier and Type | Method and Description |
---|---|
void |
continuePreview() |
static java.lang.String |
directionString(int direction) |
static WOWZCamera[] |
getAvailableDeviceCameras()
Gets an array of
WOWZCamera object instances for each camera detected and accessible on the current device. |
int |
getCameraId()
Gets an ID for the camera, unique to each camera on the device.
|
static java.lang.String |
getCameraInfo()
Gets a human-readable list of the cameras detected and the capabilities of each.
|
static WOWZCamera[] |
getDeviceCameras()
Gets an array of
WOWZCamera object instances for each camera detected on the current device. |
static WOWZCamera[] |
getDeviceCameras(boolean availableOnly)
Gets an array of
WOWZCamera object instances for each camera detected, and optionally accessible, on the current device. |
static WOWZCamera[] |
getDeviceCameras(boolean availableOnly,
boolean withCapabilities)
Gets an array of
WOWZCamera object instances for each camera detected, and optionally accessible, on the current device. |
int |
getDirection()
Gets the direction the camera is facing.
|
int |
getFocusMode()
Gets the camera's active focus mode.
|
int |
getFramerate()
Gets the current frame rate for the camera.
|
WOWZSize |
getFrameSize()
Gets the active or most recent preview frame size used by the preview display.
|
WOWZError |
getLastError() |
static int |
getNumberOfDeviceCameras()
Gets the number of cameras detected on the current device.
|
WOWZSize |
getOptimalPreviewSize(WOWZSize requestedSize)
Gets the best frame size supported by the device for previewing video with the specified frame size.
|
WOWZSize |
getOptimalPreviewSize(WOWZSize requestedSize,
WOWZSize minimumSize)
Gets the best frame size supported by the device for previewing video with the specified frame size that is equal to or larger than the specified minimum size.
|
Camera |
getPlatformDevice()
Gets the interface to the native platform's camera interface.
|
WOWZSize |
getPreferredVideoFrameSize()
Gets the device's preferred video frame size.
|
WOWZStatus |
getStatus() |
WOWZMediaConfig[] |
getSupportedConfigs()
Generates an array of configuration instances representing the preview frame sizes supported by this camera device.
|
WOWZSize[] |
getSupportedFrameSizes()
Gets a list of preview frame sizes supported by the camera.
|
SurfaceTexture |
getSurfaceTexture()
Gets the surface texture used as the output for the camera's preview.
|
boolean |
hasCapability(int capabilityId)
Shows whether a device has a flash, auto focus mode, or continue focus mode.
|
boolean |
isAvailable()
Checks whether the camera can be opened by the current application.
|
boolean |
isBack()
Checks whether the camera is back facing.
|
boolean |
isDirectional()
Checks whether the camera is front or back facing.
|
boolean |
isFront()
Checks whether the camera is front facing.
|
boolean |
isPreviewing()
Checks whether this camera's output is being actively being displayed.
|
boolean |
isTorchOn()
Checks whether the camera's flash is on.
|
boolean |
open() |
void |
pausePreview() |
void |
release()
AVAILABLE ONLY FOR OPEN CAMERAS
|
void |
setFocusMode(int focusMode)
Sets the camera's active focus mode.
|
void |
setFocusPoint(float x,
float y,
int focusAreaSize)
Turns on auto focus mode and sets the focus point to the screen coordinate x, y.
|
int |
setFramerate(int framerate) |
WOWZSize |
setFrameSize(WOWZSize requestedFrameSize) |
boolean |
setSurfaceTexture(SurfaceTexture surfaceTexture)
Sets the surface texture used as the output for the camera's preview.
|
void |
setTorchOn(boolean torchOn)
Turns on the camera's flash (torch).
|
static WOWZSize |
sizeToWzSize(Camera.Size cameraSize)
Converts an instance of Android's Camera.Size to an instance of GoCoder SDK's WOWZSize.
|
boolean |
startPreview(Context context,
WOWZSize previewFrameSize,
int framerate) |
boolean |
startPreview(Context context,
WOWZSize previewFrameSize,
WOWZSize minimumFrameSize,
int framerate) |
void |
stopPreview()
AVAILABLE ONLY FOR CAMERAS WHOSE PREVIEW IS ACTIVE
|
WOWZDataMap |
toDataMap() |
java.lang.String |
toString() |
RectF |
toViewCoords(View view,
Rect cameraRect)
Converts camera coordinates to coordinates for the specified view.
|
public static final int DIRECTION_FRONT
getDirection()
.public static final int DIRECTION_BACK
getDirection()
.public static final int DIRECTION_INDETERMINATE
public static final int TORCH
hasCapability(int)
method to detect the presence of a flash.public static final int FOCUS_MODE_AUTO
hasCapability(int)
method to detect support for auto focus.public static final int FOCUS_MODE_CONTINUOUS
hasCapability(int)
method to detect support for continuous video focus.public static final int FOCUS_MODE_OFF
setFramerate(int)
method to turn off all focus modes.public static java.lang.String directionString(int direction)
public static int getNumberOfDeviceCameras()
public static WOWZCamera[] getDeviceCameras(boolean availableOnly, boolean withCapabilities)
WOWZCamera
object instances for each camera detected, and optionally accessible, on the current device.availableOnly
- If true, the returned array contains instances for only those cameras that could be
successfully accessed.withCapabilities
- If true, queries the camera for its full set of features. This is ordinarily only done
the first time the camera is opened for preview. Doing so here can cause performance issues when starting the camera preview.WOWZCamera
object instances.public static WOWZCamera[] getDeviceCameras(boolean availableOnly)
WOWZCamera
object instances for each camera detected, and optionally accessible, on the current device.availableOnly
- If true, the returned array contains instances for only those camera that could be
successfully accessed.WOWZCamera
object instances.public static WOWZCamera[] getDeviceCameras()
WOWZCamera
object instances for each camera detected on the current device.WOWZCamera
object instances.for details on the the camera interface.
public static WOWZCamera[] getAvailableDeviceCameras()
WOWZCamera
object instances for each camera detected and accessible on the current device.WOWZCamera
object instances.for details on the the camera interface.
public static java.lang.String getCameraInfo()
public static WOWZSize sizeToWzSize(Camera.Size cameraSize)
cameraSize
- An instance of Android's Camera.Size.public int getCameraId()
public WOWZStatus getStatus()
public WOWZError getLastError()
public Camera getPlatformDevice()
public boolean isAvailable()
public boolean isDirectional()
public int getDirection()
DIRECTION_FRONT
, WOWZCamera##DIRECTION_FRONT
, or WOWZCamera##DIRECTION_INDETERMINATE
.public boolean isFront()
public boolean isBack()
public boolean isPreviewing()
public SurfaceTexture getSurfaceTexture()
public boolean setSurfaceTexture(SurfaceTexture surfaceTexture)
surfaceTexture
- The surface texture to use as the output for the camera's preview.public WOWZSize[] getSupportedFrameSizes()
public WOWZMediaConfig[] getSupportedConfigs()
public WOWZSize getPreferredVideoFrameSize()
public WOWZSize getOptimalPreviewSize(WOWZSize requestedSize)
requestedSize
- The requested frame size for display.public WOWZSize getOptimalPreviewSize(WOWZSize requestedSize, WOWZSize minimumSize)
requestedSize
- The requested frame size for display.minimumSize
- The minimum frame size to be considered.public boolean hasCapability(int capabilityId)
capabilityId
- A specifier indicating the capability, either TORCH
, FOCUS_MODE_AUTO
, or FOCUS_MODE_CONTINUOUS
.public boolean open()
public boolean startPreview(Context context, WOWZSize previewFrameSize, int framerate)
public boolean startPreview(Context context, WOWZSize previewFrameSize, WOWZSize minimumFrameSize, int framerate)
public void release()
public WOWZSize getFrameSize()
public void stopPreview()
public void pausePreview()
public void continuePreview()
public int getFramerate()
public int setFramerate(int framerate)
public boolean isTorchOn()
public void setTorchOn(boolean torchOn)
torchOn
- True to turn on the flash; false to turn it off.public int getFocusMode()
FOCUS_MODE_OFF
, FOCUS_MODE_AUTO
, or FOCUS_MODE_CONTINUOUS
.public void setFocusMode(int focusMode)
focusMode
- FOCUS_MODE_OFF
or FOCUS_MODE_CONTINUOUS
.public void setFocusPoint(float x, float y, int focusAreaSize)
x
- The x position of the focus point on the display screen.y
- The y position of the focus point on the display screen.public RectF toViewCoords(View view, Rect cameraRect)
view
- The view to map.cameraRect
- A rectangle in camera coordinates.public java.lang.String toString()
toString
in class java.lang.Object
public WOWZDataMap toDataMap()
© 2016 - 2018 Wowza Media Systems, LLC. All rights reserved. Terms | Privacy | Trademarks | Legal