{"id":678,"date":"2016-04-29T14:38:41","date_gmt":"2016-04-29T05:38:41","guid":{"rendered":"http:\/\/beingTested.jp\/wordpress\/?p=678"},"modified":"2018-06-12T09:15:46","modified_gmt":"2018-06-12T00:15:46","slug":"android-camera2video%e3%82%b5%e3%83%b3%e3%83%97%e3%83%ab%e3%81%8c%e9%8c%b2%e7%94%bb%e3%82%b9%e3%83%88%e3%83%83%e3%83%97%e3%81%a7%e8%90%bd%e3%81%a1%e3%82%8b%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/beingtested.jp\/wordpress\/?p=678","title":{"rendered":"android-Camera2Video\u30b5\u30f3\u30d7\u30eb\u304c\u9332\u753b\u30b9\u30c8\u30c3\u30d7\u3067\u843d\u3061\u308b\u4ef6"},"content":{"rendered":"<p>\u6700\u8fd1\u306f\u6b21\u306e\u30a2\u30d7\u30ea\u958b\u767a\u306e\u305f\u3081Camera2API\u3092\u52c9\u5f37\u4e2d\u3002<br \/>\ngooglesamples\u306e\u30b5\u30f3\u30d7\u30eb\u306fAndroidStudio\u3060\u3068\u4e00\u767a\u30a4\u30f3\u30dd\u30fc\u30c8\u3067\u3059\u3050\u52d5\u304b\u305b\u308b\u3093\u3060\u3051\u3069\u3001\u52c9\u5f37\u306e\u305f\u3081\u3042\u3048\u3066\u4e00\u304b\u3089\u66f8\u304d\u5199\u3057\u3066\u308b\u3002\u81ea\u5206\u306e\u4e2d\u3067\u306f\u5199\u7d4c\u3068\u547c\u3093\u3067\u307e\u3059\u3002<br \/>\n\u3067\u3001\u30d3\u30c7\u30aa\u9332\u753b\u306e\u30b5\u30f3\u30d7\u30eb\u306e<a href=\"https:\/\/github.com\/googlesamples\/android-Camera2Video\" target=\"_blank\">\u3053\u308c<\/a>\u5199\u7d4c\u3057\u3066\u52d5\u304b\u3057\u3066\u307f\u305f\u3089\u3001<br \/>\n\u9332\u753b\u7d42\u4e86\u30dc\u30bf\u30f3\u62bc\u3059\u3068\u30a2\u30d7\u30ea\u3054\u3068\u843d\u3061\u308b\u3002\uff62java.lang.IllegalStateException: swapBuffers: EGL error: 0x300d\uff63\u3068\u304b\u3001\uff62android.hardware.camera2.CameraAccessException: The camera device has encountered a serious error\uff63\u3068\u304b\u3067\u3066\u308b\u304b\u3089\u3001\u304a\u307e\u74b0\u306e\u6a5f\u7a2e\u554f\u984c\u3067\u3053\u306e\u7aef\u672b(zenfone5)\u3067\u306fCamera2API\u4f7f\u3048\u306a\u3044\u306e\u304b\u306a\u3068\u601d\u3063\u305f\u3093\u3060\u3051\u3069\u3001\u307f\u3093\u306a\u5927\u597d\u304d<a href=\"http:\/\/stackoverflow.com\/questions\/27907090\/android-camera-2-api\" target=\"_blank\">stackoverflow<\/a>\u3067\u89e3\u6c7a\u7b56\u767a\u898b\u3002\u30ea\u30f3\u30af\u5148\u306e\u30a2\u30f3\u30b5\u30fc\u898b\u308c\u3070\u89e3\u6c7a\u7b56\u5168\u90e8\u4e57\u3063\u3066\u308b\u3093\u3060\u3051\u3069\u3001\u4ee5\u4e0b\u5099\u5fd8\u306e\u305f\u3081\u66f8\u304d\u6b8b\u3057\u3066\u304a\u304d\u307e\u3059\u3002\u4e00\u822c\u7684\u306a\u6a5f\u7a2e\u3067\u306f\u3053\u3093\u306a\u3053\u3068\u306b\u306a\u3089\u306a\u3044\u307f\u305f\u3044\u3060\u304b\u3089\u3001\u3053\u306e\u5bfe\u5fdc\u306e\u305b\u3044\u3067\u9006\u306b\u4e0a\u624b\u304f\u52d5\u304b\u306a\u3044\u6a5f\u7a2e\u3082\u3042\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3002\u5f8c\u65e5\u305d\u308c\u3067\u5d4c\u3063\u305f\u308a\u3057\u306a\u3044\u305f\u3081\u3001\u3053\u3046\u3044\u3046\u5bfe\u5fdc\u3057\u3066\u308b\u3088\u3063\u3066\u306e\u3092\u5fd8\u308c\u306a\u3044\u305f\u3081\u3067\u3059\u3002<\/p>\n<p>startRecordingVideo()\u3067\u9332\u753b\u7528\u306bMediaRecorder.getSurface()\u3067\u53d6\u5f97\u3057\u3066CameraCaptureSession\u306b\u6e21\u3057\u3066\u308bsurface\u306f\u3001MediaRecorder.stop()\u3067\u81ea\u52d5\u7684\u306b\u7834\u68c4\u3055\u308c\u308b\u3089\u3057\u3044\u3002\u305d\u306e\u6642\u70b9\u3067\u30bb\u30c3\u30b7\u30e7\u30f3\u304c\u843d\u3061\u3066\u3001\u305d\u308c\u306b\u3064\u3089\u308c\u3066CameraDevice\u81ea\u4f53\u843d\u3061\u308b\u3002\u306a\u306e\u3067\u9332\u753b\u30d7\u30ec\u30d3\u30e5\u30fc\u7528\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u3092closePreviewSession()\u3067\u9589\u3058\u3088\u3046\u3068\u3057\u305f\u3068\u3053\u308d\u3067CameraAccessException\u3067\u30a2\u30d7\u30ea\u5168\u4f53\u304c\u6b7b\u4ea1\u3059\u308b\u3002\u306a\u306e\u3067CameraAccessException\u304c\u51fa\u308b\u524d\u306b\u65e2\u306bEGL error\u3067\u3066\u30a2\u30d7\u30ea\u306e\u51e6\u7406\u306f\u6b7b\u3093\u3067\u308b\u306e\u306d\u3002\u3053\u308c\u304c\u539f\u56e0\u3002\u3057\u304b\u3057\u3053\u3046\u3044\u3046\u6319\u52d5\u3092\u3057\u306a\u3044\u6a5f\u7a2e\u306f\u3069\u3046\u3044\u3046\u51e6\u7406\u3092\u3057\u3066\u308b\u3093\u3060\u308d\u3046\u304b\u3002<br \/>\n\u3067\u3001\u5bfe\u51e6\u3068\u3057\u3066\u306fstopRecordingVideo\u3067\u306fMediaRecorder.stop()\u3092\u3057\u306a\u3044\u3067\u3001\u901a\u5e38\u6642\u306e\u30d7\u30ec\u30d3\u30e5\u30fc\u30bb\u30c3\u30b7\u30e7\u30f3\u306eStateCallback\u306eonReady\u3067MediaRecorder.stop()\u3068reset()\u3092\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u306f\u9332\u753b\u7528\u306e\u30d7\u30ec\u30d3\u30e5\u30fc\u30bb\u30c3\u30b7\u30e7\u30f3\u306eStateCallback\u3001onClosed\u3067\u3084\u308d\u3046\u3068\u3057\u305f\u3093\u3060\u3051\u3069\u3001\u4f55\u6545\u304bonClosed\u306f\u8d70\u3089\u305a\u3001MediaRecorder\u306e\u591a\u91cd\u8d77\u52d5\u3067\u843d\u3061\u3061\u3083\u3046\u3002API\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8(<a href=\"https:\/\/developer.android.com\/reference\/android\/hardware\/camera2\/CameraCaptureSession.StateCallback.html#onClosed\" target=\"_blank\">android.hardware.camera2.CameraCaptureSession<\/a>)\u3092\u8aad\u3080\u3068\u3001onClosed\u306f\u81ea\u5206\u3067\u9589\u3058\u305f\u5834\u5408\u306b\u306f\u547c\u3070\u308c\u306a\u3044\u307f\u305f\u3044\u3002<\/p>\n<blockquote><p>This method is called when the session is closed.<br \/>\n\t\tA session is closed when a new session is created by the parent camera device, or when the parent camera device is closed\n\t\t<\/p><\/blockquote>\n<p>\u306a\u306e\u3067\u901a\u5e38\u30d7\u30ec\u30d3\u30e5\u30fc\u306b\u623b\u3063\u305f\u3068\u304d\u306eonReady\u3067\u3084\u3063\u3066\u307e\u3059\u3002\u30d5\u30e9\u30b0\u306fmIsRecordingVideo\u3092\u6d41\u7528\u3002<\/p>\n<p>\u4ee5\u4e0a\u5099\u5fd8\u3067\u3057\u305f\u3002\u3082\u3057\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u8aad\u3093\u3067\u7406\u89e3\u3057\u305f\u3044\u4eba\u304c\u3044\u305f\u3089\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u4f75\u8aad\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3068\u3044\u3046\u304b\u540c\u3058\u3088\u3046\u306b\u30b5\u30f3\u30d7\u30eb\u8d70\u3089\u305b\u3066\u898b\u3066\u843d\u3061\u3066\u56f0\u3063\u3066\u308b\u4eba\u3057\u304b\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u898b\u306a\u3044\u304bw<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u306f\u6b21\u306e\u30a2\u30d7\u30ea\u958b\u767a\u306e\u305f\u3081Camera2API\u3092\u52c9\u5f37\u4e2d\u3002 googlesamples\u306e\u30b5\u30f3\u30d7\u30eb\u306fAndroidStudio\u3060\u3068\u4e00\u767a\u30a4\u30f3\u30dd\u30fc\u30c8\u3067\u3059\u3050\u52d5\u304b\u305b\u308b\u3093\u3060\u3051\u3069\u3001\u52c9\u5f37\u306e\u305f\u3081\u3042\u3048\u3066\u4e00\u304b\u3089\u66f8\u304d\u5199\u3057\u3066\u308b\u3002\u81ea\u5206\u306e\u4e2d\u3067\u306f\u5199\u7d4c\u3068\u547c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,26],"tags":[46],"class_list":["post-678","post","type-post","status-publish","format-standard","hentry","category-script","category-26","tag-android"],"_links":{"self":[{"href":"https:\/\/beingtested.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/beingtested.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/beingtested.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/beingtested.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/beingtested.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=678"}],"version-history":[{"count":3,"href":"https:\/\/beingtested.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/678\/revisions"}],"predecessor-version":[{"id":681,"href":"https:\/\/beingtested.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/678\/revisions\/681"}],"wp:attachment":[{"href":"https:\/\/beingtested.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/beingtested.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/beingtested.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}