{"action":"created","issue":{"url":"https://api.github.com/repos/citra-emu/citra/issues/2368","repository_url":"https://api.github.com/repos/citra-emu/citra","labels_url":"https://api.github.com/repos/citra-emu/citra/issues/2368/labels{/name}","comments_url":"https://api.github.com/repos/citra-emu/citra/issues/2368/comments","events_url":"https://api.github.com/repos/citra-emu/citra/issues/2368/events","html_url":"https://github.com/citra-emu/citra/pull/2368","id":197264965,"number":2368,"title":"CAM: build the service framework with a dummy implementation","user":{"login":"wwylele","id":4592895,"avatar_url":"https://avatars.githubusercontent.com/u/4592895?v=3","gravatar_id":"","url":"https://api.github.com/users/wwylele","html_url":"https://github.com/wwylele","followers_url":"https://api.github.com/users/wwylele/followers","following_url":"https://api.github.com/users/wwylele/following{/other_user}","gists_url":"https://api.github.com/users/wwylele/gists{/gist_id}","starred_url":"https://api.github.com/users/wwylele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwylele/subscriptions","organizations_url":"https://api.github.com/users/wwylele/orgs","repos_url":"https://api.github.com/users/wwylele/repos","events_url":"https://api.github.com/users/wwylele/events{/privacy}","received_events_url":"https://api.github.com/users/wwylele/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-22T20:57:44Z","updated_at":"2016-12-24T09:30:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/citra-emu/citra/pulls/2368","html_url":"https://github.com/citra-emu/citra/pull/2368","diff_url":"https://github.com/citra-emu/citra/pull/2368.diff","patch_url":"https://github.com/citra-emu/citra/pull/2368.patch"},"body":"What is included in this PR:\r\n - CAM service cleanup, and abstracted all essential configuration functions into `Camera::CameraInterface`. Implemented asynchronous image receiving from the interface (fixes #1832).\r\n - Made camera configurable from INI file. \r\n - Added three implementation of `Camera::Interface`:\r\n   - `BlankCamera` (default) a dummy camera that always returns black image\r\n   - ~~`V4L2Camera` (Linux only) a V4L2 based camera. The original code is taken from #1947 (credit to @linkmauve). I am not so familiar with linux, tho, so I can't tell if this part of code is good enough.~~\r\n   - ~~`StillImageCamera` (Qt frontend only) a camera that always returns the same image the user selected.~~ (removed as Lioncash suggested. will be in follow-up PRs)\r\n\r\nWhat is not included in this PR and can be done in the future:\r\n - Non-essential configuration functions (white balance, exposure, etc.) implementation.\r\n - Configuration tab for camera in Qt frontend\r\n - ~~Other real camera implementation to support all three major platforms. A candidate is Qt's `QCamera`. This will add a new dependency QtMultiMedia, though.~~ real camera implementation\r\n\r\nThis main part of this PR builds the camera service framework. The framework is based on my test and theory. The test program can be found [here](https://github.com/wwylele/ctrhwtest/tree/master/cam_service_test).\r\n\r\nI put two actual implementations [here](https://github.com/wwylele/citra/commits/camera-more) to show how `CameraInterface` works. The usage of these two cameras:\r\n\r\n - To enable V4L2 camera, you need to assign `V4L2` to `camera_*_name` (the `out_right` one is the most used one) in the ini file, and to assign the device ID (`0` for example) to `camera_*_config`\r\n - To enable still image camera, you need to assign `image` to `camera_*_name` in the ini file, and to assign the image file name to `camera_*_config`\r\n\r\nHere are some points to note in my code:\r\n\r\n - I made CAM service function return SUCCESS even if there is an error in the actual implementation. I made all functions of `Camera::Interface` returns void. I did this because \"returning SUCCESS\" is an expected result on real 3DS, and games may not know how to deal with device errors.\r\n \r\n - (Will add here if I come up with more)\r\n\r\n----\r\n\r\nTested games/apps:\r\n - devKitPro camera example: works fine.\r\n - System camera app: not showing anything. This app calls some undocumented functions.\r\n - Mii Maker (QR reader): capturing works fine. QR reading fails due to unimplemented crypto functions.\r\n - Pokemon Super Mystery Dungeon (title screen without a save): works fine.\r\n - Pokemon Sun / Moon (QR reader): works fine."},"comment":{"url":"https://api.github.com/repos/citra-emu/citra/issues/comments/269076918","html_url":"https://github.com/citra-emu/citra/pull/2368#issuecomment-269076918","issue_url":"https://api.github.com/repos/citra-emu/citra/issues/2368","id":269076918,"user":{"login":"wwylele","id":4592895,"avatar_url":"https://avatars.githubusercontent.com/u/4592895?v=3","gravatar_id":"","url":"https://api.github.com/users/wwylele","html_url":"https://github.com/wwylele","followers_url":"https://api.github.com/users/wwylele/followers","following_url":"https://api.github.com/users/wwylele/following{/other_user}","gists_url":"https://api.github.com/users/wwylele/gists{/gist_id}","starred_url":"https://api.github.com/users/wwylele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwylele/subscriptions","organizations_url":"https://api.github.com/users/wwylele/orgs","repos_url":"https://api.github.com/users/wwylele/repos","events_url":"https://api.github.com/users/wwylele/events{/privacy}","received_events_url":"https://api.github.com/users/wwylele/received_events","type":"User","site_admin":false},"created_at":"2016-12-24T09:30:44Z","updated_at":"2016-12-24T09:30:44Z","body":"Addressed comments above (hopefully, I probably missed one or two because there are so many...). Thanks @lioncash for reviewing!"}}
{"actor":{"display_login":"wwylele"}}