I'm trying to do some screen capturing on Mac OS using the standard CGDisplayStreamCreateWithDispatchQueue API, however I keep getting a NULL stream Ref when I call the API, and there is apparently no error information so I can't figure ut why it is failing.
I have tried code from these two sources (with minor tweaks when needed):
Capture screen with CGDisplayStream https://github.com/diederickh/screen_capture/blob/master/src/test/test_mac_api_research.m
I have also tried CGDisplayStreamCreate(), and using a variety of resolutions and pixel formats. I have also confirmed CGGetActiveDisplayList is returning back one CGDirectDisplayID which I am passing to the API call.
Can anyone suggest what might be causing this silent failure?
Thanks.