Android的Camera.takePicture - 可以禁用快门声和preVIEW面?快门、Camera、Android、preVIEW

2023-09-05 10:16:36 作者:青春染指悲凉

我工作的一个应用程序,将允许用户采取快速点击,忘记快照。大多数应用程序的完成,除了摄像头的工作这样,我想。现在我有摄像头的工作,但我似乎无法找到一个方法来关闭快门声音,我不能找到一种方法来禁用显示preVIEW。我能够支付preVIEW了控制,但我宁愿只是没有如果可能的话,它显示

I am working on an app that will allow a user to take quick click and forget snapshots. Most of the app is done except for the camera working that way I would like. Right now I have the camera working but I can't seem to find a way to disable the shutter sound and I cant find a way to disable displaying the preview. I was able to cover the preview up with a control but I would rather just not have it displayed if possible.

要总结的东西了,这些都是我想禁用,同时利用内置的摄像头控制的项目。

To sum things up, these are the items that I would like to disable while utilizing the built in Camera controls.

快门声音 在相机屏幕显示 图片preVIEW onPictureTaken

有谁知道可以点我在正确的方向,我将不胜AP preciate它的资源。我一直在关注CommonsWare的例子来自这个样本的相当紧密。

Does anyone know of a resource that could point me in the right direction, I would greatly appreciate it. I have been following CommonsWare's example from this sample fairly closely.

感谢你。

推荐答案

这实际上是一个电话的build.prop属性。我不能确定它可能改变这一点。除非你完全忽略它,并用自己的相机code。使用您可以在SDK中提供了什么。

This is actually a property in the build.prop of a phone. I'm unsure if its possible to change this. Unless you completely override it and use your own camera code. Using what you can that is available in the SDK.

看看这个:

CameraService.cpp     。 。

CameraService::Client::Client(const sp<CameraService>& cameraService,
        const sp<ICameraClient>& cameraClient,
        const sp<CameraHardwareInterface>& hardware,
        int cameraId, int cameraFacing, int clientPid) {
        mPreviewCallbackFlag = FRAME_CALLBACK_FLAG_NOOP;
            mOrientation = getOrientation(0, mCameraFacing == CAMERA_FACING_FRONT);
            mOrientationChanged = false;
            cameraService->setCameraBusy(cameraId);
            cameraService->loadSound();
            LOG1("Client::Client X (pid %d)", callingPid)
    }

    void CameraService::loadSound() {
        Mutex::Autolock lock(mSoundLock);
        LOG1("CameraService::loadSound ref=%d", mSoundRef);
        if (mSoundRef++) return;

        mSoundPlayer[SOUND_SHUTTER] = newMediaPlayer("/system/media/audio/ui/camera_click.ogg");
        mSoundPlayer[SOUND_RECORDING] = newMediaPlayer("/system/media/audio/ui/VideoRecord.ogg");
    }

中可以看出,在开始点击声音没有你的互动。

As can be noted, the click sound is started without your interaction.

这是在姜饼来源$ C ​​$ C使用的服务。

This is the service used in the Gingerbread Source code.

他们的原因不允许这是因为它是非法的一些国家。只有这样才能达到你想要的是有一个自定义ROM。

The reason they DON'T allow this is because it is illegal is some countries. Only way to achieve what you want is to have a custom ROM.

更新

如果有什么正在这里说:的http://androidforums.com/t-mobile-g1/6371-camera-shutter-sound-effect-off.html

If what being said here: http://androidforums.com/t-mobile-g1/6371-camera-shutter-sound-effect-off.html

仍然适用,那么你可以写一个计时器,关闭声音(静音模式)进行了几秒钟,然后重新打开它每次拍照时间。

still applies, then you could write a timer that turns off the sound (Silent Mode) for a couple of seconds and then turn it back on each time you take a picture.

 
精彩推荐