本文整理了Java中android.hardware.Camera.release()
方法的一些代码示例,展示了Camera.release()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Camera.release()
方法的具体详情如下:
包路径:android.hardware.Camera
类名称:Camera
方法名:release
暂无
代码示例来源:origin: daniulive/SmarterStreaming
public void onClick(View v) {
if (mCamera != null) {
mCamera.stopPreview();
mCamera.release();
mCamera = null;
}
Intent intent = new Intent();
intent.setClass(CameraPublishActivity.this, RecorderManager.class);
intent.putExtra("RecoderDir", recDir);
startActivity(intent);
}
}
代码示例来源:origin: stackoverflow.com
SurfaceView preview = (SurfaceView) findViewById(R.id.PREVIEW);
SurfaceHolder mHolder = preview.getHolder();
mHolder.addCallback(this);
Camera mCamera = Camera.open();
mCamera.setPreviewDisplay(mHolder);
// Turn on LED
Parameters params = mCamera.getParameters();
params.setFlashMode(Parameters.FLASH_MODE_TORCH);
mCamera.setParameters(params);
mCamera.startPreview();
...
// Turn off LED
Parameters params = mCamera.getParameters();
params.setFlashMode(Parameters.FLASH_MODE_OFF);
mCamera.setParameters(params);
mCamera.stopPreview();
mCamera.release();
代码示例来源:origin: stackoverflow.com
myCamera.release(); // release the camera for other applications
myCamera = null;
mCamera.startPreview();
mCamera.startPreview();
} catch (IOException e) {
代码示例来源:origin: daniulive/SmarterStreaming
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
Log.i(TAG, "surfaceDestroyed");
mCamera.setPreviewCallback(null);
mCamera.stopPreview();
mCamera.release();
}
代码示例来源:origin: stackoverflow.com
Camera cam;
void ledon() {
cam = Camera.open();
Parameters params = cam.getParameters();
params.setFlashMode(Parameters.FLASH_MODE_ON);
cam.setParameters(params);
cam.startPreview();
cam.autoFocus(new AutoFocusCallback() {
public void onAutoFocus(boolean success, Camera camera) {
}
});
}
void ledoff() {
cam.stopPreview();
cam.release();
}
代码示例来源:origin: nekocode/CameraFilter
@Override
public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
if (camera != null) {
camera.stopPreview();
camera.release();
}
if (renderThread != null && renderThread.isAlive()) {
renderThread.interrupt();
}
CameraFilter.release();
return true;
}
代码示例来源:origin: stackoverflow.com
try {
mCamera.setPreviewDisplay(surfaceHolder);
mCamera.startPreview();
} catch (IOException e) {
mCamera.stopPreview();
mCamera.release();
mCamera.startPreview();
} catch (Exception e) {
代码示例来源:origin: daniulive/SmarterStreaming
private void switchCamera() throws IOException {
mCamera.setPreviewCallback(null);
mCamera.stopPreview();
mCamera.release();
if (currentCameraType == FRONT) {
mCamera = openCamera(BACK);
} else if (currentCameraType == BACK) {
mCamera = openCamera(FRONT);
}
initCamera(mSurfaceHolder);
}
代码示例来源:origin: stackoverflow.com
mCamera.stopPreview();
mCamera.release();
mCamera = null;
mCamera.setPreviewDisplay(holder);
} catch (IOException exception) {
mCamera.release();
mCamera = null;
public void surfaceChanged(SurfaceHolder holder, int format, int width,
int height) {
mCamera.startPreview();
代码示例来源:origin: daniulive/SmarterStreaming
private void switchCamera() throws IOException
{
pushCamera.setPreviewCallback(null);
pushCamera.stopPreview();
pushCamera.release();
if( pushCurrentCameraType == FRONT){
pushCamera = openCamera(BACK);
}else if(pushCurrentCameraType == BACK){
pushCamera = openCamera(FRONT);
}
initPushCamera(pushSurfaceHolder);
}
代码示例来源:origin: stackoverflow.com
camera.release();
camera = null;
camera.startPreview();
previewIsRunning = true;
camera.stopPreview();
previewIsRunning = false;
代码示例来源:origin: googlesamples/android-vision
mCamera.stopPreview();
mCamera.setPreviewCallbackWithBuffer(null);
try {
Log.e(TAG, "Failed to clear camera preview: " + e);
mCamera.release();
mCamera = null;
代码示例来源:origin: stackoverflow.com
camera.stopPreview();
camera.release();
camera = null;
isLightOn = false;
try {
camera.setParameters(param);
camera.startPreview();
isLightOn = true;
} catch (Exception e) {
代码示例来源:origin: googlesamples/android-vision
mCamera.stopPreview();
mCamera.setPreviewCallbackWithBuffer(null);
try {
Log.e(TAG, "Failed to clear camera preview: " + e);
mCamera.release();
mCamera = null;
代码示例来源:origin: stackoverflow.com
mCamera.startPreview();
mCamera.stopPreview();
mCamera.release();
return true;
代码示例来源:origin: googlesamples/android-vision
camera.stopPreview();
camera.setPreviewCallbackWithBuffer(null);
try {
Log.e(TAG, "Failed to clear camera preview: " + e);
camera.release();
camera = null;
代码示例来源:origin: daniulive/SmarterStreaming
mCamera.stopPreview();
mCamera.release();
mCamera = null;
mCamera.startPreview();
mCamera.autoFocus(myAutoFocusCallback);
mPreviewRunning = true;
代码示例来源:origin: stackoverflow.com
mrec.stop();
mrec.release();
mCamera.release();
mCamera.release(); // release the camera for other applications
mCamera = null;
mCamera.stopPreview();
mCamera.release();
代码示例来源:origin: daniulive/SmarterStreaming
pushCamera.stopPreview();
pushCamera.release();
pushCamera = null;
pushCamera.startPreview();
pushCamera.autoFocus(pushAutoFocusCallback);
pushPreviewRunning = true;
代码示例来源:origin: doggycoder/AndroidOpenGLDemo
@Override
public void onDestroy() {
if (mCamera != null) {
mCamera.stopPreview();
mCamera.release();
mCamera = null;
}
}
内容来源于网络,如有侵权,请联系作者删除!