public class UVCCamera
extends java.lang.Object
Constructor and Description |
---|
UVCCamera()
the sonctructor of this class should be call within the thread that has a looper
(UI thread or a thread that called Looper.prepare)
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkSupportFlag(long flag) |
void |
close()
close and release UVC camera
|
void |
destroy()
destroy UVCCamera object
|
boolean |
getAutoFocus() |
boolean |
getAutoWhiteBlance() |
int |
getBrightness() |
int |
getBrightness(int brightness_abs) |
int |
getContrast() |
int |
getContrast(int contrast_abs) |
android.hardware.usb.UsbDevice |
getDevice() |
java.lang.String |
getDeviceName() |
int |
getFocus() |
int |
getFocus(int focus_abs) |
int |
getGain() |
int |
getGain(int gain_abs) |
int |
getGamma() |
int |
getGamma(int gamma_abs) |
int |
getHue() |
int |
getHue(int hue_abs) |
int |
getPowerlineFrequency() |
Size |
getPreviewSize() |
int |
getSaturation() |
int |
getSaturation(int saturation_abs) |
int |
getSharpness() |
int |
getSharpness(int sharpness_abs) |
java.lang.String |
getSupportedSize() |
static java.util.List<Size> |
getSupportedSize(int type,
java.lang.String supportedSize) |
java.util.List<Size> |
getSupportedSizeList() |
USBMonitor.UsbControlBlock |
getUsbControlBlock() |
int |
getWhiteBlance() |
int |
getWhiteBlance(int whiteBlance_abs) |
int |
getZoom() |
int |
getZoom(int zoom_abs) |
void |
open(USBMonitor.UsbControlBlock ctrlBlock)
connect to a UVC camera
USB permission is necessary before this method is called
|
void |
resetBrightness() |
void |
resetContrast() |
void |
resetFocus() |
void |
resetGain() |
void |
resetGamma() |
void |
resetHue() |
void |
resetSaturation() |
void |
resetSharpness() |
void |
resetWhiteBlance() |
void |
resetZoom() |
void |
setAutoFocus(boolean autoFocus) |
void |
setAutoWhiteBlance(boolean autoWhiteBlance) |
void |
setBrightness(int brightness) |
void |
setButtonCallback(IButtonCallback callback)
set button callback
|
void |
setContrast(int contrast) |
void |
setFocus(int focus) |
void |
setFrameCallback(IFrameCallback callback,
int pixelFormat)
set frame callback
|
void |
setGain(int gain) |
void |
setGamma(int gamma) |
void |
setHue(int hue) |
void |
setPowerlineFrequency(int frequency) |
void |
setPreviewDisplay(android.view.Surface surface)
set preview surface with Surface
|
void |
setPreviewDisplay(android.view.SurfaceHolder holder)
set preview surface with SurfaceHolder
you can use SurfaceHolder came from SurfaceView/GLSurfaceView
|
void |
setPreviewSize(int width,
int height)
Set preview size and preview mode
|
void |
setPreviewSize(int width,
int height,
int frameFormat)
Set preview size and preview mode
|
void |
setPreviewSize(int width,
int height,
int frameFormat,
float bandwidth)
Set preview size and preview mode
|
void |
setPreviewSize(int width,
int height,
int min_fps,
int max_fps,
int frameFormat,
float bandwidthFactor)
Set preview size and preview mode
|
void |
setPreviewTexture(android.graphics.SurfaceTexture texture)
set preview surface with SurfaceTexture.
|
void |
setSaturation(int saturation) |
void |
setSharpness(int sharpness) |
void |
setStatusCallback(IStatusCallback callback)
set status callback
|
void |
setWhiteBlance(int whiteBlance) |
void |
setZoom(int zoom)
this may not work well with some combination of camera and device
|
void |
startCapture(android.view.Surface surface)
start movie capturing(this should call while previewing)
|
void |
startPreview()
start preview
|
void |
stopCapture()
stop movie capturing
|
void |
stopPreview()
stop preview
|
void |
updateCameraParams() |
public static final int DEFAULT_PREVIEW_WIDTH
public static final int DEFAULT_PREVIEW_HEIGHT
public static final int DEFAULT_PREVIEW_MODE
public static final int DEFAULT_PREVIEW_MIN_FPS
public static final int DEFAULT_PREVIEW_MAX_FPS
public static final float DEFAULT_BANDWIDTH
public static final int FRAME_FORMAT_YUYV
public static final int FRAME_FORMAT_MJPEG
public static final int PIXEL_FORMAT_RAW
public static final int PIXEL_FORMAT_YUV
public static final int PIXEL_FORMAT_RGB565
public static final int PIXEL_FORMAT_RGBX
public static final int PIXEL_FORMAT_YUV420SP
public static final int PIXEL_FORMAT_NV21
public static final int CTRL_SCANNING
public static final int CTRL_AE
public static final int CTRL_AE_PRIORITY
public static final int CTRL_AE_ABS
public static final int CTRL_AR_REL
public static final int CTRL_FOCUS_ABS
public static final int CTRL_FOCUS_REL
public static final int CTRL_IRIS_ABS
public static final int CTRL_IRIS_REL
public static final int CTRL_ZOOM_ABS
public static final int CTRL_ZOOM_REL
public static final int CTRL_PANTILT_ABS
public static final int CTRL_PANTILT_REL
public static final int CTRL_ROLL_ABS
public static final int CTRL_ROLL_REL
public static final int CTRL_FOCUS_AUTO
public static final int CTRL_PRIVACY
public static final int CTRL_FOCUS_SIMPLE
public static final int CTRL_WINDOW
public static final int PU_BRIGHTNESS
public static final int PU_CONTRAST
public static final int PU_HUE
public static final int PU_SATURATION
public static final int PU_SHARPNESS
public static final int PU_GAMMA
public static final int PU_WB_TEMP
public static final int PU_WB_COMPO
public static final int PU_BACKLIGHT
public static final int PU_GAIN
public static final int PU_POWER_LF
public static final int PU_HUE_AUTO
public static final int PU_WB_TEMP_AUTO
public static final int PU_WB_COMPO_AUTO
public static final int PU_DIGITAL_MULT
public static final int PU_DIGITAL_LIMIT
public static final int PU_AVIDEO_STD
public static final int PU_AVIDEO_LOCK
public static final int PU_CONTRAST_AUTO
public static final int STATUS_CLASS_CONTROL
public static final int STATUS_CLASS_CONTROL_CAMERA
public static final int STATUS_CLASS_CONTROL_PROCESSING
public static final int STATUS_ATTRIBUTE_VALUE_CHANGE
public static final int STATUS_ATTRIBUTE_INFO_CHANGE
public static final int STATUS_ATTRIBUTE_FAILURE_CHANGE
public static final int STATUS_ATTRIBUTE_UNKNOWN
protected long mControlSupports
protected long mProcSupports
protected int mCurrentFrameFormat
protected int mCurrentWidth
protected int mCurrentHeight
protected float mCurrentBandwidthFactor
protected java.lang.String mSupportedSize
protected java.util.List<Size> mCurrentSizeList
protected long mNativePtr
protected int mScanningModeMin
protected int mScanningModeMax
protected int mScanningModeDef
protected int mExposureModeMin
protected int mExposureModeMax
protected int mExposureModeDef
protected int mExposurePriorityMin
protected int mExposurePriorityMax
protected int mExposurePriorityDef
protected int mExposureMin
protected int mExposureMax
protected int mExposureDef
protected int mAutoFocusMin
protected int mAutoFocusMax
protected int mAutoFocusDef
protected int mFocusMin
protected int mFocusMax
protected int mFocusDef
protected int mFocusRelMin
protected int mFocusRelMax
protected int mFocusRelDef
protected int mFocusSimpleMin
protected int mFocusSimpleMax
protected int mFocusSimpleDef
protected int mIrisMin
protected int mIrisMax
protected int mIrisDef
protected int mIrisRelMin
protected int mIrisRelMax
protected int mIrisRelDef
protected int mPanMin
protected int mPanMax
protected int mPanDef
protected int mTiltMin
protected int mTiltMax
protected int mTiltDef
protected int mRollMin
protected int mRollMax
protected int mRollDef
protected int mPanRelMin
protected int mPanRelMax
protected int mPanRelDef
protected int mTiltRelMin
protected int mTiltRelMax
protected int mTiltRelDef
protected int mRollRelMin
protected int mRollRelMax
protected int mRollRelDef
protected int mPrivacyMin
protected int mPrivacyMax
protected int mPrivacyDef
protected int mAutoWhiteBlanceMin
protected int mAutoWhiteBlanceMax
protected int mAutoWhiteBlanceDef
protected int mAutoWhiteBlanceCompoMin
protected int mAutoWhiteBlanceCompoMax
protected int mAutoWhiteBlanceCompoDef
protected int mWhiteBlanceMin
protected int mWhiteBlanceMax
protected int mWhiteBlanceDef
protected int mWhiteBlanceCompoMin
protected int mWhiteBlanceCompoMax
protected int mWhiteBlanceCompoDef
protected int mWhiteBlanceRelMin
protected int mWhiteBlanceRelMax
protected int mWhiteBlanceRelDef
protected int mBacklightCompMin
protected int mBacklightCompMax
protected int mBacklightCompDef
protected int mBrightnessMin
protected int mBrightnessMax
protected int mBrightnessDef
protected int mContrastMin
protected int mContrastMax
protected int mContrastDef
protected int mSharpnessMin
protected int mSharpnessMax
protected int mSharpnessDef
protected int mGainMin
protected int mGainMax
protected int mGainDef
protected int mGammaMin
protected int mGammaMax
protected int mGammaDef
protected int mSaturationMin
protected int mSaturationMax
protected int mSaturationDef
protected int mHueMin
protected int mHueMax
protected int mHueDef
protected int mZoomMin
protected int mZoomMax
protected int mZoomDef
protected int mZoomRelMin
protected int mZoomRelMax
protected int mZoomRelDef
protected int mPowerlineFrequencyMin
protected int mPowerlineFrequencyMax
protected int mPowerlineFrequencyDef
protected int mMultiplierMin
protected int mMultiplierMax
protected int mMultiplierDef
protected int mMultiplierLimitMin
protected int mMultiplierLimitMax
protected int mMultiplierLimitDef
protected int mAnalogVideoStandardMin
protected int mAnalogVideoStandardMax
protected int mAnalogVideoStandardDef
protected int mAnalogVideoLockStateMin
protected int mAnalogVideoLockStateMax
protected int mAnalogVideoLockStateDef
public UVCCamera()
public void open(USBMonitor.UsbControlBlock ctrlBlock)
ctrlBlock
- public void setStatusCallback(IStatusCallback callback)
callback
- public void setButtonCallback(IButtonCallback callback)
callback
- public void close()
public android.hardware.usb.UsbDevice getDevice()
public java.lang.String getDeviceName()
public USBMonitor.UsbControlBlock getUsbControlBlock()
public java.lang.String getSupportedSize()
public Size getPreviewSize()
public void setPreviewSize(int width, int height)
width
- height
- public void setPreviewSize(int width, int height, int frameFormat)
width
- height
- frameFormat
- either FRAME_FORMAT_YUYV(0) or FRAME_FORMAT_MJPEG(1)public void setPreviewSize(int width, int height, int frameFormat, float bandwidth)
width
- height
- frameFormat
- either FRAME_FORMAT_YUYV(0) or FRAME_FORMAT_MJPEG(1)bandwidth
- [0.0f,1.0f]public void setPreviewSize(int width, int height, int min_fps, int max_fps, int frameFormat, float bandwidthFactor)
width
- height
- min_fps
- max_fps
- frameFormat
- either FRAME_FORMAT_YUYV(0) or FRAME_FORMAT_MJPEG(1)bandwidthFactor
- public java.util.List<Size> getSupportedSizeList()
public static java.util.List<Size> getSupportedSize(int type, java.lang.String supportedSize)
public void setPreviewDisplay(android.view.SurfaceHolder holder)
holder
- public void setPreviewTexture(android.graphics.SurfaceTexture texture)
texture
- public void setPreviewDisplay(android.view.Surface surface)
surface
- public void setFrameCallback(IFrameCallback callback, int pixelFormat)
callback
- pixelFormat
- public void startPreview()
public void stopPreview()
public void destroy()
public boolean checkSupportFlag(long flag)
public void setAutoFocus(boolean autoFocus)
public boolean getAutoFocus()
public void setFocus(int focus)
focus
- [%]public int getFocus(int focus_abs)
focus_abs
- public int getFocus()
public void resetFocus()
public void setAutoWhiteBlance(boolean autoWhiteBlance)
public boolean getAutoWhiteBlance()
public void setWhiteBlance(int whiteBlance)
whiteBlance
- [%]public int getWhiteBlance(int whiteBlance_abs)
whiteBlance_abs
- public int getWhiteBlance()
public void resetWhiteBlance()
public void setBrightness(int brightness)
brightness
- [%]public int getBrightness(int brightness_abs)
brightness_abs
- public int getBrightness()
public void resetBrightness()
public void setContrast(int contrast)
contrast
- [%]public int getContrast(int contrast_abs)
contrast_abs
- public int getContrast()
public void resetContrast()
public void setSharpness(int sharpness)
sharpness
- [%]public int getSharpness(int sharpness_abs)
sharpness_abs
- public int getSharpness()
public void resetSharpness()
public void setGain(int gain)
gain
- [%]public int getGain(int gain_abs)
gain_abs
- public int getGain()
public void resetGain()
public void setGamma(int gamma)
gamma
- [%]public int getGamma(int gamma_abs)
gamma_abs
- public int getGamma()
public void resetGamma()
public void setSaturation(int saturation)
saturation
- [%]public int getSaturation(int saturation_abs)
saturation_abs
- public int getSaturation()
public void resetSaturation()
public void setHue(int hue)
hue
- [%]public int getHue(int hue_abs)
hue_abs
- public int getHue()
public void resetHue()
public void setPowerlineFrequency(int frequency)
public int getPowerlineFrequency()
public void setZoom(int zoom)
zoom
- [%]public int getZoom(int zoom_abs)
zoom_abs
- public int getZoom()
public void resetZoom()
public void updateCameraParams()
public void startCapture(android.view.Surface surface)
surface
- public void stopCapture()