当运行android模拟器时,打开camera程序,系统会通过fakecamera显示一些黑白格子当作预览,请问如何用一张已有的图片来当作预览?

解决方案 »

  1.   

    我知道阿,我是刚学android的,还没怎么入门,老板让我先试试能不能把这个弄出来```````还有个问题,我用2.3的代码发现camera白屏,日志如下:
    D/Camera  (  399): app passed NULL surfaceD/CameraHardwareStub(   34): initHeapLocked: preview size=320x240V/camera  (  399): startPreviewE/SurfaceFlinger(   66): texture=12, using format 17, which is not supported by the GLW/OrientationEventListener(  399): Cannot detect sensors. Not enabled
    求解
      

  2.   

    2.3的代码发现camera白屏的原因是由于E/SurfaceFlinger( 66): texture=12, using format 17, which is not supported by the GL
      

  3.   

    这句日志我在SurfaceFlinger.cpp里都搜不到,不知道怎么解决
      

  4.   

    fakeCamera的原始数据时YUV420SP的,你可以在CameraService中将预览的格式强制设成其他值,说不定可以出来图像,虽然颜色空间不对。
      

  5.   

    2.3认为yuv422 420是 out of date
    不再显示