Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(directshow): Fixed problem with crosses initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Diadlo committed Jun 25, 2016
1 parent c3de623 commit 504ad53
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/platform/camera/directshow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ QVector<VideoMode> DirectShow::getDeviceModes(QString devName)
IPin *pin;
if (devFilter->EnumPins(&pins) != S_OK)
return modes;

while (pins->Next(1, &pin, nullptr) == S_OK)
{
IKsPropertySet *p = nullptr;
Expand Down Expand Up @@ -214,20 +215,21 @@ QVector<VideoMode> DirectShow::getDeviceModes(QString devName)
goto next;
if (config->GetNumberOfCapabilities(&n, &size) != S_OK)
goto pinend;

assert(size == sizeof(VIDEO_STREAM_CONFIG_CAPS));
vcaps = new VIDEO_STREAM_CONFIG_CAPS;

for (int i=0; i<n; ++i)
for (int i = 0; i < n; ++i)
{
AM_MEDIA_TYPE* type = nullptr;
VideoMode mode;
if (config->GetStreamCaps(i, &type, (BYTE*)vcaps) != S_OK)
goto nextformat;

if (!IsEqualGUID(type->formattype, FORMAT_VideoInfo)
&& !IsEqualGUID(type->formattype, FORMAT_VideoInfo2))
goto nextformat;

VideoMode mode;
mode.width = vcaps->MaxOutputSize.cx;
mode.height = vcaps->MaxOutputSize.cy;
mode.FPS = 1e7 / vcaps->MinFrameInterval;
Expand Down

0 comments on commit 504ad53

Please sign in to comment.