mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 21:29:54 +01:00
Remove performance logging.
This commit is contained in:
@@ -24,7 +24,6 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
import static com.google.zxing.DecodeHintType.CHARACTER_SET;
|
import static com.google.zxing.DecodeHintType.CHARACTER_SET;
|
||||||
import static java.util.Collections.singletonMap;
|
import static java.util.Collections.singletonMap;
|
||||||
import static java.util.logging.Level.INFO;
|
|
||||||
import static java.util.logging.Level.WARNING;
|
import static java.util.logging.Level.WARNING;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@@ -67,7 +66,6 @@ class QrCodeDecoder implements PreviewConsumer, PreviewCallback {
|
|||||||
@Override
|
@Override
|
||||||
public void onPreviewFrame(byte[] data, Camera camera) {
|
public void onPreviewFrame(byte[] data, Camera camera) {
|
||||||
if (camera == this.camera) {
|
if (camera == this.camera) {
|
||||||
LOG.info("Got preview frame");
|
|
||||||
try {
|
try {
|
||||||
Size size = camera.getParameters().getPreviewSize();
|
Size size = camera.getParameters().getPreviewSize();
|
||||||
// The preview should be in NV21 format: width * height bytes of
|
// The preview should be in NV21 format: width * height bytes of
|
||||||
@@ -105,20 +103,13 @@ class QrCodeDecoder implements PreviewConsumer, PreviewCallback {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Void doInBackground(Void... params) {
|
protected Void doInBackground(Void... params) {
|
||||||
long now = System.currentTimeMillis();
|
|
||||||
BinaryBitmap bitmap = binarize(data, width, height, orientation);
|
BinaryBitmap bitmap = binarize(data, width, height, orientation);
|
||||||
Result result;
|
Result result;
|
||||||
try {
|
try {
|
||||||
result = reader.decode(bitmap,
|
result = reader.decode(bitmap,
|
||||||
singletonMap(CHARACTER_SET, "ISO8859_1"));
|
singletonMap(CHARACTER_SET, "ISO8859_1"));
|
||||||
long duration = System.currentTimeMillis() - now;
|
|
||||||
if (LOG.isLoggable(INFO))
|
|
||||||
LOG.info("Decoding barcode took " + duration + " ms");
|
|
||||||
} catch (ReaderException e) {
|
} catch (ReaderException e) {
|
||||||
// No barcode found
|
// No barcode found
|
||||||
long duration = System.currentTimeMillis() - now;
|
|
||||||
if (LOG.isLoggable(INFO))
|
|
||||||
LOG.info("No barcode found after " + duration + " ms");
|
|
||||||
return null;
|
return null;
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
LOG.warning("Invalid preview frame");
|
LOG.warning("Invalid preview frame");
|
||||||
|
|||||||
Reference in New Issue
Block a user