Skip to content

Commit c4358f9

Browse files
committed
[windows]perfect agora capture.
1 parent d42a440 commit c4358f9

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

windows/APIExample/APIExample/Advanced/CustomVideoCapture/CAgoraCaptureVideoDlg.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ void CAgoraCaptureVideoDlg::EnableCaputre(BOOL bEnable)
290290
if (bEnable == (BOOL)!m_extenalCaptureVideo)return;
291291

292292
int nIndex = m_cmbVideoType.GetCurSel();
293+
CString strInfo;
293294
if (bEnable)
294295
{
295296
//select video capture type.
@@ -299,6 +300,9 @@ void CAgoraCaptureVideoDlg::EnableCaputre(BOOL bEnable)
299300
//create video capture filter.
300301
m_agVideoCaptureDevice.CreateCaptureFilter();
301302
m_agVideoCaptureDevice.GetCurrentVideoCap(&videoInfo);
303+
strInfo.Format(_T("capture-%d: %dx%d"), nIndex, videoInfo.bmiHeader.biWidth, videoInfo.bmiHeader.biHeight);
304+
m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo);
305+
302306
config.dimensions.width = videoInfo.bmiHeader.biWidth;
303307
config.dimensions.height = videoInfo.bmiHeader.biHeight;
304308
m_videoFrame.stride = videoInfo.bmiHeader.biWidth;

windows/APIExample/APIExample/DirectShow/AGDShowVideoCapture.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,13 @@ BOOL CAGDShowVideoCapture::OpenDevice(LPCTSTR lpDevicePath, LPCTSTR lpDeviceName
191191
if (hResult != S_OK)
192192
return FALSE;
193193

194-
_tcscpy_s(m_szActiveDeviceID, MAX_PATH, lpDevicePath);
194+
int nDeviceLen = _tcslen(m_szActiveDeviceID);
195+
if (nDeviceLen > 0) {
196+
_tcscpy_s(m_szActiveDeviceID, MAX_PATH, lpDevicePath);
197+
}
198+
else {
199+
_tcscpy_s(m_szActiveDeviceID, MAX_PATH, lpDeviceName);
200+
}
195201
SelectMediaCap(0);
196202
return TRUE;
197203
}

windows/APIExample/APIExample/DirectShow/DShowHelper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ bool CDShowHelper::EnumDevice(const GUID &type, IMoniker *deviceInfo,
272272
if (deviceName.bstrVal && name && wcscmp(name, deviceName.bstrVal) != 0)
273273
return true;
274274

275-
if (!devicePath.bstrVal || wcscmp(path, devicePath.bstrVal) != 0)
276-
return true;
275+
// if (!devicePath.bstrVal || wcscmp(path, devicePath.bstrVal) != 0)
276+
// return true;
277277

278278
*outfilter = filter;
279279
return false;

0 commit comments

Comments
 (0)