Hi!
I am making an app that records the screen and microphone in MacOS, I specifically need it to run in a subprocess, for this I use fork(); The truth is that it marks the following error in loop:
Error:
CMIOHardware.cpp:379:CMIOObjectGetPropertyData Error: 2003332927, failed
2022-03-01 20:19:41.708913+0100 WebCamProj[8051:91700] [] CMIO_Unit_Convertor_VideoToolboxCompressor.cpp:461:rebuildVideoCompressor ### Err -12903
2022-03-01 20:19:41.709213+0100 WebCamProj[8051:91700] [] CMIO_Unit_Convertor_VideoToolboxCompressor.cpp:1958:doCompressBuffer [0x15382da00] EXCEPTION ON ERROR -12903
The example on which I base is the following, it comes from Apple's official website for developers:
https://developer.apple.com/library/archive/qa/qa1740/_index.html
The fragment that executes the operation looks something like this:
pid_t pidScreenRecorder;
if ((pidScreenRecorder = fork()) == 0) {
NSURL *pathUrl = [[NSURL alloc] initFileURLWithPath:[NSString stringWithFormat:@"%@%s", NSHomeDirectory(), "/myScreen.mov"]];
ScreenRecord *screenRec = [[ScreenRecord alloc] init];
[screenRec startScreenRecording:pathUrl];
}
I do not know why this error occurs only with this API, I have used others, for example AVAudioRecorder individually and I have not had any problem.
Thanks you.