@Override protected void setCameraPreviewSize(int width, int height) { Log.i(LOGTAG, "setCameraPreviewSize("+width+"x"+height+")"); if(mMaxCameraWidth > 0 && mMaxCameraWidth < width) width = mMaxCameraWidth; if(mMaxCameraHeight > 0 && mMaxCameraHeight < height) height = mMaxCameraHeight; try { mCameraOpenCloseLock.acquire(); boolean needReconfig = cacPreviewSize(width, height); mCameraWidth = mPreviewSize.getWidth(); mCameraHeight = mPreviewSize.getHeight(); if( !needReconfig ) { mCameraOpenCloseLock.release(); return; } if (null != mCaptureSession) { Log.d(LOGTAG, "closing existing previewSession"); mCaptureSession.close(); mCaptureSession = null; } mCameraOpenCloseLock.release(); createCameraPreviewSession(); } catch (InterruptedException e) { mCameraOpenCloseLock.release(); throw new RuntimeException("Interrupted while setCameraPreviewSize.", e); } } }
@Override protected void setCameraPreviewSize(int width, int height) { Log.i(LOGTAG, "setCameraPreviewSize("+width+"x"+height+")"); if(mMaxCameraWidth > 0 && mMaxCameraWidth < width) width = mMaxCameraWidth; if(mMaxCameraHeight > 0 && mMaxCameraHeight < height) height = mMaxCameraHeight; try { mCameraOpenCloseLock.acquire(); boolean needReconfig = cacPreviewSize(width, height); mCameraWidth = mPreviewSize.getWidth(); mCameraHeight = mPreviewSize.getHeight(); if( !needReconfig ) { mCameraOpenCloseLock.release(); return; } if (null != mCaptureSession) { Log.d(LOGTAG, "closing existing previewSession"); mCaptureSession.close(); mCaptureSession = null; } mCameraOpenCloseLock.release(); createCameraPreviewSession(); } catch (InterruptedException e) { mCameraOpenCloseLock.release(); throw new RuntimeException("Interrupted while setCameraPreviewSize.", e); } } }
@Override protected void setCameraPreviewSize(int width, int height) { Log.i(LOGTAG, "setCameraPreviewSize("+width+"x"+height+")"); if(mMaxCameraWidth > 0 && mMaxCameraWidth < width) width = mMaxCameraWidth; if(mMaxCameraHeight > 0 && mMaxCameraHeight < height) height = mMaxCameraHeight; try { mCameraOpenCloseLock.acquire(); boolean needReconfig = cacPreviewSize(width, height); mCameraWidth = mPreviewSize.getWidth(); mCameraHeight = mPreviewSize.getHeight(); if( !needReconfig ) { mCameraOpenCloseLock.release(); return; } if (null != mCaptureSession) { Log.d(LOGTAG, "closing existing previewSession"); mCaptureSession.close(); mCaptureSession = null; } mCameraOpenCloseLock.release(); createCameraPreviewSession(); } catch (InterruptedException e) { mCameraOpenCloseLock.release(); throw new RuntimeException("Interrupted while setCameraPreviewSize.", e); } } }
@Override protected void setCameraPreviewSize(int width, int height) { Log.i(LOGTAG, "setCameraPreviewSize("+width+"x"+height+")"); if(mMaxCameraWidth > 0 && mMaxCameraWidth < width) width = mMaxCameraWidth; if(mMaxCameraHeight > 0 && mMaxCameraHeight < height) height = mMaxCameraHeight; try { mCameraOpenCloseLock.acquire(); boolean needReconfig = cacPreviewSize(width, height); mCameraWidth = mPreviewSize.getWidth(); mCameraHeight = mPreviewSize.getHeight(); if( !needReconfig ) { mCameraOpenCloseLock.release(); return; } if (null != mCaptureSession) { Log.d(LOGTAG, "closing existing previewSession"); mCaptureSession.close(); mCaptureSession = null; } mCameraOpenCloseLock.release(); createCameraPreviewSession(); } catch (InterruptedException e) { mCameraOpenCloseLock.release(); throw new RuntimeException("Interrupted while setCameraPreviewSize.", e); } } }
@Override protected void setCameraPreviewSize(int width, int height) { Log.i(LOGTAG, "setCameraPreviewSize("+width+"x"+height+")"); if(mMaxCameraWidth > 0 && mMaxCameraWidth < width) width = mMaxCameraWidth; if(mMaxCameraHeight > 0 && mMaxCameraHeight < height) height = mMaxCameraHeight; try { mCameraOpenCloseLock.acquire(); boolean needReconfig = cacPreviewSize(width, height); mCameraWidth = mPreviewSize.getWidth(); mCameraHeight = mPreviewSize.getHeight(); if( !needReconfig ) { mCameraOpenCloseLock.release(); return; } if (null != mCaptureSession) { Log.d(LOGTAG, "closing existing previewSession"); mCaptureSession.close(); mCaptureSession = null; } mCameraOpenCloseLock.release(); createCameraPreviewSession(); } catch (InterruptedException e) { mCameraOpenCloseLock.release(); throw new RuntimeException("Interrupted while setCameraPreviewSize.", e); } } }
@Override protected void setCameraPreviewSize(int width, int height) { Log.i(LOGTAG, "setCameraPreviewSize("+width+"x"+height+")"); if(mMaxCameraWidth > 0 && mMaxCameraWidth < width) width = mMaxCameraWidth; if(mMaxCameraHeight > 0 && mMaxCameraHeight < height) height = mMaxCameraHeight; try { mCameraOpenCloseLock.acquire(); boolean needReconfig = cacPreviewSize(width, height); mCameraWidth = mPreviewSize.getWidth(); mCameraHeight = mPreviewSize.getHeight(); if( !needReconfig ) { mCameraOpenCloseLock.release(); return; } if (null != mCaptureSession) { Log.d(LOGTAG, "closing existing previewSession"); mCaptureSession.close(); mCaptureSession = null; } mCameraOpenCloseLock.release(); createCameraPreviewSession(); } catch (InterruptedException e) { mCameraOpenCloseLock.release(); throw new RuntimeException("Interrupted while setCameraPreviewSize.", e); } } }
@Override protected void setCameraPreviewSize(int width, int height) { Log.i(LOGTAG, "setCameraPreviewSize("+width+"x"+height+")"); if(mMaxCameraWidth > 0 && mMaxCameraWidth < width) width = mMaxCameraWidth; if(mMaxCameraHeight > 0 && mMaxCameraHeight < height) height = mMaxCameraHeight; try { mCameraOpenCloseLock.acquire(); boolean needReconfig = cacPreviewSize(width, height); mCameraWidth = mPreviewSize.getWidth(); mCameraHeight = mPreviewSize.getHeight(); if( !needReconfig ) { mCameraOpenCloseLock.release(); return; } if (null != mCaptureSession) { Log.d(LOGTAG, "closing existing previewSession"); mCaptureSession.close(); mCaptureSession = null; } mCameraOpenCloseLock.release(); createCameraPreviewSession(); } catch (InterruptedException e) { mCameraOpenCloseLock.release(); throw new RuntimeException("Interrupted while setCameraPreviewSize.", e); } } }
@Override protected void setCameraPreviewSize(int width, int height) { Log.i(LOGTAG, "setCameraPreviewSize("+width+"x"+height+")"); if(mMaxCameraWidth > 0 && mMaxCameraWidth < width) width = mMaxCameraWidth; if(mMaxCameraHeight > 0 && mMaxCameraHeight < height) height = mMaxCameraHeight; try { mCameraOpenCloseLock.acquire(); boolean needReconfig = cacPreviewSize(width, height); mCameraWidth = mPreviewSize.getWidth(); mCameraHeight = mPreviewSize.getHeight(); if( !needReconfig ) { mCameraOpenCloseLock.release(); return; } if (null != mCaptureSession) { Log.d(LOGTAG, "closing existing previewSession"); mCaptureSession.close(); mCaptureSession = null; } mCameraOpenCloseLock.release(); createCameraPreviewSession(); } catch (InterruptedException e) { mCameraOpenCloseLock.release(); throw new RuntimeException("Interrupted while setCameraPreviewSize.", e); } } }
@Override protected void setCameraPreviewSize(int width, int height) { Log.i(LOGTAG, "setCameraPreviewSize("+width+"x"+height+")"); if(mMaxCameraWidth > 0 && mMaxCameraWidth < width) width = mMaxCameraWidth; if(mMaxCameraHeight > 0 && mMaxCameraHeight < height) height = mMaxCameraHeight; try { mCameraOpenCloseLock.acquire(); boolean needReconfig = cacPreviewSize(width, height); mCameraWidth = mPreviewSize.getWidth(); mCameraHeight = mPreviewSize.getHeight(); if( !needReconfig ) { mCameraOpenCloseLock.release(); return; } if (null != mCaptureSession) { Log.d(LOGTAG, "closing existing previewSession"); mCaptureSession.close(); mCaptureSession = null; } mCameraOpenCloseLock.release(); createCameraPreviewSession(); } catch (InterruptedException e) { mCameraOpenCloseLock.release(); throw new RuntimeException("Interrupted while setCameraPreviewSize.", e); } } }
@Override protected void setCameraPreviewSize(int width, int height) { Log.i(LOGTAG, "setCameraPreviewSize("+width+"x"+height+")"); if(mMaxCameraWidth > 0 && mMaxCameraWidth < width) width = mMaxCameraWidth; if(mMaxCameraHeight > 0 && mMaxCameraHeight < height) height = mMaxCameraHeight; try { mCameraOpenCloseLock.acquire(); boolean needReconfig = cacPreviewSize(width, height); mCameraWidth = mPreviewSize.getWidth(); mCameraHeight = mPreviewSize.getHeight(); if( !needReconfig ) { mCameraOpenCloseLock.release(); return; } if (null != mCaptureSession) { Log.d(LOGTAG, "closing existing previewSession"); mCaptureSession.close(); mCaptureSession = null; } mCameraOpenCloseLock.release(); createCameraPreviewSession(); } catch (InterruptedException e) { mCameraOpenCloseLock.release(); throw new RuntimeException("Interrupted while setCameraPreviewSize.", e); } } }
@Override protected void setCameraPreviewSize(int width, int height) { Log.i(LOGTAG, "setCameraPreviewSize("+width+"x"+height+")"); if(mMaxCameraWidth > 0 && mMaxCameraWidth < width) width = mMaxCameraWidth; if(mMaxCameraHeight > 0 && mMaxCameraHeight < height) height = mMaxCameraHeight; try { mCameraOpenCloseLock.acquire(); boolean needReconfig = cacPreviewSize(width, height); mCameraWidth = mPreviewSize.getWidth(); mCameraHeight = mPreviewSize.getHeight(); if( !needReconfig ) { mCameraOpenCloseLock.release(); return; } if (null != mCaptureSession) { Log.d(LOGTAG, "closing existing previewSession"); mCaptureSession.close(); mCaptureSession = null; } mCameraOpenCloseLock.release(); createCameraPreviewSession(); } catch (InterruptedException e) { mCameraOpenCloseLock.release(); throw new RuntimeException("Interrupted while setCameraPreviewSize.", e); } } }
@Override protected void setCameraPreviewSize(int width, int height) { Log.i(LOGTAG, "setCameraPreviewSize("+width+"x"+height+")"); if(mMaxCameraWidth > 0 && mMaxCameraWidth < width) width = mMaxCameraWidth; if(mMaxCameraHeight > 0 && mMaxCameraHeight < height) height = mMaxCameraHeight; try { mCameraOpenCloseLock.acquire(); boolean needReconfig = cacPreviewSize(width, height); mCameraWidth = mPreviewSize.getWidth(); mCameraHeight = mPreviewSize.getHeight(); if( !needReconfig ) { mCameraOpenCloseLock.release(); return; } if (null != mCaptureSession) { Log.d(LOGTAG, "closing existing previewSession"); mCaptureSession.close(); mCaptureSession = null; } mCameraOpenCloseLock.release(); createCameraPreviewSession(); } catch (InterruptedException e) { mCameraOpenCloseLock.release(); throw new RuntimeException("Interrupted while setCameraPreviewSize.", e); } } }