Browse Source

修复拍照分辨率不正确问题(未完成)

main
jiangdongguo 7 years ago
parent
commit
73d06c931a
  1. 84
      app/app.iml
  2. 13
      app/src/main/java/com/jiangdg/usbcamera/view/USBCameraActivity.java
  3. 82
      libusbcamera/src/main/java/com/jiangdg/usbcamera/task/SaveYuvImageTask.java
  4. 2
      libusbcamera/src/main/java/com/jiangdg/usbcamera/utils/FileUtils.java
  5. 45
      libusbcamera/src/main/java/com/jiangdg/usbcamera/utils/YUVBean.java
  6. 43
      libusbcamera/src/main/java/com/serenegiant/usb/common/AbstractUVCCameraHandler.java
  7. 7
      libusbcamera/src/main/java/com/serenegiant/usb/encoder/MediaEncoder.java
  8. 6
      libusbcamera/src/main/java/com/serenegiant/usb/encoder/biz/H264EncodeConsumer.java
  9. 1
      libusbcamera/src/main/java/com/serenegiant/usb/widget/AspectRatioTextureView.java
  10. 2
      libusbcamera/src/main/java/com/serenegiant/usb/widget/CameraViewInterface.java
  11. 5
      libusbcamera/src/main/java/com/serenegiant/usb/widget/UVCCameraTextureView.java

84
app/app.iml

@ -9,7 +9,6 @@
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<afterSyncTasks>
@ -23,7 +22,7 @@
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
<exclude-output />
@ -47,7 +46,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
@ -55,7 +53,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
@ -63,25 +60,22 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
@ -100,37 +94,37 @@
</content>
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" scope="TEST" name="runner-0.5" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="espresso-idling-resource-2.2.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-library-1.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-integration-1.3" level="project" />
<orderEntry type="library" exported="" name="javapoet-1.9.0" level="project" />
<orderEntry type="library" exported="" name="support-core-ui-25.3.1" level="project" />
<orderEntry type="library" exported="" name="auto-common-0.8" level="project" />
<orderEntry type="library" exported="" name="butterknife-compiler-8.8.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="jsr305-2.0.1" level="project" />
<orderEntry type="library" exported="" name="support-core-utils-25.3.1" level="project" />
<orderEntry type="library" exported="" name="support-fragment-25.3.1" level="project" />
<orderEntry type="library" exported="" name="butterknife-annotations-8.8.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="espresso-core-2.2.2" level="project" />
<orderEntry type="library" exported="" name="guava-19.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="exposed-instrumentation-api-publish-0.5" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="rules-0.5" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="javax.annotation-api-1.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="javax.inject-1" level="project" />
<orderEntry type="library" exported="" name="common-1.5.20" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="javawriter-2.1.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-25.3.1" level="project" />
<orderEntry type="library" exported="" name="support-media-compat-25.3.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-25.3.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-25.3.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-25.3.1" level="project" />
<orderEntry type="library" exported="" name="support-vector-drawable-25.3.1" level="project" />
<orderEntry type="library" exported="" name="support-compat-25.3.1" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-25.3.1" level="project" />
<orderEntry type="library" exported="" name="butterknife-8.8.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="com.android.support.test:exposed-instrumentation-api-publish-0.5" level="project" />
<orderEntry type="library" exported="" name="com.google.guava:guava:19.0@jar" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit:junit:4.12@jar" level="project" />
<orderEntry type="library" exported="" name="com.squareup:javapoet:1.9.0@jar" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="javax.inject:javax.inject:1@jar" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-core-ui-25.3.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="com.squareup:javawriter:2.1.1@jar" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-compat-25.3.1" level="project" />
<orderEntry type="library" exported="" name="com.jakewharton:butterknife-compiler:8.8.1@jar" level="project" />
<orderEntry type="library" exported="" name="com.serenegiant:common-1.5.20" level="project" />
<orderEntry type="library" exported="" name="com.google.auto:auto-common:0.8@jar" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-core-utils-25.3.1" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-v4-25.3.1" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-fragment-25.3.1" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-media-compat-25.3.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="com.google.code.findbugs:jsr305:2.0.1@jar" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="org.hamcrest:hamcrest-core:1.3@jar" level="project" />
<orderEntry type="library" exported="" name="com.jakewharton:butterknife-8.8.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="com.android.support.test.espresso:espresso-core-2.2.2" level="project" />
<orderEntry type="library" exported="" name="com.jakewharton:butterknife-annotations:8.8.1@jar" level="project" />
<orderEntry type="library" exported="" name="com.android.support:animated-vector-drawable-25.3.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="com.android.support.test:rules-0.5" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="org.hamcrest:hamcrest-library:1.3@jar" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="org.hamcrest:hamcrest-integration:1.3@jar" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="com.android.support.test:runner-0.5" level="project" />
<orderEntry type="library" exported="" name="com.android.support:appcompat-v7-25.3.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="com.android.support.test.espresso:espresso-idling-resource-2.2.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="javax.annotation:javax.annotation-api:1.2@jar" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-vector-drawable-25.3.1" level="project" />
<orderEntry type="library" exported="" name="com.android.support:recyclerview-v7-25.3.1" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-annotations:25.3.1@jar" level="project" />
<orderEntry type="module" module-name="libusbcamera" exported="" />
</component>
</module>

