diff options
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/bootmanager.cpp | 20 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_camera.cpp | 20 |
3 files changed, 44 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 5ecbddf94..7909141c0 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -2146,12 +2146,18 @@ public: | |||
| 2146 | {324, nullptr, "GetUniquePadButtonSet"}, | 2146 | {324, nullptr, "GetUniquePadButtonSet"}, |
| 2147 | {325, nullptr, "GetUniquePadColor"}, | 2147 | {325, nullptr, "GetUniquePadColor"}, |
| 2148 | {326, nullptr, "GetUniquePadAppletDetailedUiType"}, | 2148 | {326, nullptr, "GetUniquePadAppletDetailedUiType"}, |
| 2149 | {327, nullptr, "GetAbstractedPadIdDataFromNpad"}, | ||
| 2150 | {328, nullptr, "AttachAbstractedPadToNpad"}, | ||
| 2151 | {329, nullptr, "DetachAbstractedPadAll"}, | ||
| 2152 | {330, nullptr, "CheckAbstractedPadConnection"}, | ||
| 2149 | {500, nullptr, "SetAppletResourceUserId"}, | 2153 | {500, nullptr, "SetAppletResourceUserId"}, |
| 2150 | {501, nullptr, "RegisterAppletResourceUserId"}, | 2154 | {501, nullptr, "RegisterAppletResourceUserId"}, |
| 2151 | {502, nullptr, "UnregisterAppletResourceUserId"}, | 2155 | {502, nullptr, "UnregisterAppletResourceUserId"}, |
| 2152 | {503, nullptr, "EnableAppletToGetInput"}, | 2156 | {503, nullptr, "EnableAppletToGetInput"}, |
| 2153 | {504, nullptr, "SetAruidValidForVibration"}, | 2157 | {504, nullptr, "SetAruidValidForVibration"}, |
| 2154 | {505, nullptr, "EnableAppletToGetSixAxisSensor"}, | 2158 | {505, nullptr, "EnableAppletToGetSixAxisSensor"}, |
| 2159 | {506, nullptr, "EnableAppletToGetPadInput"}, | ||
| 2160 | {507, nullptr, "EnableAppletToGetTouchScreen"}, | ||
| 2155 | {510, nullptr, "SetVibrationMasterVolume"}, | 2161 | {510, nullptr, "SetVibrationMasterVolume"}, |
| 2156 | {511, nullptr, "GetVibrationMasterVolume"}, | 2162 | {511, nullptr, "GetVibrationMasterVolume"}, |
| 2157 | {512, nullptr, "BeginPermitVibrationSession"}, | 2163 | {512, nullptr, "BeginPermitVibrationSession"}, |
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index c262d0a2b..d3fbdb09d 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp | |||
| @@ -815,6 +815,12 @@ void GRenderWindow::InitializeCamera() { | |||
| 815 | if (Settings::values.ir_sensor_device.GetValue() == cameraInfo.deviceName().toStdString() || | 815 | if (Settings::values.ir_sensor_device.GetValue() == cameraInfo.deviceName().toStdString() || |
| 816 | Settings::values.ir_sensor_device.GetValue() == "Auto") { | 816 | Settings::values.ir_sensor_device.GetValue() == "Auto") { |
| 817 | camera = std::make_unique<QCamera>(cameraInfo); | 817 | camera = std::make_unique<QCamera>(cameraInfo); |
| 818 | if (!camera->isCaptureModeSupported(QCamera::CaptureMode::CaptureViewfinder) && | ||
| 819 | !camera->isCaptureModeSupported(QCamera::CaptureMode::CaptureStillImage)) { | ||
| 820 | LOG_ERROR(Frontend, | ||
| 821 | "Camera doesn't support CaptureViewfinder or CaptureStillImage"); | ||
| 822 | continue; | ||
| 823 | } | ||
| 818 | camera_found = true; | 824 | camera_found = true; |
| 819 | break; | 825 | break; |
| 820 | } | 826 | } |
| @@ -825,10 +831,22 @@ void GRenderWindow::InitializeCamera() { | |||
| 825 | } | 831 | } |
| 826 | 832 | ||
| 827 | camera_capture = std::make_unique<QCameraImageCapture>(camera.get()); | 833 | camera_capture = std::make_unique<QCameraImageCapture>(camera.get()); |
| 834 | |||
| 835 | if (!camera_capture->isCaptureDestinationSupported( | ||
| 836 | QCameraImageCapture::CaptureDestination::CaptureToBuffer)) { | ||
| 837 | LOG_ERROR(Frontend, "Camera doesn't support saving to buffer"); | ||
| 838 | return; | ||
| 839 | } | ||
| 840 | |||
| 841 | camera_capture->setCaptureDestination(QCameraImageCapture::CaptureDestination::CaptureToBuffer); | ||
| 828 | connect(camera_capture.get(), &QCameraImageCapture::imageCaptured, this, | 842 | connect(camera_capture.get(), &QCameraImageCapture::imageCaptured, this, |
| 829 | &GRenderWindow::OnCameraCapture); | 843 | &GRenderWindow::OnCameraCapture); |
| 830 | camera->unload(); | 844 | camera->unload(); |
| 831 | camera->setCaptureMode(QCamera::CaptureViewfinder); | 845 | if (camera->isCaptureModeSupported(QCamera::CaptureMode::CaptureViewfinder)) { |
| 846 | camera->setCaptureMode(QCamera::CaptureViewfinder); | ||
| 847 | } else if (camera->isCaptureModeSupported(QCamera::CaptureMode::CaptureStillImage)) { | ||
| 848 | camera->setCaptureMode(QCamera::CaptureStillImage); | ||
| 849 | } | ||
| 832 | camera->load(); | 850 | camera->load(); |
| 833 | camera->start(); | 851 | camera->start(); |
| 834 | 852 | ||
diff --git a/src/yuzu/configuration/configure_camera.cpp b/src/yuzu/configuration/configure_camera.cpp index 73cdcf3f2..2a61de2a1 100644 --- a/src/yuzu/configuration/configure_camera.cpp +++ b/src/yuzu/configuration/configure_camera.cpp | |||
| @@ -42,6 +42,12 @@ void ConfigureCamera::PreviewCamera() { | |||
| 42 | LOG_INFO(Frontend, "Selected Camera {} {}", cameraInfo.description().toStdString(), | 42 | LOG_INFO(Frontend, "Selected Camera {} {}", cameraInfo.description().toStdString(), |
| 43 | cameraInfo.deviceName().toStdString()); | 43 | cameraInfo.deviceName().toStdString()); |
| 44 | camera = std::make_unique<QCamera>(cameraInfo); | 44 | camera = std::make_unique<QCamera>(cameraInfo); |
| 45 | if (!camera->isCaptureModeSupported(QCamera::CaptureMode::CaptureViewfinder) && | ||
| 46 | !camera->isCaptureModeSupported(QCamera::CaptureMode::CaptureStillImage)) { | ||
| 47 | LOG_ERROR(Frontend, | ||
| 48 | "Camera doesn't support CaptureViewfinder or CaptureStillImage"); | ||
| 49 | continue; | ||
| 50 | } | ||
| 45 | camera_found = true; | 51 | camera_found = true; |
| 46 | break; | 52 | break; |
| 47 | } | 53 | } |
| @@ -57,10 +63,22 @@ void ConfigureCamera::PreviewCamera() { | |||
| 57 | } | 63 | } |
| 58 | 64 | ||
| 59 | camera_capture = std::make_unique<QCameraImageCapture>(camera.get()); | 65 | camera_capture = std::make_unique<QCameraImageCapture>(camera.get()); |
| 66 | |||
| 67 | if (!camera_capture->isCaptureDestinationSupported( | ||
| 68 | QCameraImageCapture::CaptureDestination::CaptureToBuffer)) { | ||
| 69 | LOG_ERROR(Frontend, "Camera doesn't support saving to buffer"); | ||
| 70 | return; | ||
| 71 | } | ||
| 72 | |||
| 73 | camera_capture->setCaptureDestination(QCameraImageCapture::CaptureDestination::CaptureToBuffer); | ||
| 60 | connect(camera_capture.get(), &QCameraImageCapture::imageCaptured, this, | 74 | connect(camera_capture.get(), &QCameraImageCapture::imageCaptured, this, |
| 61 | &ConfigureCamera::DisplayCapturedFrame); | 75 | &ConfigureCamera::DisplayCapturedFrame); |
| 62 | camera->unload(); | 76 | camera->unload(); |
| 63 | camera->setCaptureMode(QCamera::CaptureViewfinder); | 77 | if (camera->isCaptureModeSupported(QCamera::CaptureMode::CaptureViewfinder)) { |
| 78 | camera->setCaptureMode(QCamera::CaptureViewfinder); | ||
| 79 | } else if (camera->isCaptureModeSupported(QCamera::CaptureMode::CaptureStillImage)) { | ||
| 80 | camera->setCaptureMode(QCamera::CaptureStillImage); | ||
| 81 | } | ||
| 64 | camera->load(); | 82 | camera->load(); |
| 65 | camera->start(); | 83 | camera->start(); |
| 66 | 84 | ||