Skip to content

Commit 0ff7299

Browse files
authored
Merge pull request #226 from quartzo/usbuvc
Do not show USB CAM option when ENABLE_USB_CAM is OFF, and default to on in the CMakeLists.txt file.
2 parents ff53897 + dec3d12 commit 0ff7299

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ target_sources(
8282
src/touch-control.hpp
8383
)
8484

85-
option(ENABLE_USB_CAM "Enable USB camera support" OFF)
85+
option(ENABLE_USB_CAM "Enable USB camera support" ON)
8686
if(ENABLE_USB_CAM)
8787
add_compile_definitions(ENABLE_USB_CAM)
8888
target_sources(${CMAKE_PROJECT_NAME} PRIVATE src/ptz-usb-cam.cpp src/ptz-usb-cam.hpp)

src/settings.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ void PTZSettings::on_addPTZ_clicked()
222222
#if defined(ENABLE_ONVIF) // ONVIF disabled until code is reworked
223223
QAction *addOnvif = addPTZContext.addAction("ONVIF (experimental)");
224224
#endif
225+
#if defined(ENABLE_USB_CAM)
225226
QAction *addUsbCam = addPTZContext.addAction("USB Camera (UVC)");
227+
#endif
226228
QAction *action = addPTZContext.exec(QCursor::pos());
227229

228230
#if defined(ENABLE_SERIALPORT)
@@ -271,12 +273,14 @@ void PTZSettings::on_addPTZ_clicked()
271273
ptzDeviceList.make_device(cfg);
272274
}
273275
#endif
276+
#if defined(ENABLE_USB_CAM)
274277
if (action == addUsbCam) {
275278
OBSData cfg = obs_data_create();
276279
obs_data_release(cfg);
277280
obs_data_set_string(cfg, "type", "usb-cam");
278281
ptzDeviceList.make_device(cfg);
279282
}
283+
#endif
280284
}
281285

282286
void PTZSettings::on_removePTZ_clicked()

0 commit comments

Comments
 (0)