|
|
@ -47,8 +47,8 @@ import java.util.List; |
|
|
|
public class CameraActivity extends AppCompatActivity implements View.OnClickListener, OptionView.Callback { |
|
|
|
public class CameraActivity extends AppCompatActivity implements View.OnClickListener, OptionView.Callback { |
|
|
|
|
|
|
|
|
|
|
|
private final static CameraLogger LOG = CameraLogger.create("DemoApp"); |
|
|
|
private final static CameraLogger LOG = CameraLogger.create("DemoApp"); |
|
|
|
private final static boolean USE_FRAME_PROCESSOR = true; |
|
|
|
private final static boolean USE_FRAME_PROCESSOR = false; |
|
|
|
private final static boolean DECODE_BITMAP = true; |
|
|
|
private final static boolean DECODE_BITMAP = false; |
|
|
|
|
|
|
|
|
|
|
|
private CameraView camera; |
|
|
|
private CameraView camera; |
|
|
|
private ViewGroup controlPanel; |
|
|
|
private ViewGroup controlPanel; |
|
|
@ -76,7 +76,7 @@ public class CameraActivity extends AppCompatActivity implements View.OnClickLis |
|
|
|
long newTime = frame.getTime(); |
|
|
|
long newTime = frame.getTime(); |
|
|
|
long delay = newTime - lastTime; |
|
|
|
long delay = newTime - lastTime; |
|
|
|
lastTime = newTime; |
|
|
|
lastTime = newTime; |
|
|
|
LOG.e("Frame delayMillis:", delay, "FPS:", 1000 / delay); |
|
|
|
LOG.v("Frame delayMillis:", delay, "FPS:", 1000 / delay); |
|
|
|
if (DECODE_BITMAP) { |
|
|
|
if (DECODE_BITMAP) { |
|
|
|
if (frame.getFormat() == ImageFormat.NV21 |
|
|
|
if (frame.getFormat() == ImageFormat.NV21 |
|
|
|
&& frame.getDataClass() == byte[].class) { |
|
|
|
&& frame.getDataClass() == byte[].class) { |
|
|
|