|
|
@ -328,6 +328,7 @@ public class JavaCameraView extends CameraBridgeViewBase implements PreviewCallb |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
do { |
|
|
|
do { |
|
|
|
|
|
|
|
boolean hasFrame = false; |
|
|
|
synchronized (JavaCameraView.this) { |
|
|
|
synchronized (JavaCameraView.this) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
while (!mCameraFrameReady && !mStopThread) { |
|
|
|
while (!mCameraFrameReady && !mStopThread) { |
|
|
@ -337,11 +338,14 @@ public class JavaCameraView extends CameraBridgeViewBase implements PreviewCallb |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (mCameraFrameReady) |
|
|
|
if (mCameraFrameReady) |
|
|
|
|
|
|
|
{ |
|
|
|
mChainIdx = 1 - mChainIdx; |
|
|
|
mChainIdx = 1 - mChainIdx; |
|
|
|
|
|
|
|
mCameraFrameReady = false; |
|
|
|
|
|
|
|
hasFrame = true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!mStopThread && mCameraFrameReady) { |
|
|
|
if (!mStopThread && hasFrame) { |
|
|
|
mCameraFrameReady = false; |
|
|
|
|
|
|
|
if (!mFrameChain[1 - mChainIdx].empty()) |
|
|
|
if (!mFrameChain[1 - mChainIdx].empty()) |
|
|
|
deliverAndDrawFrame(mCameraFrame[1 - mChainIdx]); |
|
|
|
deliverAndDrawFrame(mCameraFrame[1 - mChainIdx]); |
|
|
|
} |
|
|
|
} |
|
|
|