Tutorial 1 updated. Execution time camera switching implemented.

Some unification done to simplify camera switching.
This commit is contained in:
Alexander Smorkalov
2012-10-26 13:27:42 +04:00
parent 016b2cadb0
commit 83d8bc8c55
10 changed files with 96 additions and 42 deletions

View File

@@ -85,6 +85,7 @@ public abstract class CameraBridgeViewBase extends SurfaceView implements Surfac
private Object mSyncObject = new Object();
public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) {
Log.d(TAG, "call surfaceChanged event");
synchronized(mSyncObject) {
if (!mSurfaceExist) {
mSurfaceExist = true;
@@ -163,7 +164,7 @@ public abstract class CameraBridgeViewBase extends SurfaceView implements Surfac
private void checkCurrentState() {
int targetState;
if (mEnabled && mSurfaceExist) {
if (mEnabled && mSurfaceExist && getVisibility() == VISIBLE) {
targetState = STARTED;
} else {
targetState = STOPPED;