Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera lock exception #11

Open
alcntml opened this issue Dec 20, 2017 · 2 comments
Open

Camera lock exception #11

alcntml opened this issue Dec 20, 2017 · 2 comments

Comments

@alcntml
Copy link

alcntml commented Dec 20, 2017

Phone is LgG5 7.0

StackTrace

FATAL EXCEPTION: main
Process: com.vodafone.arena, PID: 13760
java.lang.RuntimeException: lock failed
at android.hardware.Camera.lock(Native Method)
at com.amosyuen.videorecorder.camera.CameraController.lock(CameraController.java:239)
at com.amosyuen.videorecorder.activity.FFmpegRecorderActivity.stopRecording(FFmpegRecorderActivity.java:494)
at com.amosyuen.videorecorder.activity.FFmpegRecorderActivity.stopRecordingAndPrepareForNext(FFmpegRecorderActivity.java:484)
at com.amosyuen.videorecorder.activity.FFmpegRecorderActivity.onTouch(FFmpegRecorderActivity.java:508)
at android.view.View.dispatchTouchEvent(View.java:9953)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2711)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2400)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2711)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2400)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2711)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2400)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2711)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2400)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2711)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2400)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2711)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2400)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2711)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2400)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:412)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1834)
at android.app.Activity.dispatchTouchEvent(Activity.java:3154)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:68)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:68)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:374)
at android.view.View.dispatchPointerEvent(View.java:10177)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4628)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4496)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3947)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4000)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3966)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3974)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3947)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4000)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3966)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4095)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3974)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4152)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3947)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4000)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3966)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3974)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3947)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6437)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6411)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6372)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6571)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.os.MessageQueue.nativePollOnce(Native Method)
        12-20 13:32:10.139 13760-13760/com.vodafone.arena E/AndroidRuntime:     at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:6247)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)

Here is my code;

FFmpegRecorderActivityParams.Builder paramsBuilder =
        FFmpegRecorderActivityParams.builder(RabonaChooseVideoActivity.this)
                .setVideoOutputFileUri(destFile);

paramsBuilder.recorderParamsBuilder()
        .setVideoSize(new ImageSize(640, 480))
        .setVideoCodec(EncoderParamsI.VideoCodec.H264)
        .setVideoBitrate(100000)
        .setVideoFrameRate(30)
        .setVideoImageFit(ImageFit.FILL)
        .setVideoImageScale(ImageScale.DOWNSCALE)
        .setShouldCropVideo(true)
        .setShouldPadVideo(true)
        .setVideoCameraFacing(CameraControllerI.Facing.BACK)
        .setAudioCodec(EncoderParamsI.AudioCodec.AAC)
        .setAudioSamplingRateHz(44100)
        .setAudioBitrate(100000)
        .setAudioChannelCount(2)
        .setOutputFormat(EncoderParamsI.OutputFormat.MP4);

Intent intent = new Intent(RabonaChooseVideoActivity.this, FFmpegRecorderActivity.class);
intent.putExtra(FFmpegRecorderActivity.REQUEST_PARAMS_KEY, paramsBuilder.build());
startActivityForResult(intent, REQUEST_TAKE_CAMERA_VIDEO);
@amosyuen amosyuen added the bug label Jan 15, 2018
@amosyuen
Copy link
Owner

@alcntml When does this happen? Could you describe your interactions with the phone before the error?

  • Is it right after you stop recording?
  • Is it after the first clip or after multiple?

@heena002
Copy link

heena002 commented May 29, 2020

facing the same error right after I stop recording the first clip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants