android 仿小米相机,android-自定义相机遇小米3生成图片花屏

研究了几天终于有了结果,这也是无意间把这段代码屏蔽了,突然就好了,我也是莫名其妙.....因为没有看太多源码对自定义相机的工作模式了解的还不够深入。。。导致了我遇到的这个坑。

其实我试了很多款手机 只有小米3出现了这个问题,先上一张图片

0818b9ca8b590ca3270a3433284dd417.png

生成的图片就是这个叼样子,这是我截图过的原图片大小是1280X768的

当前解决方法:注释掉这段代码

// 是否支持视频防抖

if (mParams.isVideoStabilizationSupported()) {// 最低支持API 15

mParams.setVideoStabilization(true);

}

我看哈源码也没看出什么端倪

/**

*

Enables and disables video stabilization. Use

* {@link #isVideoStabilizationSupported} to determine if calling this

* method is valid.

*

*

Video stabilization reduces the shaking due to the motion of the

* camera in both the preview stream and in recorded videos, including

* data received from the preview callback. It does not reduce motion

* blur in images captured with

* {@link Camera#takePicture takePicture}.

*

*

Video stabilization can be enabled and disabled while preview or

* recording is active, but toggling it may cause a jump in the video

* stream that may be undesirable in a recorded video.

*

* @param toggle Set to true to enable video stabilization, and false to

* disable video stabilization.

* @see #isVideoStabilizationSupported()

* @see #getVideoStabilization()

*/

public void setVideoStabilization(boolean toggle) {

set(KEY_VIDEO_STABILIZATION, toggle ? TRUE : FALSE);

}

看set方法:

/**

* Sets a String parameter.

*

* @param key the key name for the parameter

* @param value the String value of the parameter

*/

public void set(String key, String value) {

if (key.indexOf('=') != -1 || key.indexOf(';') != -1 || key.indexOf(0) != -1) {

Log.e(TAG, "Key \"" + key + "\" contains invalid character (= or ; or \\0)");

return;

}

if (value.indexOf('=') != -1 || value.indexOf(';') != -1 || value.indexOf(0) != -1) {

Log.e(TAG, "Value \"" + value + "\" contains invalid character (= or ; or \\0)");

return;

}

put(key, value);

} 看不出什么东西,希望大神们看见了,给出宝贵的见解

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值