13
app/src/main/java/com/jiangdg/usbcamera/view/USBCameraActivity.java

@ -2,19 +2,14 @@ package com.jiangdg.usbcamera.view;
import android.hardware.usb.UsbDevice;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Surface;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.jiangdg.usbcamera.FileUtils;
import com.jiangdg.usbcamera.utils.FileUtils;
import com.jiangdg.usbcamera.R;
import com.jiangdg.usbcamera.USBCameraManager;
import com.serenegiant.usb.CameraDialog;
@ -24,12 +19,6 @@ import com.serenegiant.usb.common.AbstractUVCCameraHandler;
import com.serenegiant.usb.encoder.RecordParams;
import com.serenegiant.usb.widget.CameraViewInterface;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;

82
libusbcamera/src/main/java/com/jiangdg/usbcamera/task/SaveYuvImageTask.java

@ -0,0 +1,82 @@
package com.jiangdg.usbcamera.task;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.ImageFormat;
import android.graphics.Rect;
import android.graphics.YuvImage;
import android.os.AsyncTask;
import com.jiangdg.usbcamera.utils.YUVBean;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
/**保存YUV格式NV21图片
*
* Created by jiangdongguo on 2017-12-25下午9:13:01
*/
public class SaveYuvImageTask extends AsyncTask<Void, Void, Void> {
private static final String TAG = "SaveYuvImageTask";
private YUVBean yuvBean;
private Context mContext;
//转换结果回调接口
private OnSaveYuvResultListener mListener;
public interface OnSaveYuvResultListener{
void onSaveResult(String savePath);
}
public SaveYuvImageTask(YUVBean yuvBean, OnSaveYuvResultListener mListener) {
this.yuvBean = yuvBean;
this.mListener = mListener;
}
@Override
protected Void doInBackground(Void... params) {
if (yuvBean == null || yuvBean.getWidth() == 0
|| yuvBean.getHeight() == 0 || yuvBean.getYuvData() == null) {
return null;
}
saveYuv2Jpeg(yuvBean.getYuvData(),yuvBean.getWidth(),yuvBean.getHeight());
return null;
}
private void saveYuv2Jpeg(byte[] data,int width,int height){
YuvImage yuvImage = new YuvImage(data, ImageFormat.NV21, width, height, null);
ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length);
boolean result = yuvImage.compressToJpeg(new Rect(0, 0, width, height), 100, bos);
if(result){
byte[] buffer = bos.toByteArray();
Bitmap bmp = BitmapFactory.decodeByteArray(buffer, 0, buffer.length);
bmp.recycle();
String savPath = yuvBean.getPicPath();
File file = new File(savPath);
FileOutputStream fos = null;
try {
fos = new FileOutputStream(file);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
bmp.compress(Bitmap.CompressFormat.JPEG, 100, fos);
try {
fos.flush();
fos.close();
//传递转换结果给调用者
mListener.onSaveResult(savPath);
} catch (IOException e) {
e.printStackTrace();
mListener.onSaveResult(null);
}
}
try {
bos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}

2
libusbcamera/src/main/java/com/jiangdg/usbcamera/FileUtils.java → libusbcamera/src/main/java/com/jiangdg/usbcamera/utils/FileUtils.java

@ -1,4 +1,4 @@
package com.jiangdg.usbcamera;
package com.jiangdg.usbcamera.utils;
import android.os.Environment;

45
libusbcamera/src/main/java/com/jiangdg/usbcamera/utils/YUVBean.java

@ -0,0 +1,45 @@
package com.jiangdg.usbcamera.utils;
/** NV21数据类
*
* Created by jiangdongguo on 2018/1/26.
*/
public class YUVBean {
private int width;
private int height;
private byte[] yuvData;
private String picPath;
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public byte[] getYuvData() {
return yuvData;
}
public void setYuvData(byte[] yuvData) {
this.yuvData = yuvData;
}
public String getPicPath() {
return picPath;
}
public void setPicPath(String picPath) {
this.picPath = picPath;
}
}

43
libusbcamera/src/main/java/com/serenegiant/usb/common/AbstractUVCCameraHandler.java

@ -16,12 +16,10 @@ import android.util.Log;
import android.view.Surface;
import android.view.SurfaceHolder;
import com.jiangdg.usbcamera.FileUtils;
import com.serenegiant.usb.IFrameCallback;
import com.serenegiant.usb.Size;
import com.serenegiant.usb.USBMonitor;
import com.serenegiant.usb.UVCCamera;
import com.serenegiant.usb.encoder.MediaAudioEncoder;
import com.serenegiant.usb.encoder.MediaEncoder;
import com.serenegiant.usb.encoder.MediaMuxerWrapper;
import com.serenegiant.usb.encoder.MediaSurfaceEncoder;
@ -41,8 +39,6 @@ import java.lang.ref.WeakReference;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.nio.ByteBuffer;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
@ -536,6 +532,9 @@ public abstract class AbstractUVCCameraHandler extends Handler {
if(mPreviewListener != null){
mPreviewListener.onPreviewResult(true);
}
// 获取USB Camera预览数据
mUVCCamera.setFrameCallback(mIFrameCallback, UVCCamera.PIXEL_FORMAT_NV21);
} catch (final IllegalArgumentException e) {
// 添加分辨率参数合法性检测
if(mPreviewListener != null){
@ -586,7 +585,7 @@ public abstract class AbstractUVCCameraHandler extends Handler {
if (parent == null) return;
// mSoundPool.play(mSoundId, 0.2f, 0.2f, 0, 0, 1.0f); // play shutter sound
try {
final Bitmap bitmap = mWeakCameraView.get().captureStillImage();
final Bitmap bitmap = mWeakCameraView.get().captureStillImage(mWidth,mHeight);
// get buffered output stream for saving a captured still image as a file on external storage.
// the file name is came from current time.
// You should use extension name as same as CompressFormat when calling Bitmap#compress.
@ -662,8 +661,8 @@ public abstract class AbstractUVCCameraHandler extends Handler {
return;
if (params == null)
throw new NullPointerException("RecordParams can not be null!");
// 获取USB Camera预览数据
mUVCCamera.setFrameCallback(mIFrameCallback, UVCCamera.PIXEL_FORMAT_NV21);
// // 获取USB Camera预览数据
// mUVCCamera.setFrameCallback(mIFrameCallback, UVCCamera.PIXEL_FORMAT_NV21);
// 初始化混合器
videoPath = params.getRecordPath();
mMuxer = new Mp4MediaMuxer(params.getRecordPath(),
@ -774,30 +773,7 @@ public abstract class AbstractUVCCameraHandler extends Handler {
// isAudioThreadStart = false;
}
// 停止录制视频
// public void handleStopRecording2() {
// if (DEBUG) Log.v(TAG_THREAD, "handleStopRecording:mMuxer=" + mMuxer);
// final MediaMuxerWrapper muxer;
// synchronized (mSync) {
// muxer = mMuxer;
// mMuxer = null;
// mVideoEncoder = null;
// if (mUVCCamera != null) {
// mUVCCamera.stopCapture();
// }
// }
// try {
// mWeakCameraView.get().setVideoEncoder(null);
// } catch (final Exception e) {
// // ignore
// }
// if (muxer != null) {
// muxer.stopRecording();
// mUVCCamera.setFrameCallback(null, 0);
// // you should not wait here
// callOnStopRecording();
// }
// }
private boolean isCaptureStill;
private final IFrameCallback mIFrameCallback = new IFrameCallback() {
@Override
@ -813,6 +789,11 @@ public abstract class AbstractUVCCameraHandler extends Handler {
int len = frame.capacity();
byte[] yuv = new byte[len];
frame.get(yuv);
// 捕获图片
if(isCaptureStill) {
}
// 视频
if(mH264Consumer != null){
// 修改分辨率参数
mH264Consumer.setRawYuv(yuv,mWidth,mHeight);

7
libusbcamera/src/main/java/com/serenegiant/usb/encoder/MediaEncoder.java

@ -3,18 +3,13 @@ package com.serenegiant.usb.encoder;
import android.media.MediaCodec;
import android.media.MediaFormat;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import com.jiangdg.usbcamera.FileUtils;
import com.jiangdg.usbcamera.utils.FileUtils;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.nio.Buffer;
import java.nio.ByteBuffer;
public abstract class MediaEncoder implements Runnable {

6
libusbcamera/src/main/java/com/serenegiant/usb/encoder/biz/H264EncodeConsumer.java

@ -14,12 +14,6 @@ import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import com.jiangdg.usbcamera.FileUtils;
import static android.media.MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420PackedPlanar;
import static android.media.MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar;
import static android.media.MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420SemiPlanar;
/** 对YUV视频流进行编码
* Created by jiangdongguo on 2017/5/6.
*/

1
libusbcamera/src/main/java/com/serenegiant/usb/widget/AspectRatioTextureView.java

@ -56,6 +56,7 @@ public class AspectRatioTextureView extends TextureView // API >= 14
super(context, attrs, defStyle);
}
// 设置屏幕宽高比
@Override
public void setAspectRatio(final double aspectRatio) {
if (aspectRatio < 0) {

2
libusbcamera/src/main/java/com/serenegiant/usb/widget/CameraViewInterface.java

@ -43,5 +43,5 @@ public interface CameraViewInterface extends IAspectRatioView {
public Surface getSurface();
public boolean hasSurface();
public void setVideoEncoder(final IVideoEncoder encoder);
public Bitmap captureStillImage();
public Bitmap captureStillImage(int width,int height);
}

5
libusbcamera/src/main/java/com/serenegiant/usb/widget/UVCCameraTextureView.java

@ -60,6 +60,9 @@ public class UVCCameraTextureView extends AspectRatioTextureView // API >= 14
private Bitmap mTempBitmap;
private boolean mReqesutCaptureStillImage;
private Callback mCallback;
// Camera分辨率宽度
/** for calculation of frame rate */
private final FpsCounter mFpsCounter = new FpsCounter();
@ -169,7 +172,7 @@ public class UVCCameraTextureView extends AspectRatioTextureView // API >= 14
* you should change this method(copy and return)
*/
@Override
public Bitmap captureStillImage() {
public Bitmap captureStillImage(int width,int height) {
synchronized (mCaptureSync) {
mReqesutCaptureStillImage = true;
try {

Loading…
Cancel
Save