简体   繁体   English

Android CWAC摄像头:前置摄像头的图像始终镜像

[英]Android CWAC Camera : Image from front facing camera always mirrored

I am using CWAC's camera in an app. 我在应用程序中使用CWAC的相机。 Although the demo app seems to work the way I need it to - ie the image from the front facing camera is not mirrored if I return true from mirrorFFC() in DemoCameraHost. 尽管演示应用程序似乎可以按我的方式运行-即,如果我从DemoCameraHost中的mirrorFFC()返回true,则不会镜像来自前置摄像头的图像。

@Override
 public boolean mirrorFFC() {
    return true;
}

When I do the exact same thing in my app, for some reason the image from the front facing camera is still mirrored. 当我在应用中执行完全相同的操作时,由于某种原因,前置摄像头的图像仍会被镜像。 Clearly I am missing something out, although I am finding it hard to put my finger on it. 显然,我遗漏了一些东西,尽管我发现很难用手指指着它。 I have even passed true to the SimpleCameraHost builder in the onCreate of my Camera Fragment class as shown below. 我什至在我的Camera Fragment类的onCreate中将true传递给SimpleCameraHost构建器,如下所示。

cameraHost = new MyCameraHost(getActivity(), useFFC);
    SimpleCameraHost.Builder builder =
            new SimpleCameraHost.Builder(cameraHost).mirrorFFC(true);
    setHost(builder.useSingleShotMode(true).mirrorFFC(true).build());

Turns out the reason this was happening was I was returning 0.0f from maxPictureCleanupHeapUsage() in my custom camera host. 原来发生这种情况的原因是我从自定义相机主机的maxPictureCleanupHeapUsage()返回0.0f。 I changed it back to 1.0f and this seems to have fixed the problem. 我将其更改回1.0f,这似乎已解决了该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM