{"action":"opened","issue":{"url":"https://api.github.com/repos/googlesamples/android-Camera2Video/issues/86","repository_url":"https://api.github.com/repos/googlesamples/android-Camera2Video","labels_url":"https://api.github.com/repos/googlesamples/android-Camera2Video/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/googlesamples/android-Camera2Video/issues/86/comments","events_url":"https://api.github.com/repos/googlesamples/android-Camera2Video/issues/86/events","html_url":"https://github.com/googlesamples/android-Camera2Video/issues/86","id":345524658,"node_id":"MDU6SXNzdWUzNDU1MjQ2NTg=","number":86,"title":"MediaRecorder and VideoSource.SURFACE, stop failed: -1007","user":{"login":"anonym24","id":8851301,"node_id":"MDQ6VXNlcjg4NTEzMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/8851301?v=4","gravatar_id":"","url":"https://api.github.com/users/anonym24","html_url":"https://github.com/anonym24","followers_url":"https://api.github.com/users/anonym24/followers","following_url":"https://api.github.com/users/anonym24/following{/other_user}","gists_url":"https://api.github.com/users/anonym24/gists{/gist_id}","starred_url":"https://api.github.com/users/anonym24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anonym24/subscriptions","organizations_url":"https://api.github.com/users/anonym24/orgs","repos_url":"https://api.github.com/users/anonym24/repos","events_url":"https://api.github.com/users/anonym24/events{/privacy}","received_events_url":"https://api.github.com/users/anonym24/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-29T11:52:39Z","updated_at":"2018-07-29T11:52:39Z","closed_at":null,"author_association":"NONE","body":"```\r\n07-29 14:44:22.825 8076-8076/? E/AndroidRuntime: FATAL EXCEPTION: main\r\n    Process: com.example.android.camera2video, PID: 8076\r\n    java.lang.RuntimeException: stop failed.\r\n        at android.media.MediaRecorder.stop(Native Method)\r\n        at com.example.android.camera2video.Camera2VideoFragment.stopRecordingVideo(Camera2VideoFragment.java:682)\r\n        at com.example.android.camera2video.Camera2VideoFragment.onClick(Camera2VideoFragment.java:312)\r\n        at android.view.View.performClick(View.java:5215)\r\n        at android.view.View$PerformClick.run(View.java:21193)\r\n        at android.os.Handler.handleCallback(Handler.java:742)\r\n        at android.os.Handler.dispatchMessage(Handler.java:95)\r\n        at android.os.Looper.loop(Looper.java:157)\r\n        at android.app.ActivityThread.main(ActivityThread.java:5571)\r\n        at java.lang.reflect.Method.invoke(Native Method)\r\n        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)\r\n        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)\r\n```\r\n\r\nI created before \r\n\r\nhttps://stackoverflow.com/questions/51332386/mediarecorder-and-videosource-surface-stop-failed-1007-a-serious-android-bug\r\n\r\nhttps://issuetracker.google.com/issues/111433520\r\n\r\nJust deprecate next API \r\n\r\n`MediaRecorder.setVideoSource(MediaRecorder.VideoSource.SURFACE);`\r\n\r\nand \r\n\r\n```\r\nmSurface = mMediaCodec.createInputSurface();\r\nmSurface.lockHardwareCanvas()\r\n```\r\n\r\nit's all buggy and usually works only Google Nexuses but Android works on many other devices\r\n\r\nJust implement some other API which will work 100% for all devices\r\n\r\nYes we can use MediaCodec and OpenGL ES but it's very difficult\r\n\r\nJust make some friendly API which will allow to record video, edit frames before recording (to timestamp for example) and background recording"}}
{"actor":{"display_login":"anonym24"}}