mediarecorder.stop() -> timed out waiting for incoming camera video frames

可紊 提交于 2019-12-11 02:33:29

问题


this is a little pain in the ass lately for me. Some of the devices on which I'm running my app, are getting this error.

Basically, application starts recording, goes to background. When app is being brought to front, it should perform mediarecorder.stop() and restart recording. Somehow, some of the devices have problem with this. In those situations, I'm getting black screen and "timed out waiting for incoming camera video frames" message. Camera is locked and can't be used anymore even when I kill the app.

Would appreciate any help with this. I'm trying to figure it out for a week now.


@Override
public void onPause() {
    editor.putInt("checkBackground", 1);  
    editor.commit();  

    if (inRecord){  
        editor.putInt("autoResume", 1);  
        editor.commit();  
    }  
    if (inPreview){  
        if (camera != null) {  
            camera.stopPreview();  
            camera.setPreviewCallback(null);  
            camera.release();  
            camera = null;  
        }  
        inPreview = false;  
        gpsManager.stopListening();  
    }  
    super.onPause();
}

After some investigation, while app is going to background, I'm getting below messages in LogCat.


WORKING VERSION

08-13 12:30:16.245: E/BufferQueue(1684): [SurfaceView] dequeueBuffer: SurfaceTexture has been abandoned!
08-13 12:30:16.245: E/CameraHal(1705): ExtIsp  ! CameraFillBufferDone dequeueNativeBuffer failed vendor/st-ericsson/variant/hardware/libcamera/STEExtIspInternal.cpp:836

HANGING VERSION WITH BLACK SCREEN

08-13 12:12:01.385: E/BufferQueue(104): [SurfaceView] queueBuffer: SurfaceTexture has been abandoned!
08-13 12:12:01.385: E/SurfaceTextureClient(107): queueBuffer: error queuing buffer to SurfaceTexture, -19
08-13 12:12:01.385: E/CameraHAL(107): Surface::queueBuffer returned error -19
08-13 12:12:01.385: E/BufferQueue(104): [SurfaceView] dequeueBuffer: SurfaceTexture has been abandoned!
08-13 12:12:01.385: E/CameraHAL(107): (41b7c548)   hardware/ti/omap4xxx/camera/espresso/ANativeWindowDisplayAdapter.cpp:1199 handleFrameReturn - dequeueBuffer failed: No such device (19)

来源:https://stackoverflow.com/questions/18202911/mediarecorder-stop-timed-out-waiting-for-incoming-camera-video-frames

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!