Skip to content

Commit

Permalink
🐛 Handle errors on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
JulesFouchy committed Aug 12, 2023
1 parent 398a1a0 commit ca0e863
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/webcam_info.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ auto grab_all_webcams_infos_impl() -> std::vector<Info> {
mediaType:AVMediaTypeVideo
position:AVCaptureDevicePositionUnspecified];

if (!discoverySession) {
return list_webcams_infos;
}

NSArray *devices = discoverySession.devices;

for (AVCaptureDevice *device in devices) {
@autoreleasepool {
std::string deviceName = [device.localizedName UTF8String];
std::string deviceName = [[device localizedName] UTF8String];
std::vector<webcam_info::Resolution> list_resolution{};

for (AVCaptureDeviceFormat *format in device.formats) {
Expand Down

0 comments on commit ca0e863

Please sign in to comment.