Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program freezes at videoInput.setupDevice() #59

Open
ShikyC opened this issue Jan 24, 2024 · 1 comment
Open

Program freezes at videoInput.setupDevice() #59

ShikyC opened this issue Jan 24, 2024 · 1 comment

Comments

@ShikyC
Copy link

ShikyC commented Jan 24, 2024

I successfully built videoInput within my dll library but when the program runs, it freezes at setting up the camera:

VIDEOINPUT SPY MODE!

SETUP: Looking For Capture Devices
SETUP: 0) HBVCAM FHD CAMERA
SETUP: 1 Device(s) found

SETUP: Setting up device 0

No more outputs from the console since then. I found that it's this line that hangs up:

hr = CoCreateInstance(CLSID_FilterGraph, 0, CLSCTX_INPROC_SERVER,IID_IGraphBuilder, (void**)&VD->pGraph);

Any clues why this happens? I'm using Windows 11.

Code to reproduce the issue:

	videoInput VI;
	int numDevices = VI.listDevices();
	if (numDevices > 0) {
		int vidDevice = 0;
		VI.setupDevice(vidDevice);    // Freezes here
		int width = VI.getWidth(vidDevice);
		int height = VI.getHeight(vidDevice);
		int size = VI.getSize(vidDevice);
	} else {
		printf("No camera devices available.\n");
	}
@ofTheo
Copy link
Owner

ofTheo commented Jan 25, 2024

Hmm - It might be a privilege issue with VI running inside a DLL.

See this thread:
https://stackoverflow.com/questions/1304847/is-it-possible-to-lower-the-privilege-level-when-calling-cocreateinstance-on-vis?rq=3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants