Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions escapi_dll/capture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,13 @@ int CaptureClass::isMediaOk(IMFMediaType *aType, int aIndex)
break;
}
}

if (found)
{
hr = setVideoType(aType);
}
}

return found;
}

Expand Down Expand Up @@ -660,15 +666,21 @@ HRESULT CaptureClass::initCapture(int aDevice)

DO_OR_DIE_CRITSECTION;

hr = setVideoType(type);

DO_OR_DIE_CRITSECTION;

hr = mReader->SetCurrentMediaType(
(DWORD)MF_SOURCE_READER_FIRST_VIDEO_STREAM,
NULL,
type
);
//for default mjpg type , convert to other support type
if (isMediaOk(type, preferredmode))
hr = 0;
else
hr = -1;

//hr = setVideoType(type);
//
//DO_OR_DIE_CRITSECTION;

//hr = mReader->SetCurrentMediaType(
// (DWORD)MF_SOURCE_READER_FIRST_VIDEO_STREAM,
// NULL,
// type
//);

DO_OR_DIE_CRITSECTION;

Expand Down