本文整理了Java中android.hardware.Camera.lock()
方法的一些代码示例,展示了Camera.lock()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Camera.lock()
方法的具体详情如下:
包路径:android.hardware.Camera
类名称:Camera
方法名:lock
暂无
代码示例来源:origin: florent37/CameraFragment
@Override
protected void releaseVideoRecorder() {
super.releaseVideoRecorder();
try {
camera.lock(); // lock camera for later use
} catch (Exception ignore) {
}
}
代码示例来源:origin: guardianproject/haven
private void releaseMediaRecorder() {
if(mMediaRecorder != null){
mMediaRecorder.reset();
mMediaRecorder.release();
mMediaRecorder = null;
mCamera.lock();
}
}
}
代码示例来源:origin: stackoverflow.com
mCamera.lock(); // lock camera for later use
代码示例来源:origin: stackoverflow.com
mediaRecorder.release();
camera.lock();
camera.release();
代码示例来源:origin: florent37/CameraFragment
videoRecorder = new MediaRecorder();
try {
camera.lock();
camera.unlock();
videoRecorder.setCamera(camera);
代码示例来源:origin: stackoverflow.com
Camera camera = getCamera();
camera.stopPreview();
camera.lock();
camera.release();
camera = Camera.open();
camera.unlock();
代码示例来源:origin: guoxiaoxing/phoenix
@Override
protected void releaseVideoRecorder() {
super.releaseVideoRecorder();
try {
// lock camera for later use
camera.lock();
} catch (Exception ignore) {
}
}
代码示例来源:origin: guoxiaoxing/phoenix
mMediaRecorder = new MediaRecorder();
try {
camera.lock();
camera.unlock();
mMediaRecorder.setCamera(camera);
代码示例来源:origin: stackoverflow.com
myCamera.lock(); // lock camera for later use
代码示例来源:origin: lizhifeng-sky/VideoEdit
@Override
public void onPause() {
if (mCamera != null) mCamera.lock();
super.onPause();
}
代码示例来源:origin: lizhifeng-sky/VideoEdit
@Override
public void closeCamera() {
try {
if (mCamera != null) {
try {
mCamera.lock();
} catch (Throwable ignored) {
}
mCamera.release();
mCamera = null;
}
} catch (IllegalStateException e) {
throwError(new Exception("Illegal state while trying to close camera.", e));
}
}
代码示例来源:origin: FacePlusPlus/MegviiFacepp-Android-SDK
public void releaseMediaRecorder() {
if (mMediaRecorder != null) {
Log.w("ceshi", "mMediaRecorder.reset(");
// clear recorder configuration
mMediaRecorder.reset();
// release the recorder object
mMediaRecorder.release();
mMediaRecorder = null;
// Lock camera for later use i.e taking it back from MediaRecorder.
// MediaRecorder doesn't need it anymore and we will release it if
// the activity pauses.
mCamera.lock();
mCamera = null;
}
}
代码示例来源:origin: zhantong/AndroidCamera-TouchToFocusMeteringZoom
private void releaseMediaRecorder() {
if (mMediaRecorder != null) {
mMediaRecorder.reset();
mMediaRecorder.release();
mMediaRecorder = null;
mCamera.lock();
}
}
代码示例来源:origin: nglauber/dominando_android2
private void liberarMediaRecorder() {
if (mMediaRecorder != null) {
mMediaRecorder.reset();
mMediaRecorder.release();
mMediaRecorder = null;
mCamera.lock();
}
}
private void liberarCamera() {
代码示例来源:origin: OpenCVBlueprints/OpenCVBlueprints
private void releaseMediaRecorder() {
if(mMediaRecorder != null) {
mMediaRecorder.reset();
mMediaRecorder.release();
mMediaRecorder = null;
mCamera.lock();
}
}
代码示例来源:origin: googlesamples/android-MediaRecorder
private void releaseMediaRecorder(){
if (mMediaRecorder != null) {
// clear recorder configuration
mMediaRecorder.reset();
// release the recorder object
mMediaRecorder.release();
mMediaRecorder = null;
// Lock camera for later use i.e taking it back from MediaRecorder.
// MediaRecorder doesn't need it anymore and we will release it if the activity pauses.
mCamera.lock();
}
}
代码示例来源:origin: Yuphee/RecordVideo
private void releaseMediaRecorder(){
if (mMediaRecorder != null) {
mMediaRecorder.reset(); // clear recorder configuration
mMediaRecorder.release(); // release the recorder object
mMediaRecorder = null;
// 锁相机,4.0以后系统自动管理调用,但若录制器prepare()方法失败,必须调用
mCamera.lock(); // lock camera for later use
}
}
代码示例来源:origin: nglauber/dominando_android2
private void concluirGravacao() {
mMediaRecorder.stop();
liberarMediaRecorder();
mCamera.lock();
mGravando = false;
Intent it = new Intent();
it.setData(Uri.fromFile(mCaminhoArquivo));
setResult(RESULT_OK, it);
finish();
}
代码示例来源:origin: Tencent-YouTu/android_sdk
private void releaseMediaRecorder(){
if (mMediarecorder != null) {
// clear recorder configuration
mMediarecorder.reset();
// release the recorder object
mMediarecorder.release();
mMediarecorder = null;
// Lock camera for later use i.e taking it back from MediaRecorder.
// MediaRecorder doesn't need it anymore and we will release it if the activity pauses.
if (mCamera != null) {
mCamera.lock();
}
}
}
代码示例来源:origin: EzequielAdrianM/Camera2Vision
private void releaseMediaRecorder() {
if(mediaRecorder != null) {
mediaRecorder.stop();
mediaRecorder.reset();
mediaRecorder.release();
mediaRecorder = null;
mCamera.lock();
}
}
内容来源于网络,如有侵权,请联系作者删除!