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

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

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

android-自定义相机遇小米3生成图片花屏_第1张图片

生成的图片就是这个叼样子,这是我截图过的原图片大小是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);
        }

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

你可能感兴趣的:(android,基础)