From f59c918e81ffca42cfd6d4d1095cd7e5c7dd28b7 Mon Sep 17 00:00:00 2001 From: kalman Date: Fri, 14 Dec 2018 16:10:22 +0800 Subject: [PATCH] Support windows --- src/mynteye/uvc/win/uvc-wmf.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mynteye/uvc/win/uvc-wmf.cc b/src/mynteye/uvc/win/uvc-wmf.cc index a425ead..d6cf9fe 100644 --- a/src/mynteye/uvc/win/uvc-wmf.cc +++ b/src/mynteye/uvc/win/uvc-wmf.cc @@ -64,7 +64,8 @@ namespace uvc { const std::map fourcc_map = { { 0x56595559, 0x32595559 }, // 'VYUY' => '2YUY' - { 0x59555956, 0x59555932 } // 'YUYV' => 'YUY2' + { 0x59555956, 0x59555932 }, // 'YUYV' => 'YUY2' + { 0x33524742, 0x14 } }; struct throw_error { @@ -756,6 +757,7 @@ void set_device_mode(device &device, int width, int height, int fourcc, int fps, check("IMFMediaType::GetGUID", media_type->GetGUID(MF_MT_SUBTYPE, &subtype)); if (subtype.Data1 != fourcc) continue; + check("MFSetAttributeRatio", MFSetAttributeRatio(media_type, MF_MT_FRAME_RATE, fps, 1)); check("MFGetAttributeRatio", MFGetAttributeRatio(media_type, MF_MT_FRAME_RATE, &uvc_fps_num, &uvc_fps_denom)); if (uvc_fps_denom == 0) continue; //int uvc_fps = uvc_fps_num / uvc_fps_denom;