From f59f64be155aea0e0cafaa90804b9ce30eab2c1a Mon Sep 17 00:00:00 2001 From: jiangdongguo <765067602@qq.com> Date: Tue, 21 Nov 2017 16:34:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DgetSurfaceTexture=E8=BF=94?= =?UTF-8?q?=E5=9B=9ENull=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libusbcamera/libusbcamera.iml | 16 ++++++++-------- .../com/jiangdg/usbcamera/USBCameraManager.java | 2 +- .../usb/widget/UVCCameraTextureView.java | 13 ++++++++----- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/libusbcamera/libusbcamera.iml b/libusbcamera/libusbcamera.iml index 013d57c..6f13e12 100644 --- a/libusbcamera/libusbcamera.iml +++ b/libusbcamera/libusbcamera.iml @@ -67,14 +67,6 @@ - - - - - - - - @@ -83,6 +75,14 @@ + + + + + + + + diff --git a/libusbcamera/src/main/java/com/jiangdg/usbcamera/USBCameraManager.java b/libusbcamera/src/main/java/com/jiangdg/usbcamera/USBCameraManager.java index c81ea2d..5d2fca1 100644 --- a/libusbcamera/src/main/java/com/jiangdg/usbcamera/USBCameraManager.java +++ b/libusbcamera/src/main/java/com/jiangdg/usbcamera/USBCameraManager.java @@ -198,7 +198,7 @@ public class USBCameraManager{ } }); } - + /** * 注册检测USB设备广播接收器 * */ diff --git a/libusbcamera/src/main/java/com/serenegiant/usb/widget/UVCCameraTextureView.java b/libusbcamera/src/main/java/com/serenegiant/usb/widget/UVCCameraTextureView.java index 7813a11..16ab871 100644 --- a/libusbcamera/src/main/java/com/serenegiant/usb/widget/UVCCameraTextureView.java +++ b/libusbcamera/src/main/java/com/serenegiant/usb/widget/UVCCameraTextureView.java @@ -79,7 +79,10 @@ public class UVCCameraTextureView extends AspectRatioTextureView // API >= 14 @Override public void onResume() { if (DEBUG) Log.v(TAG, "onResume:"); - if (mHasSurface) { +// if (mHasSurface) { +// mRenderHandler = RenderHandler.createHandler(mFpsCounter, super.getSurfaceTexture(), getWidth(), getHeight()); +// } + if (mRenderHandler == null) { mRenderHandler = RenderHandler.createHandler(mFpsCounter, super.getSurfaceTexture(), getWidth(), getHeight()); } } @@ -87,10 +90,10 @@ public class UVCCameraTextureView extends AspectRatioTextureView // API >= 14 @Override public void onPause() { if (DEBUG) Log.v(TAG, "onPause:"); - if (mRenderHandler != null) { - mRenderHandler.release(); - mRenderHandler = null; - } +// if (mRenderHandler != null) { +// mRenderHandler.release(); +// mRenderHandler = null; +// } if (mTempBitmap != null) { mTempBitmap.recycle(); mTempBitmap = null;